Skip to content
coden

Fuzzy sets and membership functions: how to write down “somewhat warm”

The sharp boundary and the sorites paradox, fuzzy sets and the degree of membership, shapes of membership functions, the linguistic variable, support, core and α-cuts, Zadeh operations and the hedges “very” and “somewhat” — on temperature from cold to hot.

12 minutes Matěj Žalmánek 2026-10-15

Series AI basics Part 32 of 52
  1. Map of artificial intelligence: what is what and how it all fits together
  2. A brief history of artificial intelligence: from Turing to language models
  3. Data, model, training, inference: the basic terms on a single example
  4. How to read mathematical notation: symbols, indices, sums and quantifiers
  5. Sets and relations: the building blocks of definitions in AI
  6. Functions and mappings: why every AI model is a function
  7. Logic and proofs: the rules AI reasons by
  8. Graphs and trees: the structure that both search and neural networks stand on
  9. Linear algebra for machine learning: vectors, matrices and why AI mostly multiplies
  10. Derivatives, the gradient and the chain rule: how a model finds out which way to learn
  11. Gradient descent: how a model learns
  12. What probability is: from rolling dice to the Kolmogorov axioms
  13. Conditional probability and Bayes’ theorem: how to update your estimate when you learn something new
  14. Random variables and the cumulative distribution function: one function that tells you everything about a distribution
  15. Probability density and probability mass functions: why a continuous variable has zero probability at a point
  16. Expected value, variance and covariance: where a distribution lies, how wide it is and what goes with what
  17. Overview of probability distributions: Bernoulli, binomial, Poisson, uniform, normal and exponential
  18. Law of large numbers and central limit theorem: why averages behave so predictably
  19. Statistics and parameter estimation: maximum likelihood, MAP and confidence intervals
  20. Information theory: entropy, cross-entropy and KL divergence — where loss functions come from
  21. State-space search: BFS, DFS, UCS and A* with animations
  22. Games and adversaries: minimax, alpha-beta pruning and Monte Carlo tree search
  23. Constraint satisfaction: backtracking, constraint propagation and AC-3 on sudoku and a map of Czech regions
  24. Logic and knowledge systems: forward and backward chaining, resolution and expert systems
  25. Planning: STRIPS, the blocks world, heuristics from relaxation and planning in AI agents
  26. Local search and simulated annealing: a travelling salesman through the Czech regional capitals
  27. Genetic algorithms: population, crossover, mutation and selection on a backpack for a hike
  28. Evolution strategies and genetic programming: from the one-fifth rule to Kepler’s law
  29. Ant colony optimization: how a pheromone trail finds a short path
  30. Particle swarm optimisation: inertia, personal experience and the swarm’s experience
  31. Neuroevolution: evolving the weights and shape of neural networks, and the NEAT algorithm
  32. Fuzzy sets and membership functions: how to write down “somewhat warm”
  33. Fuzzy logic and probability: why “somewhat warm” does not mean “probably warm”
  34. Fuzzy logic: t-norms, implications and IF–THEN rules
  35. Fuzzy control: Mamdani and Sugeno from a fan to a pole on a cart
  36. Fuzzy clustering: the fuzzy c-means algorithm and points between clusters
  37. Neuro-fuzzy systems (ANFIS): fuzzy rules that learn from data
  38. Markov chains: the transition matrix, the stationary distribution and PageRank
  39. Hidden Markov models: the Viterbi algorithm and the dishonest casino
  40. Bayesian networks: why the grass is wet and what it means for the sprinkler
  41. The Kalman filter: how to estimate where a car is and how fast it goes from imprecise measurements
  42. Types of machine learning: supervised, unsupervised, semi-supervised and more
  43. Prompts, context and RAG: how to give a model the right information
  44. Variational autoencoders (VAE): new images from a continuous latent space
  45. Generative adversarial networks (GAN): the forger versus the detective
  46. Diffusion models: how pure noise becomes an image
  47. Markov decision processes: states, actions, rewards and the Bellman equations
  48. Q-learning and DQN: learning the value of actions, from a table to a neural network
  49. Policy gradient and PPO: learning the policy directly
  50. How an AI agent works: a language model in a loop with tools
  51. Programming with AI agents: the task, tests and review
  52. Evaluating and securing AI systems: how to measure and how to keep watch

Full series syllabus 52 of 83 topics published

What you will take away
  • What a fuzzy set is and why a degree of membership is not a probability.
  • How words like “warm” or “pleasant” are written down as membership functions and how they overlap.
  • How fuzzy intersection, union and complement work and why the law of the excluded middle does not hold.

Useful to know first: Sets and relations: the building blocks of definitions in AI, Functions and mappings: why every AI model is a function

How many grains of sand make a heap? A million certainly do. One certainly does not. And if you take a single grain away from a heap, it is still a heap — so by that logic even one grain would be a heap. The ancient Greeks already knew this paradox, and it shows that many of the words we use to talk about the world have no sharp boundary: tall, warm, fast, almost full. Classical mathematics handles them badly, because an element either belongs to a set or it does not. In 1965 Lotfi Zadeh of the University of California, Berkeley proposed a simple solution: allow an element to belong to a set a little.

This part opens the module on fuzzy logic. It builds on the parts Sets and relations and Functions and mappings.

1. The sharp boundary and its problem

Definition — characteristic function

Let X be a non-empty set (the universe — all the elements we are talking about) and A ⊆ X a classical (crisp) set. The characteristic function of the set A is the function χA : X → {0, 1} given for every x ∈ X by

χA(x) = 1  if x ∈ A;    χA(x) = 0  if x ∉ A.

Conversely, every function χ : X → {0, 1} is the characteristic function of exactly one set, namely A = {x ∈ X : χ(x) = 1}. A crisp set is therefore uniquely determined by its characteristic function: an element x belongs to it if and only if χA(x) = 1.

In plain words

A crisp set is a list with a clear yes and no. Say that “warm” means 25 °C and above. Then 25 °C is warm and 24.9 °C is not — although nobody can tell the difference. A boundary at a single point is arbitrary, and a small change in the input makes a jump in the result.

00.51 0510152025303540 temperature T (°C) degree of membership μ (0–1)
“Warm” as a crisp and as a fuzzy set crisp: from 25 °Cfuzzy

2. Fuzzy set

Definition — fuzzy set (Zadeh, 1965)

Let X be a non-empty set (the universe). A fuzzy set A on X is given by a function μA : X → [0, 1], which we call the membership function; formally it is the set of pairs

A = {(x, μA(x)) : x ∈ X} ⊆ X × [0, 1].

For x ∈ X the number μA(x) ∈ [0, 1] is the degree of membership of the element x in A: the value 1 means “belongs completely”, 0 “does not belong at all”, and the numbers in between “belongs partly”. Two fuzzy sets A, B on X are equal if and only if μA(x) = μB(x) for every x ∈ X.

A crisp set is a special case: if μA(x) ∈ {0, 1} for every x ∈ X, then μA is the characteristic function of the crisp set {x ∈ X : μA(x) = 1}.

In plain words

Instead of “belongs, does not belong”, every element gets a number from zero to one: how much it belongs to the set. 28 °C is “warm” completely (1), 25 °C halfway (0.5), 20 °C not at all (0). In between, membership changes smoothly — no jump between 24.9 and 25.

What matters is what the degree of membership is not: it is not a probability. When 25 °C is “warm” to degree 0.5, it does not mean that there is a fifty-percent chance that it is warm. The temperature is known exactly; it is the word that is vague. The difference between the vagueness of a word and the uncertainty of chance is the subject of the next part.

3. Shapes of membership functions

Definition — common membership functions

In all cases the universe is X = ℝ (or an interval of it) and μ : ℝ → [0, 1] is a membership function; exp(t) = et is the exponential.

  1. The triangular function with parameters a, b, c ∈ ℝ, a < b < c: μ(x) = max(0, min(x − a/b − a, c − x/c − b)). So μ(x) = 0 for x ≤ a and for x ≥ c; on [a, b] it rises linearly from 0 to 1 and on [b, c] it falls linearly from 1 to 0.
  2. The trapezoidal function with parameters a, b, c, d ∈ ℝ, a ≤ b ≤ c ≤ d: for every x ∈ ℝ
    • μ(x) = 0 if x < a or x > d;
    • μ(x) = x − a/b − a if a ≤ x < b;
    • μ(x) = 1 if b ≤ x ≤ c;
    • μ(x) = d − x/d − c if c < x ≤ d.
    For a = b (or c = d) the corresponding interval is empty and the function starts (ends) right at the value 1 — that is how, for example, “cold” (0, 0, 6, 14) below is given.
  3. The Gaussian function with centre m ∈ ℝ and width s > 0: μ(x) = exp(−(x − m)2/2s2) — a smooth hill with its peak μ(m) = 1.
  4. The sigmoid function with steepness a > 0 and centre c ∈ ℝ: μ(x) = 1/1 + exp(−a(x − c)) — a rising smooth transition from 0 (for x → −∞) to 1 (for x → ∞) with the value μ(c) = 0.5; for a < 0 the transition is falling.
In plain words

The shape is chosen by what is natural and what is easy to compute. In practice, triangles and trapezoids win by far most often: a few numbers are enough, everyone understands them and the computations are fast. The exact shape usually matters less than you might think — what matters is where the function starts, where it peaks and where it ends.

μ(x) = max( 0, min( x − a/b − a, c − x/c − b ) )

x − a/b − a
left edge — a line with value 0 at a and value 1 at b; dividing by the length b − a makes the peak come out at exactly 1 regardless of the width
c − x/c − b
right edge — the mirror image: value 1 at b, value 0 at c
min
picks whichever edge is lower at the moment — left of b the right edge is above 1, right of b the left one is; the minimum thus “cuts off” the tip exactly at b
max(0, …)
outside the interval (a, c) the edges would come out negative; but a degree of membership must not drop below 0
A triangle in a single expression — exactly the one computed by the function trojuhelnik below. For “warm” (22, 28, 34) and 25 °C: max(0, min(25 − 22/28 − 22, 34 − 25/34 − 28)) = max(0, min(3/6, 9/6)) = 0.5.
def trojuhelnik(a, b, c):
    return lambda x: max(0.0, min((x - a) / (b - a), (c - x) / (c - b)))

def lichobeznik(a, b, c, d):
    def mu(x):
        if x < a or x > d:
            return 0.0
        if x < b:
            return (x - a) / (b - a)
        return 1.0 if x <= c else (d - x) / (d - c)
    return mu

teplo = trojuhelnik(22, 28, 34)
print(teplo(25), teplo(28), teplo(31))   # 0.5 1.0 0.5

4. Linguistic variable

Definition — linguistic variable (Zadeh, 1975)

For a non-empty set X denote by 𝓕(X) the set of all fuzzy sets on X. A linguistic variable is a quadruple (v, T, X, M), where

  1. v is the name of the variable (for example “temperature”);
  2. X is a non-empty set, the universe (for example the interval [0, 40] °C);
  3. T is a non-empty set of words, the terms — the values the variable takes (for example {cold, pleasant, warm, hot});
  4. M : T → 𝓕(X) is the semantic rule, which assigns to each term t ∈ T a fuzzy set M(t) on X — its meaning.

An element x ∈ X therefore matches the term t to degree μM(t)(x). Zadeh’s original definition is a quintuple: it also contains a syntactic rule that generates the terms (say “very warm” from “warm”); here we take the terms as a fixed list.

In plain words

The words we use to describe temperature overlap — and that is fine. 25 °C is a little “pleasant” and a little “warm”, exactly as a person would put it.

Our temperature has four terms: cold is the trapezoid (0, 0, 6, 14), pleasant the trapezoid (10, 17, 23, 28), warm the triangle (22, 28, 34) and hot the trapezoid (30, 36, 40, 40). The vertical line jumps between sample temperatures:

00.51 0510152025303540 12 °C 0.250.29 25 °C 0.600.50 31 °C 0.500.17 temperature T (°C) degree of membership μ (0–1)
The linguistic variable temperature and the memberships of three temperatures coldpleasantwarmhot
  • 12 °C is “cold” to degree 0.25 and “pleasant” to degree 0.29 — a chilly spring day when you cannot decide.
  • 25 °C is “pleasant” to degree 0.6 and “warm” to degree 0.5.
  • 31 °C is “warm” to degree 0.5 and already “hot” to degree 0.17.
Example — memberships step by step

On each edge, the ratio “how far along the edge we have come” to “how long the edge is” is enough (colours as in the triangle formula above: a rising edge like the left one, a falling edge like the right one):

12 °C, cold (0, 0, 6, 14) on the falling edge: 14 − 12/14 − 6 = 2/8 = 0.25

12 °C, pleasant (10, 17, 23, 28) on the rising edge: 12 − 10/17 − 10 = 2/7 ≈ 0.29

25 °C, pleasant on the falling edge: 28 − 25/28 − 23 = 3/5 = 0.6

25 °C, warm (22, 28, 34) on the rising edge: 25 − 22/28 − 22 = 3/6 = 0.5

31 °C, warm on the falling edge: 34 − 31/34 − 28 = 3/6 = 0.5

31 °C, hot (30, 36, 40, 40) on the rising edge: 31 − 30/36 − 30 = 1/6 ≈ 0.17

The other terms have membership 0 at these temperatures — the temperature lies outside their support.

Notice that the memberships of one temperature need not add up to 1 (at 25 °C they give 1.1). Fuzzy sets are not shares of one whole, but independent answers to the questions “is it cold?”, “is it pleasant?”…

5. Support, core and α-cuts

Definition — support, core, height, α-cut

Let X be a non-empty set and A a fuzzy set on X with membership function μA : X → [0, 1].

  1. The support of the set A is the crisp set supp A = {x ∈ X : μA(x) > 0} — the elements that belong to A at least a little.
  2. The core of the set A is the crisp set core A = {x ∈ X : μA(x) = 1} — the elements that belong completely.
  3. The height of the set A is the number hgt A = sup {μA(x) : x ∈ X} ∈ [0, 1], where sup (the supremum) is the least upper bound of a set of numbers. A is normal if and only if hgt A = 1.
  4. For α ∈ (0, 1] the α-cut of the set A is the crisp set Aα = {x ∈ X : μA(x) ≥ α}.
  5. If X ⊆ ℝ is an interval, A is convex if and only if for every α ∈ (0, 1] the cut Aα is an interval (we count the empty set as an interval). Equivalently: for all x1, x2 ∈ X and λ ∈ [0, 1], μA(λx1 + (1 − λ)x2) ≥ min(μA(x1), μA(x2)).

In words: the support is the elements with non-zero membership, the core the elements with full membership, and the α-cut the elements that belong to A at least to degree α.

In plain words

An α-cut is “how strict we want to be”. The cut at level 0.5 contains the temperatures that are pleasant at least halfway. A fuzzy set can be put back together from its α-cuts — they are the contour lines of the hill. And thanks to them, crisp mathematics can be applied to fuzzy sets too: just carry it out separately at each level α.

00.51 0510152025303540 α-cut 0.5: [13.5, 25.5]support (10, 28)core [17, 23] temperature T (°C) degree of membership μ (0–1)
The term “pleasant”: support, core and the α-cut for α = 0.5 pleasant

For “pleasant” the support is the open interval (10, 28), the core [17, 23] and the α-cut at level 0.5 the interval [13.5, 25.5]. The set is normal (height 1) and convex — like all our terms. (The supremum sup in the definition of height is the least upper bound of the values; for our continuous functions on a closed interval it is simply the maximum.)

