Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 36 ยท Getting Started

Crisp Sets vs Fuzzy Thinking

Compare classical crisp sets and Boolean logic with fuzzy sets and fuzzy logic, see why sharp boundaries fail for vague concepts, and how fuzzy logic includes Boolean logic.

Before fuzzy logic makes sense, you need a clear picture of what it improves on. Classical mathematics is built on crisp sets: collections with an exact boundary, where every object is either inside or outside. This lesson reviews crisp sets and Boolean logic, shows where they break down for vague concepts, and then explains how fuzzy logic widens them without throwing anything away.

If you have not read the overview yet, start with What Is Fuzzy Logic?.

Crisp sets and the characteristic function

A crisp set such as "the even numbers" or "adults (age 18 and over)" can be described by a characteristic function that returns 1 for members and 0 for non-members:

TEXT
adult(age) = 1   if age >= 18
adult(age) = 0   otherwise

For any element, the answer is yes or no. There is no third option. The boundary between the two answers is perfectly sharp.

Python Crisp sets as functions

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that min, max and 1 - x reproduce the Boolean operators AND, OR and NOT when the values are only 0 and 1. That small observation will matter in a moment.

Boolean logic in one table

Boolean logic has two values and three basic operators. Every truth table follows from them.

A B A AND B A OR B NOT A
0 0 0 0 1
0 1 0 1 1
1 0 0 1 0
1 1 1 1 0

Computers love this system because it is simple and exact. Programming languages, digital circuits and databases rest on it.

Where sharp boundaries fail

Now try to define "tall" with a crisp set. Where is the line? At 180 cm? Then a person who is 179.9 cm is "not tall" and one who is 180.0 cm is "tall", although you could not see the difference with a ruler, let alone by eye. Move the line and you only move the problem.

This is an old puzzle called the sorites paradox (the paradox of the heap): one grain of sand is not a heap, and adding one grain never turns a non-heap into a heap, so no number of grains makes a heap. The paradox appears because the concept "heap" is gradual, but crisp logic forces a jump somewhere.

Crisp thinking creates several practical problems:

  • Instability. A tiny change in input flips the result completely. A controller using a crisp threshold would switch violently on and off near the threshold.
  • Arbitrary decisions. Someone has to choose the boundary, and any choice is hard to defend.
  • Lost information. 31 ยฐC and 45 ยฐC are both just "hot", although they call for very different actions.

The fuzzy answer: membership in degrees

A fuzzy set replaces the characteristic function by a membership function that may return any value from 0 to 1. Someone who is 175 cm tall can be "tall" to degree 0.4 and someone who is 190 cm to degree 1.

Python Crisp tall versus fuzzy tall

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The fuzzy version keeps the information that 170 cm is "a little tall" and 179.9 cm is "quite tall". Nothing jumps. You still choose a shape (here, a ramp from 165 to 185), but the choice is gentle: moving the ramp slightly changes the answers slightly. Chapter 3 is entirely about choosing such shapes.

Fuzzy logic contains Boolean logic

The most important idea in this lesson: fuzzy logic is a generalisation of Boolean logic, not a replacement. The standard fuzzy operators are

TEXT
A AND B = min(A, B)
A OR  B = max(A, B)
NOT A   = 1 - A

If every input is 0 or 1, these formulas give exactly the Boolean truth table. When inputs lie in between, they produce intermediate answers. Run the check yourself:

Python Fuzzy operators reproduce Boolean logic

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The result for "tall AND fast" is 0.4: a chain is only as strong as its weakest link, so the combined statement is as true as its least true part. Other choices for AND and OR exist; T-norms and S-norms covers them.

One thing fuzzy logic gives up

Some laws of Boolean logic no longer hold exactly. In crisp logic, A AND NOT A is always false and A OR NOT A is always true. In fuzzy logic with min and max they are not, because something that is "tall to degree 0.7" is also "not tall to degree 0.3":

Python The law of excluded middle bends

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

This is not a defect. It is exactly what you want for borderline cases: a borderline tall person is partly tall and partly not tall at the same time.

flowchart LR
    A["Crisp set<br/>membership 0 or 1"] -->|"allow values in between"| B["Fuzzy set<br/>membership in [0, 1]"]
    B -->|"restrict to 0 and 1"| A

Crisp sets are the special case of fuzzy sets whose memberships are only 0 or 1.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What does the characteristic function of a crisp set return?

    A crisp set has a sharp boundary, so every element is either a member (1) or not (0).
  2. 2. With the fuzzy operators min and max, what is 0.8 OR 0.3?

    Fuzzy OR is the maximum of its inputs, so the result is 0.8.
  3. 3. Why is a crisp definition of "tall" at 180 cm unsatisfying?

    At the boundary, 179.9 cm and 180.0 cm get opposite answers although they are practically identical.
  4. 4. What is the relationship between Boolean and fuzzy logic?

    min, max and 1 - x reproduce the Boolean truth tables for inputs 0 and 1, so crisp logic is a special case.
  5. 5. If A = 0.7, what is min(A, NOT A) in standard fuzzy logic?

    NOT A is 0.3 and the minimum of 0.7 and 0.3 is 0.3, not 0. Excluded-middle laws only hold exactly for crisp values.

Summary

  • Crisp sets have sharp boundaries: membership is 0 or 1.
  • Sharp boundaries behave badly for vague concepts (sorites paradox, instability, lost information).
  • Fuzzy sets allow membership between 0 and 1.
  • The fuzzy operators min, max and 1 - x contain Boolean logic as the special case of 0/1 values.
  • Some Boolean laws, such as A AND NOT A = 0, do not hold for intermediate values, which suits borderline cases.

Next: Anatomy of a Fuzzy System