Fuzzy Logic
Logic where statements are true to a degree between 0 and 1.
The idea
Instead of "hot or not hot", a temperature belongs to the set "hot" with degree 0.7. Fuzzy AND is usually the minimum, OR the maximum and NOT is 1 − x. It lets rules written with everyday words ("fairly warm") be computed with numbers.
AND = min(a, b), OR = max(a, b), NOT = 1 − a
Watch it run
This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.
- cold
- warm
- hot
A fuzzy set lets a value belong to a group by degree (0 to 1) instead of yes or no. Three overlapping sets describe temperature: cold, warm, hot.
Slide the temperature to see the memberships change smoothly.
Step by step
- 1Define fuzzy sets with membership functions (for example cold, warm, hot).
- 2Convert a crisp input into membership degrees (fuzzification).
- 3Combine degrees with AND (min), OR (max) and NOT (1 − x).
- 4Read off the degree of truth of each statement.
Where it is used
Washing machines, camera focus, climate control.
Watch out for
Membership functions are chosen by hand; different choices change behaviour.