Aα = [ a + α (b − a),  d − α (d − c) ]

α
the level of the cut (the amber line in the figure) — how much membership we demand; the higher it is, the further from the edges we must go, and the cut narrows
a
the left end of the support — the left edge rises from here; as α → 0 the cut starts right here
(b − a)
the width of the left edge — on it membership rises from 0 to 1, so it reaches level α after covering the fraction α of this width
d
the right end of the support — from here we measure back to the left
(d − c)
the width of the right edge — the mirror image: from d we go left by the fraction α of this width
The α-cut of a trapezoid (a, b, c, d) for α ∈ (0, 1]: it is enough to solve x − a/b − a = α and d − x/d − c = α. For α = 1 we get the core [b, c].
Example — α-cuts of the term “pleasant” (10, 17, 23, 28)

α = 0.5: [10 + 0.5 · 7, 28 − 0.5 · 5] = [13.5, 25.5]

α = 0.8: [10 + 0.8 · 7, 28 − 0.8 · 5] = [15.6, 24]

α = 1: [10 + 7, 28 − 5] = [17, 23] = core

Colours as in the α-cut formula above: a = 10, b − a = 7, d = 28, d − c = 5.

The cuts nest inside each other: the higher α, the smaller the interval, and each higher one lies inside the lower one. The fuzzy set is put back together as μA(x) = sup {α : x ∈ Aα} — the membership of a point is the highest cut it still falls into.

When the membership function is not given by a formula but, say, by measured points, the α-cut is computed on a fine grid. That is exactly how the program that draws the figures in this part does it:

def alfa_rez(mu, alfa, od=0.0, do=40.0, kroku=4000):
    body = [od + i * (do - od) / kroku for i in range(kroku + 1)]
    uvnitr = [x for x in body if mu(x) >= alfa]
    return (uvnitr[0], uvnitr[-1]) if uvnitr else None   # an interval for a convex set

prijemne = lichobeznik(10, 17, 23, 28)
print(alfa_rez(prijemne, 0.5))    # (13.5, 25.5)

6. Complement, intersection and union

Definition — Zadeh operations

Let X be a non-empty set and A, B fuzzy sets on X with membership functions μA, μB : X → [0, 1]. The complement ¬A, the intersection A ∩ B and the union A ∪ B are the fuzzy sets on X whose membership functions are given for every x ∈ X by

  1. μ¬A(x) = 1 − μA(x),
  2. μA ∩ B(x) = min(μA(x), μB(x)),
  3. μA ∪ B(x) = max(μA(x), μB(x)).

So an element x belongs to the intersection to the degree to which it belongs to whichever of the sets it belongs to less, and to the union to the degree of the one it belongs to more. If A, B are crisp (μA, μB take only the values 0 and 1), these formulas give exactly the characteristic functions of the classical complement X ∖ A, intersection and union.

In plain words

“Pleasant and warm at the same time” is as true as the weaker of the two parts; “pleasant or warm” as true as the stronger one. A chain is as strong as its weakest link, and when one of two is enough, the better one decides.

00.51 0510152025303540 not pleasant = 1 − μ pleasant and warm = min pleasant or warm = max temperature T (°C) degree of membership μ (0–1)
Operations on the terms “pleasant” and “warm” pleasantwarm

At 25 °C “pleasant and warm” is min(0.6, 0.5) = 0.5 and “pleasant or warm” is max(0.6, 0.5) = 0.6 (colours as in the formula below). The intersection reaches at most 0.545 around 25.3 °C, where the two curves cross — no temperature is fully both.

μP ∩ W(x) = min( μP(x), μW(x) )

μP(x)
how “pleasant” the temperature x is (the green curve in the figure)
μW(x)
how “warm” it is (the amber curve) — the two memberships are computed independently, each by its own function
min
“and at the same time” may be at most as true as the weaker part — if it were more, we would be claiming more about the temperature than one of the two words can bear; and for the values 0 and 1, min gives exactly the classical “and”
The union is the same with max (the stronger of the two); the complement 1 − μ flips the scale: what belongs completely does not belong at all, and what belongs halfway stays halfway.
Example — where the intersection is highest

Between 23 and 28 °C pleasant falls and warm rises, so the minimum is highest where the curves cross (colours as in the formula above):

28 − x/5 = x − 22/6

6 (28 − x) = 5 (x − 22)  ⇒  168 − 6x = 5x − 110  ⇒  x = 278/11 ≈ 25.27 °C

μ = 28 − 278/11/5 = 6/11 ≈ 0.545

To the left of the crossing warm is lower, to the right pleasant is — the minimum always falls there.

Here fuzzy sets differ from classical ones in something fundamental. Almost all the familiar rules hold for them — commutativity, associativity, De Morgan's laws — but not the law of the excluded middle. The intersection A ∩ ¬A need not be empty: “pleasant and at the same time not pleasant” has the value 0.5 at 13.5 °C. For vague words this is right — about a temperature that is pleasant halfway, you can at the same time say halfway that it is not pleasant. Other choices of intersection and union (the so-called t-norms) will come in the part on fuzzy logic.

Theorem — De Morgan's laws hold, the excluded middle does not

Let X be a non-empty set, A, B fuzzy sets on X, and ¬, ∩, ∪ the Zadeh operations (definition above). Then

  1. ¬(A ∩ B) = ¬A ∪ ¬B and ¬(A ∪ B) = ¬A ∩ ¬B, i.e. for every x ∈ X, μ¬(A ∩ B)(x) = μ¬A ∪ ¬B(x) and μ¬(A ∪ B)(x) = μ¬A ∩ ¬B(x);
  2. for every x ∈ X, μA ∩ ¬A(x) ≤ ½ and μA ∪ ¬A(x) ≥ ½, with equality in both inequalities if and only if μA(x) = ½.

Proof. (1) Let p = μA(x), q = μB(x) and without loss of generality p ≤ q. Then 1 − min(p, q) = 1 − p, and since 1 − p ≥ 1 − q, also max(1 − p, 1 − q) = 1 − p. The second law likewise with min and max swapped.

(2) The numbers p and 1 − p add up to 1, so the smaller of them is at most ½ and the larger at least ½. ∎

The classical law of the excluded middle requires A ∪ ¬A = X, that is, the value 1 everywhere. For a fuzzy set it holds only where μA is 0 or 1; it is worst at points with membership ½ — for “pleasant” at 13.5 and 25.5 °C, where both A ∩ ¬A and A ∪ ¬A have the value 0.5.

A check with numbers (colours as in the intersection formula above): at 25 °C, ¬(P ∩ W) = 1 − min(0.6, 0.5) = 0.5 and ¬P ∪ ¬W = max(0.4, 0.5) = 0.5.

7. Very warm, somewhat warm

Definition — linguistic hedges (Zadeh, 1972)

Let X be a non-empty set and A a fuzzy set on X. The concentration very A (“very”) and the dilation somewhat A (“somewhat”, “more or less”) are the fuzzy sets on X with membership functions given for every x ∈ X by

μvery A(x) = (μA(x))2,    μsomewhat A(x) = √μA(x).

Since μA(x) ∈ [0, 1], the square and the square root also lie in [0, 1], so these are again fuzzy sets; the values 0 and 1 do not change.

In plain words

Squaring a number between 0 and 1 makes it smaller — and the more so, the smaller it is: 0.5 turns into 0.25, but 1 stays 1. “Very warm” is therefore narrower and stricter than “warm”. The square root, on the other hand, widens the set: 25 °C is “warm” to degree 0.5, “somewhat warm” to degree √0.5 ≈ 0.71 and “very warm” only to degree 0.52 = 0.25 (colours as in the formula below).

00.51 0510152025303540 temperature T (°C) degree of membership μ (0–1)
Warm, very warm and somewhat warm somewhat warm (√μ)warmvery warm (μ²)
Definition — inclusion of fuzzy sets

Let X be a non-empty set and A, B fuzzy sets on X. The fuzzy set A is a subset of B, written A ⊆ B, if and only if

∀x ∈ X : μA(x) ≤ μB(x).

So every element belongs to B at least to the degree to which it belongs to A. For crisp sets this is the usual inclusion: wherever χA(x) = 1, χB(x) = 1 must hold too.

μ(x)2 ≤ μ(x) ≤ √μ(x)   for μ(x) ∈ [0, 1]

μ2
“very” (the red curve) — multiplying by a number of at most 1 never makes anything bigger, so the square lies below the original curve; it takes away the most at middle values and leaves zero and one alone
μ
“warm” itself (the amber curve) — the base term, which the hedges only reshape; neither the support nor the core changes
√μ
“somewhat” (the purple curve) — the square root is the inverse of squaring, so it lifts what squaring presses down: √0.25 = 0.5
That is why very A ⊆ A ⊆ somewhat A: “very warm” is always warm, and what is warm is at least somewhat warm. Repeating gives a scale: “very very” is μ4.
Example — how much “very” narrows and “somewhat” widens

The α-cut at level 0.5 for “warm” (22, 28, 34) is [25, 31]. For the modified terms it is enough to convert the level back to the original μ:

very warm: μ² ≥ 0.5  ⇔  μ ≥ √0.5 ≈ 0.707  →  [22 + 0.707 · 6, 34 − 0.707 · 6] ≈ [26.24, 29.76]

somewhat warm: √μ ≥ 0.5  ⇔  μ ≥ 0.25  →  [22 + 0.25 · 6, 34 − 0.25 · 6] = [23.5, 32.5]

The intervals are computed by the α-cut formula above (colours as there), with the triangle “warm” taken as the trapezoid (22, 28, 28, 34): a = 22, b − a = 6, d = 34, d − c = 6.

The “at least halfway” interval is 6 °C wide for warm, about 3.5 °C for very warm and 9 °C for somewhat warm.

8. Fuzzy sets in practice

  • Fuzzy control. The metro in the Japanese city of Sendai has run since 1987 with a fuzzy controller that accelerates and brakes more smoothly than a human. Around 1990 a wave of fuzzy washing machines, cameras and air conditioners followed in Japan. How such a controller works is explained in the part on fuzzy control.
  • Image processing and clustering. A pixel on the border between two regions can belong a little to both; fuzzy clustering assigns points to several clusters at once.
  • Machine learning. The soft outputs of classifiers or the technique of label smoothing (instead of a certain “it is a cat”, the target “a cat to degree 0.9”) are not fuzzy sets in Zadeh's sense, but they share the idea that membership in a class need not be just 0 or 1.
  • Language. Language models work with words like “quite”, “almost” or “probably not” every day. Fuzzy sets are one of the few tools that give such words a precise, verifiable meaning.

9. Summary

  • A fuzzy set assigns each element a degree of membership from the interval [0, 1]; a crisp set is the special case with the values 0 and 1.
  • Membership functions usually have the shape of a triangle, a trapezoid, a Gaussian hill or a sigmoid.
  • A linguistic variable has words as its values — terms that may overlap; 25 °C is “pleasant” to degree 0.6 and “warm” to degree 0.5.
  • The support, the core and the α-cuts describe the shape of a fuzzy set by crisp sets.
  • The complement is 1 − μ, the intersection the minimum and the union the maximum; the law of the excluded middle does not hold. The hedge “very” is μ², “somewhat” is √μ.

Want to get a feel for it? Have an AI agent draw membership functions for the words you use to describe your own day — “early”, “late”, “a long time” — and ask a few people where they would put the boundaries.

Do you see it differently? Write to support@coden-app.com.

An Agent on your computer, driven from your phone