Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Fuzzy Logic (wikipedia.org)
86 points by YungSven on March 9, 2020 | hide | past | favorite | 42 comments


Back in the 90s when neural networks and fuzzy logic were the rage and were going to solve all problems of human mankind (déjà vu?), I stumbled upon this nice course put together by Texas A&M in the form of an "ebook" (aka Win3.1 application). Lofti Zadeh himself was a contributor. I looked it up in my bookmarks and I cannot believe that the site is still up:

http://faculty.petra.ac.id/resmana/private/fuzzy

I was very interested in training neural networks to find out optimal fuzzy parameters for robotic control systems as an alternative to gain scheduling. There were some cool small companies making nifty scientific apps that I remember evaluating (Aptronix and Neuralogix come to my mind).


Out of curiosity i downloaded and downloaded the tutorial and it looks to be more of a hyperlinked multimedia(ish) application, similar to something you'd see made in Hypercard (which makes sense since it seems to be made in ToolBook which essentially was a Hypercard clone for Windows 3.1) and less of something like a PDF, something you'd see in an Amazon Kindle or something you'd see as an EPUB (which is what i think most people would associate with ebooks nowadays).

I made a quick capture under VBox with Windows 3.1 for others to see, (though i think it should also work under Wine and otya128's winevdm port to Windows 10):

http://runtimeterror.com/pages/badsector/nyan/gimme/webm/fuz...

EDIT: i started reading it now for real and i have to say it is a very interesting way to teach. In theory the hyperlinked approach would work fine in the web, but i cannot think of anything similar in practice. The closest i can think of was some interactive examples in a blog post i found some years ago about making a 2D game.


Pre-powerpoint app presentations were popular back in the days. In the 80s I recall there was a huge industry of educational presentations for 8-bit Commodore and Atari machines. Some good, some bad, and some very bad. There were a few that were interactive and "hyperlinked". In particular I learned programming Atari ANTIC display lists and players & missiles with one that allowed you to modify things in an editor/debugger in realtime so you could immediately see the changes in the graphics, and also checked your correct responses at the end in the self-evaluation section. Pretty awesome. I wonder if they used an external software to program that or they just did everything themselves, as it was usually done then.

I just downloaded DosBox, installed Win3.1 and the software. I am having a blast down memory lane. It's impressive how your brain can retrieve memories so well with only minimal hints after more than 20 years... the persistence of memory!


I've seen stuff like that back in the early- to mid-2000s. It seems, of course, that most of such ‘multimedia programs’ were educational packages for kids.

But most of all, this reminds me of PowerPoint presentations, which iirc were sometimes similarly made for use at home and with educational content. Also olde .HLP and .CHM ‘books’ were employed in this vein.


I guess you could make something similar with PowerPoint and "jump to slide" actions and VBA macros, but i haven't seen any HLP or CHM (even though CHM could technically do it via JavaScript) that work like that.

Still, what i found interesting was mainly the way this was presented in bite-sized pieces (via the pages that couldn't arbitrarily extend via scrolling), combined with clear graphs/pictures and interactivity (not just hyperlinking, but also end-of-chapter quizzes and in a couple of cases showing values changing live as you move your mouse over them).

Technically simple stuff, of course, and certainly done before (i mean, ToolBook was made in 1989 and is still around, so chances are someone is using it :-P), but not something i see often, which seems to be a shame. I had only heard the name "fuzzy logic" before, but after reading that presentation (just the fundamentals) i got a decent idea about what they are and it was easy to follow the tutorial. In comparison the same URL has a bunch of PDFs, including a text-only tutorial that seemed to describe more or less the same stuff. However i could only glaze over before closing it since i just couldn't focus on it. The interactive stuff is just so much more attractive :-P


Also available as a free textbook: Fuzzy Control by Passino & Yurkovich - http://www2.ece.ohio-state.edu/~passino/FCbook.pdf

I recently read Fuzzy Logic with Engineering Applications by Ross. Helpful and interesting, though he does tend to occasionally spend pages performing every step of a calculation.


A team I was a part of at the uni made a fuzzy logic-based robot for a soft computing course, almost 20 years ago it seems. I rember that we were able to accomplish seemingly complex behavior (light tracking with obstacle avoidance) with only a few very simple fuzzy logic rules. Seems the project page is still up, along with the source code, schematics and documentation (in Croatian): http://www.zemris.fer.hr/predmeti/nenr/


Since we're talking about non-classical logics, I also like modal logic, which deals with uncertainty too, but in a very different way. Here, facts / assertions are not associated with a numeric value, but with a modality, a symbol, meaning "it is possible that F is true", "it is not necessary that F is true", "F is usually true", "F was true yesterday", or "I know I don't know whether F is true or false".

https://en.wikipedia.org/wiki/Modal_logic

It has interesting properties, and it avoids the main pitfal of fuzzy logic IMO: when a fact is associated with a truth value of 0.8, what does that really mean? Why is the truth value 0.8 rather than 0.81, for instance? Can we say so for sure?


The truth value being 0.8 can be mapped to one or more fuzzy sets. That's what you're typically doing. Saying "I don't know" is still possible, because you can define a fuzzy set representing "I don't know". But now you can say how strongly you don't know.

An overlapping alternative is Dempster-Shafer evidence theory, which has "belief functions" and rules on how to combine them.


"Fuzzy logic is a form of many-valued logic in which the truth values of variables may be any real number between 0 and 1 both inclusive. It is employed to handle the concept of partial truth, where the truth value may range between completely true and completely false."

Can someone explain how this is different than bayesian statistics?


Bayesian statistics is one approach to modelling fuzziness and uncertainty, but fuzzy logic explores other approaches. For example, see https://en.wikipedia.org/wiki/Possibility_theory

Also fuzzy logic builds a "traditional" logical framework for deduction on terms, again this is a bit different from Bayesian approach, which is more abductive reasoning.


Apart from the other answers, there is also one important technical difference. Fuzzy logic is truth functional but probability is not. That is, in fuzzy logic, if you know the fuzzy truth value of A and of B, you can calculate the fuzzy truth value of “A and B” “A or B” and so on. Not in probability. If you know, let’s say, A and B both have probably 0.9, you don’t know enough to calculate the probability of “A and B”, which lies somewhere between 0.8 and 0.9, or “ A or B”, which lies between 0.9 and 1.


Yeah but in the real world it doesn't matter does it?

you cannot compute the probability A and B for a reason: they might be related (what if they're mutually exclusive for instance? )

So how does fuzzy logic deals with this?


Fuzzy logic deals with this in the exact same way as classical logic. Note that in classical logic, the truth value of "A and B" and "A or B" is also a function of the truth values of A and of B. When using fuzzy logic you have to make a choice as to which function you use. Typically these functions generalise the classical logic ones in the sense that they behave like the classical ones when using 0 and 1. These functions are defined by a so called T-norm.


That's great in toy theory, like the formal real number system.

How useful is it for modeling real world problem?


Very useful. Many problems are more easily represented as fuzzy sets or fuzzy relations than in other terms. It's particularly good at encoding linguistic variables, such as "very fast", "too cold", "accelerate hard" and so on in a way that it can smoothly overlap them.

It's also useful for encoding uncertainties that are not yet mutually exclusive. There are other logics too (eg Dempster-Shafer evidence theory), often grouped together as "monotone measures".


> So how does fuzzy logic deals with this?

It doesn't, because truth values are not probabilities. They are answers to questions more like “How tall is X” than “How likely is it that X is sufficiently tall”.


Did you wake up early this morning? Can you always answer that by a clear yes or no? When do you draw the limit between them? At 7:30? So if you woke up at 7:29:59 you would answer Yes and later No.

Instead you could put a distribution (but NOT a probability distribution) for belonging in the set of early that would look something like this.

If you wake up before 6:30 it would definitely 100% be early and at 8:30 it would. Or at 8:30 it would not at all, 0%, be early. Between there we would put some kind of partly belonging to Early rises.

In probability it is either or, but lack of knowledge makes us, but put a probability on what it is. In fuzzy logic, it is a bit of both at the same time.


It's better to think of fuzzy logic like correlation in quantum superposition. As opposed to probability which is a different concept that maps to Bayesian logic.

Does not make it much easier to understand? You bet, which is why symbolic logic is much more useful.


Bayesian statistics has to follow Bayes rule. There is a fairly specific framework behind the numbers in Bayes (i.e. probability). Fuzzy logic is looser.

You could say Bayesian statistics is a subset of Fuzzy logic.

Given how informal people have to be in Bayesian statistics to come up with reasonable priors (e.g. uniform), and how well it works by just guessing reasonable values, it could be argued that the power of Bayes is not in the inference but from the slack in the system it permits. Fuzzy logic is pure slack.

I think modern neural networks with activations like leaky relu look more at home in a fuzzy logic textbook than in a statistics text book.


> You could say Bayesian statistics is a subset of Fuzzy logic.

Arguably not. Mathematicians have teased out differences between different many-valued logics and systems. A critical one between probability and fuzziness is that probability includes the axiom of the excluded middle and fuzziness does not. In probability the values of mutually exclusive events must sum to 1.0, in fuzziness they need not, because it doesn't require events to be mutually exclusive in the sense that probability requires.


Yeah, Bayesian is a true model you can chop and change the viewpoint. It's much more sophisticated.


> You could say Bayesian statistics is a subset of Fuzzy logic.

I don't think that's accurate. Concepts like conditional probability and independence have no analogue in fuzzy logic.


Back when I was in school neural networks, fuzzy logic and genetic algorithms were all taught in the same course called soft computing.


Which is odd, because GA isn't like the others at all. We had a similar arrangement. I think the criterion wasn't "these things are similar in approach", more "these things are similar in lack of available rigour."


Consider the likelihood of a dice that can land on both its ”1” side and its ”6” side at the same time?

Assuming that the die is fair, this is not possible in the real world.

Bayesian probability [1] states that this is not possible as expected.

``` P(land1 ^ land6) = P(land1) x P(land6 | land1) = 1/6 x 0 = 0 ```

However, fuzzy logic [1] results in an unintuitive result.

``` T(land1 ^ land6) = min(land1, land6) = min(1/6, 1/6) = 0 ```

[1] https://www.mathsisfun.com/data/bayes-theorem.html [2] http://www.sfu.ca/~jeffpell/papers/FuzzyLogic77.pdf


As far as I can tell... Bayesian statistics is a model of the real world, fuzzy logic is just an easy to compute, bad approximation of reality that assumes everything is independent. (Someone correct me if I’m wrong; I’ve only studied logic and Bayesian stuff, not fuzzy logic)


I built a fuzzy logic controller for a very large sag mill in a gold plant (top ten in the world by size).

But at the end of it managed to reduce it to a one line formula I could get almost identical results from when simulating in Excel.

I don't think this is an unusual case looking at other examples I found on the net - really it is just a form of non linear control and probably the easiest way to deal with a second order system that reverses action over the peak.


Just earlier today I was reading through a lab available as part of the J programming language distribution covering fuzzy logic.

I'm sure I've read the Wikipedia page for fuzzy logic but the lab really helped to drive home some of the concepts. Additionally, it was a very cool application for J, which is often derided as being a strictly numerical tool. The lab describes itself as:

... how to create a linguistic inference system using fuzzy sets. Such systems of linguistic variables are referred to as fuzzy logic systems.

First we describe the concept of membership with nonfuzzy and fuzzy sets. Then we tackle fuzzy membership for scalar and array fuzzy sets, and later inference with array sets.

It really is better to work through the lab within the J system[0], but for those without it is browse-able in plain text online[1]

[0]: Help -> Studio -> Labs -> General Interest / Fuzzy Logic

[1]: https://github.com/jsoftware/labs_labs/blob/master/general/f...


Looks interesting! Haven't heard about J before. I only knew Matlab toolbox for fuzzy sets/logic, and a C and another Java libraries. Shame GitHub syntax hightlight doesn't seem to work well with J files. Will check out the project and try to learn more about it, thanks!


In the 1990's Bob Pease did a series of articles discussing fuzzy logic and how it compared to conventional control systems, here is a link to the first column.

https://www.electronicdesign.com/technologies/digital-ics/ar...


Fuzzy Logic and it's rules are pretty amazing for solving problems. I had a lot of fun solving a heating problem with it. Fuzzy Control Language goes with it https://en.m.wikipedia.org/wiki/Fuzzy_Control_Language


Small community, with few readers, but still gets some links submitted every now and then: https://www.reddit.com/r/fuzzylogic/


Bart Kosko had some interesting results with Fuzzy:

https://en.wikipedia.org/wiki/Bart_Kosko#References


Kind of reminds me of "factor tables", AKA, "fuzzy query-by-example": https://github.com/RowColz/AI


What is the difference between fuzzy logic and control theory?


First is a tool, the latter is a field of science.


A small related thread from 2011: https://news.ycombinator.com/item?id=2134735

Others?


A great application of this in real life is rice cookers.


I think washings machines, some digital cameras, and also a train station system in Japan were some other famous applications (from what I can remember).


Automatic gearboxes, ABS, cruise control, some plant controls. Fuzziness saw strongest uptake in Japan, so any control system developed there has a decent chance of having a fuzzy system at its core.


How so?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: