Unit 5: Fuzzy Sets and Fuzzy Logic

Seven topics: (1) Introduction and Fuzzy Sets, (2) Fuzzy Set Operations, (3) Membership Functions, (4) Fuzzy Logic, (5) Hedges, (6) Fuzzy Propositions and Inference Rules, (7) Fuzzy Systems.


1. Introduction to Fuzzy Logic and Fuzzy Sets

Simple idea

  • Normal (crisp) logic has only two answers: YES (1) or NO (0).
  • Real life is not like that. Is a person who is 179 cm "tall"? Not exactly yes or no. He is tall to some degree.
  • Fuzzy logic allows any value between 0 and 1 (partial truth).

Example: Crisp rule: age below 30 = young.

  • A 29-year-old is 100% young. A 30-year-old is 0% young. One day changes everything, which is unrealistic.
  • Fuzzy: 29 years → 0.9 young, 35 years → 0.6 young, 60 years → 0.05 young. A smooth change.

Diagram: crisp vs fuzzy "Tall"

 CRISP "Tall" (height > 170)          FUZZY "Tall"
 μ                                    μ
 1 |            ┌──────────           1 |              ┌─────────
   |            │                       |            /
 0 |────────────┘                     0 |──────────/
   +------------170------► cm            +--------160----185----► cm
   (sudden jump)                         (gradual increase)

Crisp set vs fuzzy set

Crisp set Fuzzy set
Membership is 0 or 1 Membership is any value from 0 to 1
Sharp boundary Smooth, gradual boundary
"Temperature > 40°C is hot" "Temperature is hot to degree 0.8"
Good for precise digital systems Good for human-like reasoning and control

Fuzzy set definition and notation

  • A fuzzy set A on a universe X is: A = { (x, μA(x)) | x ∈ X, μA(x) ∈ [0, 1] }
  • μA(x) is the membership grade. Closer to 1 means more belonging. 0.5 means "half-in, half-out".
  • Discrete notation: A = 0.2/a + 0.7/b + 1/c. The "/" just pairs the grade with the element. The "+" just separates the pairs (it is not addition).

Example: "Experienced Employee" over years of experience: A = 0/1 + 0.1/2 + 0.2/3 + 0.4/4 + 0.6/5 + 0.8/6 + 0.9/7 + 1/8 + 1/9 + 1/10

  • 3 years of experience = experienced to degree 0.2. 8 or more years = fully experienced (1).

Example (continuous): "Hot water" with temperature x in °C:

  • μHot(x) = 0 for x ≤ 40
  • μHot(x) = (x − 40)/30 for 40 < x < 70
  • μHot(x) = 1 for x ≥ 70
  • Water at 55°C: (55 − 40)/30 = 0.5

Terms of a fuzzy set

Term Meaning
Support All elements with membership greater than 0
Core All elements with membership exactly 1
Boundary Elements with membership between 0 and 1
Height The maximum membership value. Height = 1 means a normal set.
α-cut Crisp set of elements with membership ≥ α
Crossover point The element where membership = 0.5
Convex fuzzy set Has a single "hump" with no dips
 μ
 1 |        ┌────────┐         ← Core (μ = 1)
   |       /          \
0.5|- - - /- - - - - - -\- - -  ← α-cut at α = 0.5
   |     /              \
 0 |────/                \────
   +-------Support (μ > 0)-------►

Applications of fuzzy logic

  • Consumer products: washing machines, rice cookers, air conditioners, vacuum cleaners.
  • Automobiles: anti-lock brakes (ABS), automatic transmission, cruise control.
  • Industry: temperature control in chemical plants, cement kilns, Sendai subway train control (Japan).
  • Decision support: medical diagnosis, credit risk assessment.
  • Others: image processing, pattern recognition, neuro-fuzzy hybrid systems.

Exam answer (5 marks)

Q. What is fuzzy logic? Differentiate between crisp sets and fuzzy sets. Explain fuzzy set terminology.

  1. Fuzzy logic was introduced by Lotfi A. Zadeh in 1965. It is a many-valued logic where the truth value can be any real number between 0 and 1, so it can handle partial truth.
  2. Classical logic allows only two values, true or false. Human reasoning uses vague ideas like "hot", "tall", "heavy". Fuzzy logic lets a machine reason with such imprecise ideas.
  3. Example: a 29-year-old can be "young" to degree 0.9, a 35-year-old to degree 0.6, and a 60-year-old to degree 0.05. This is a smooth, believable change, unlike a sharp crisp cut-off at age 30.
  4. Crisp set: membership is only 0 or 1, boundary is sharp. Fuzzy set: membership is any value in [0, 1], boundary is gradual. (Write the comparison table and draw the crisp vs fuzzy "Tall" graph.)
  5. Definition of a fuzzy set: A = {(x, μA(x)) | x ∈ X, μA(x) ∈ [0,1]}, where μA(x) is the grade of membership of x in A.
  6. Notation: A = Σ μA(xi)/xi for a discrete universe.
  7. Example: Experienced Employee A = 0/1 + 0.1/2 + 0.2/3 + 0.4/4 + 0.6/5 + 0.8/6 + 0.9/7 + 1/8 + 1/9 + 1/10.
  8. Terminology: support (μ > 0), core (μ = 1), boundary (0 < μ < 1), height (maximum μ), α-cut (μ ≥ α), crossover point (μ = 0.5), convex fuzzy set. (Draw the support, core and α-cut figure.)
  9. Applications: washing machines, ABS brakes, air conditioners, subway control, medical diagnosis, image processing.
  10. Conclusion: fuzzy logic gives machines a way to reason like humans, with degrees of truth instead of only true or false.

2. Fuzzy Set Operations

Simple idea

  • Just like normal sets have union, intersection, complement, fuzzy sets have them too.
  • They are done element by element, using the membership values.
  • Easy memory trick: OR = MAX, AND = MIN, NOT = 1 minus.

The three standard (Zadeh) operations

Operation Formula Meaning
Union (OR) μA∪B(x) = max(μA(x), μB(x)) Belongs to A or B
Intersection (AND) μA∩B(x) = min(μA(x), μB(x)) Belongs to A and B
Complement (NOT) μA′(x) = 1 − μA(x) Does not belong to A

Worked example

Let X = {a, b, c, d} A = 0.2/a + 0.7/b + 1/c + 0.4/d B = 0.5/a + 0.3/b + 0.6/c + 0.9/d

Element μA μB Union (max) Intersection (min) A′ (1 − μA)
a 0.2 0.5 0.5 0.2 0.8
b 0.7 0.3 0.7 0.3 0.3
c 1.0 0.6 1.0 0.6 0.0
d 0.4 0.9 0.9 0.4 0.6
  • A ∪ B = 0.5/a + 0.7/b + 1/c + 0.9/d
  • A ∩ B = 0.2/a + 0.3/b + 0.6/c + 0.4/d
  • A′ = 0.8/a + 0.3/b + 0/c + 0.6/d

Practice question (from your notes)

A = 0.3/x1 + 0.6/x2 + 1/x3, B = 0.5/x1 + 0.2/x2 + 0.8/x3

  • A ∪ B = 0.5/x1 + 0.6/x2 + 1/x3
  • A ∩ B = 0.3/x1 + 0.2/x2 + 0.8/x3
  • A′ = 0.7/x1 + 0.4/x2 + 0/x3

Diagram

 A and B overlapping     Union (max)        Intersection (min)
   /\  /\                   /\                  /\ /\
  /  \/  \                 /  \                /  X  \
 /   /\   \               /    \              (small overlap
                        (outer outline)         region only)

Union takes the outer boundary of both curves. Intersection takes the inner (lower) boundary.

Properties

  • Commutative: A∪B = B∪A, A∩B = B∩A
  • Associative: (A∪B)∪C = A∪(B∪C)
  • Distributive: A∩(B∪C) = (A∩B)∪(A∩C)
  • De Morgan's laws: (A∪B)′ = A′∩B′, (A∩B)′ = A′∪B′
  • Idempotent: A∪A = A, A∩A = A

Important difference from crisp sets

In crisp sets, A ∪ A′ = X (everything) and A ∩ A′ = ∅ (nothing). In fuzzy sets these do NOT hold.

  • Take μA(x) = 0.6, so μA′(x) = 0.4.
  • μA∪A′(x) = max(0.6, 0.4) = 0.6, which is not 1.
  • μA∩A′(x) = min(0.6, 0.4) = 0.4, which is not 0.

Other operations (algebraic)

Operation Formula
Algebraic sum μA(x) + μB(x) − μA(x)·μB(x)
Algebraic product μA(x) · μB(x)
Bounded sum min(1, μA(x) + μB(x))
Bounded difference max(0, μA(x) + μB(x) − 1)
Cartesian product (fuzzy relation) μA×B(x, y) = min(μA(x), μB(y))

Exam answer (5 marks)

Q. Explain fuzzy set operations with an example. How do they differ from crisp set operations?

  1. Fuzzy set operations are like classical set operations, but they are defined point by point on membership grades.
  2. Union (OR): μA∪B(x) = max(μA(x), μB(x)). It gives the degree of belonging to A or B.
  3. Intersection (AND): μA∩B(x) = min(μA(x), μB(x)). It gives the degree of belonging to A and B.
  4. Complement (NOT): μA′(x) = 1 − μA(x). It gives the degree of not belonging to A.
  5. Example: A = 0.2/a + 0.7/b + 1/c + 0.4/d and B = 0.5/a + 0.3/b + 0.6/c + 0.9/d.
  6. A ∪ B = 0.5/a + 0.7/b + 1/c + 0.9/d.
  7. A ∩ B = 0.2/a + 0.3/b + 0.6/c + 0.4/d.
  8. A′ = 0.8/a + 0.3/b + 0/c + 0.6/d. (Write the table with all steps and draw the union/intersection diagram.)
  9. Properties: commutative, associative, distributive, De Morgan's laws, idempotent.
  10. Difference from crisp sets: fuzzy sets do not follow the law of excluded middle and the law of contradiction. A ∪ A′ ≠ X and A ∩ A′ ≠ ∅. Example: for μA = 0.6, max(0.6, 0.4) = 0.6 ≠ 1 and min(0.6, 0.4) = 0.4 ≠ 0.
  11. Other operations: algebraic sum, algebraic product, bounded sum, bounded difference, Cartesian product (write the formulas).
  12. Conclusion: fuzzy operations use max, min and 1 − μ, and they follow most classical laws except the excluded middle and contradiction laws.

3. Membership Functions

Simple idea

  • A membership function (MF) is the curve or formula that tells how much a value belongs to a fuzzy set.
  • Input: a number (e.g. temperature 25°C). Output: a degree between 0 and 1.
  • Choosing the right shape is a key step when designing any fuzzy system.

Common shapes

 Triangular         Trapezoidal        Gaussian         Sigmoidal       Singleton
    /\               ┌────┐             .--.            ___________         |
   /  \             /      \           /    \          /                    |
  /    \           /        \         /      \        /                     |
 a  b  c          a  b   c  d              c         c                     x0
Shape Formula Description
Triangular (a, b, c) 0 for x ≤ a; (x−a)/(b−a) for a ≤ x ≤ b; (c−x)/(c−b) for b ≤ x ≤ c; 0 for x ≥ c Three points: left foot, peak, right foot. Simple and cheap to compute.
Trapezoidal (a, b, c, d) Rises from a to b, equals 1 from b to c, falls from c to d Like a triangle with a flat top. Good when a range of values fully fits the concept.
Gaussian μ(x) = exp(−(x−c)² / 2σ²) Smooth bell curve with centre c and width σ. Used when smooth, differentiable curves are needed (neuro-fuzzy).
Sigmoidal μ(x) = 1 / (1 + e^(−a(x−c))) S-shaped. For open-ended ideas like "very large".
Generalized bell μ(x) = 1 / (1 + \ (x−c)/a\
Singleton μ = 1 at one point, 0 elsewhere Used for crisp inputs.

Worked example: triangular MF for "Warm"

(a, b, c) = (20, 30, 40) °C

Temperature Calculation μ(x)
25°C (25 − 20)/(30 − 20) 0.5
30°C peak 1
35°C (40 − 35)/(40 − 30) 0.5
45°C outside range 0

Fuzzification

  • Fuzzification = converting a crisp (exact) input into degrees of membership in fuzzy sets.
  • Example: a reading of 32°C may give Cold = 0, Warm = 0.8, Hot = 0.1. The same value belongs to several sets at once. That is the main difference from crisp classification.

Exam answer (5 marks)

Q. What is a membership function? Explain the different types with examples. What is fuzzification?

  1. A membership function (MF) is a curve that maps each point of the input space (universe of discourse) to a membership value between 0 and 1.
  2. Choosing the right shape and parameters is a key design step in any fuzzy system.
  3. Triangular MF: defined by three points (a, b, c). Formula: 0 for x ≤ a; (x−a)/(b−a) for a ≤ x ≤ b; (c−x)/(c−b) for b ≤ x ≤ c; 0 for x ≥ c. Simple and widely used in control systems.
  4. Trapezoidal MF: defined by (a, b, c, d). It has a flat top (value 1 between b and c). Useful when a range of values fully represents the concept.
  5. Gaussian MF: μ(x) = exp(−(x−c)²/2σ²). Smooth bell curve with centre c and width σ. Preferred when smooth, differentiable functions are needed.
  6. Sigmoidal MF: μ(x) = 1/(1 + e^(−a(x−c))). S-shaped. Used for open-ended concepts like "very large".
  7. Other shapes: generalized bell, and singleton (value 1 at only one point). (Draw all six shapes.)
  8. Example (triangular, "Warm", a = 20, b = 30, c = 40): μ(25) = 0.5, μ(30) = 1, μ(35) = 0.5, μ(45) = 0.
  9. Fuzzification is the process of converting a crisp input value into degrees of membership in one or more fuzzy sets using the membership functions.
  10. Example: a crisp reading of 32°C gives Cold = 0, Warm = 0.8, Hot = 0.1. The value belongs to many sets at the same time.
  11. Conclusion: membership functions are the base of fuzzy systems because they turn exact numbers into fuzzy degrees.

4. Fuzzy Logic: Linguistic Variables and Fuzzy Propositions

Simple idea

  • A linguistic variable takes words as its values instead of numbers. Temperature = "Hot" instead of 38°C.
  • Each word is a fuzzy set with its own membership function.
  • A fuzzy proposition is a statement like "Temperature is Hot", whose truth is a degree (0 to 1), not just true or false.

Linguistic variable

  • Formally it is a quintuple (N, T(N), X, G, M):
    • N = name of the variable
    • T(N) = set of terms (words)
    • X = universe of discourse
    • G = grammar to generate terms
    • M = semantic rule that links each term to a fuzzy set

Example: Temperature

  • Name: Temperature. Universe: 0°C to 100°C.
  • Terms: {Cold, Cool, Warm, Hot}. Each term is a fuzzy set. They overlap, so 28°C can be somewhat "Cool" and somewhat "Warm" together.
 μ
 1 |\    /\      /\        ┌────
   | \  /  \    /  \      /
   |  \/    \  /    \    /
 0 |__________________\__/_______► Temperature (°C)
     Cold   Cool   Warm    Hot

Types of fuzzy propositions

Type Form Truth value Example
Simple x is A μA(x) "Speed is Fast"
Compound (AND) x is A AND y is B min(μA(x), μB(y)) "Temp is Hot AND humidity is High"
Compound (OR) x is A OR y is B max(μA(x), μB(y)) "Temp is Hot OR humidity is High"
Compound (NOT) x is NOT A 1 − μA(x) "Temp is not Hot"
IF-THEN IF x is A THEN y is B Fuzzy rule (see topic 6) "IF Temp is Hot THEN Fan is Fast"
Qualified Has a truth qualifier "It is very true that Temperature is Hot"

Example: μHot = 0.7 and μHigh(humidity) = 0.4

  • "Hot AND High" = min(0.7, 0.4) = 0.4
  • "Hot OR High" = max(0.7, 0.4) = 0.7

Exam answer (5 marks)

Q. Explain fuzzy logic with linguistic variables and fuzzy propositions.

  1. Fuzzy logic extends classical logic by allowing truth values anywhere from 0 (completely false) to 1 (completely true). It lets machines reason with imprecise human language.
  2. A linguistic variable is a variable whose values are words or sentences in natural language instead of numbers. Each word is represented by a fuzzy set.
  3. Formally it is a quintuple (N, T(N), X, G, M): name, set of terms, universe of discourse, grammar, and semantic rule.
  4. Example: Variable = Temperature, universe = [0°C, 100°C], terms = {Cold, Cool, Warm, Hot}. The terms overlap so a value like 28°C is partly Cool and partly Warm. (Draw the overlapping curves.)
  5. A fuzzy proposition is a statement "x is A", where x is a linguistic variable and A is a linguistic term. Its truth value is the membership degree μA(x) in [0, 1].
  6. Simple proposition: "Speed is Fast".
  7. Compound propositions: formed using AND, OR, NOT.
    • x is A AND y is B → truth = min(μA(x), μB(y))
    • x is A OR y is B → truth = max(μA(x), μB(y))
    • NOT A → 1 − μA(x)
  8. IF-THEN proposition: "IF x is A THEN y is B" is a fuzzy rule.
  9. Qualified proposition: includes a truth or probability qualifier. Example: "It is very true that Temperature is Hot".
  10. Example: if μHot = 0.7 and μHigh = 0.4, then Hot AND High = 0.4 and Hot OR High = 0.7.
  11. Conclusion: linguistic variables and fuzzy propositions let fuzzy logic represent everyday statements in a form a computer can calculate.

5. Hedges

Simple idea

  • A hedge is a word like very, somewhat, extremely, slightly that changes the meaning of a fuzzy set.
  • In maths, a hedge is just an operation on the membership value (usually a power).
  • Very = square it (makes it stricter). Somewhat = square root (makes it looser).

Why does "very" lower the value? Being "very tall" is a stronger claim and harder to satisfy, so the membership goes down. Being "somewhat tall" is a weaker claim, so the membership goes up.

Common hedges

Hedge Operation Effect
Very A (concentration) [μA(x)]² Narrows the set, lowers partial memberships
Extremely A [μA(x)]³ Narrows even more
Somewhat / More-or-less A (dilation) [μA(x)]^0.5 Widens the set, raises partial memberships
Slightly A [μA(x)]^(1/3) (approx.) Mild widening
Not A 1 − μA(x) Complement
Indeed A (intensification) 2[μA(x)]² if μ ≤ 0.5; 1 − 2[1 − μA(x)]² if μ > 0.5 Sharpens contrast around 0.5

Worked example

Suppose μTall(x) = 0.8 for a person x.

Statement Calculation Result
Very Tall 0.8² 0.64
Extremely Tall 0.8³ 0.512
Somewhat Tall 0.8^0.5 0.894
Not Tall 1 − 0.8 0.2

Another one: μ = 0.5

  • Very = 0.25, Somewhat = 0.707, Extremely = 0.125.

Diagram

 μ
 1 |                 _________  ← all three reach 1 at the top
   |         ___---""
   |      .-" Somewhat Tall (highest curve, widest)
   |    .-"  Tall
   |  .-"   Very Tall (lowest curve, narrowest)
 0 |_"__________________________► Height

"Somewhat Tall" lies above "Tall", and "Very Tall" lies below "Tall".

Exam answer (5 marks)

Q. What are linguistic hedges? Explain with formulas and examples.

  1. Linguistic hedges (modifiers) are words such as very, somewhat, extremely, slightly and more-or-less that modify the meaning or shape of a fuzzy set.
  2. Mathematically, a hedge is an operator applied to the membership function.
  3. "Very A" (concentration): μ(x) = [μA(x)]². It narrows the set and reduces membership of partial members.
  4. "Extremely A": μ(x) = [μA(x)]³. It concentrates even more than "very".
  5. "Somewhat A" / "More-or-less A" (dilation): μ(x) = [μA(x)]^0.5. It widens the set and increases membership of partial members.
  6. "Slightly A": [μA(x)]^(1/3) (approximately), a mild dilation.
  7. "Not A": 1 − μA(x), the complement.
  8. "Indeed A" (intensification): 2[μA(x)]² if μ ≤ 0.5; 1 − 2[1 − μA(x)]² if μ > 0.5. It sharpens the contrast around the 0.5 crossover point.
  9. Example: let μTall(x) = 0.8.
    • μVery Tall = 0.8² = 0.64
    • μExtremely Tall = 0.8³ = 0.512
    • μSomewhat Tall = 0.8^0.5 = 0.894
  10. Reason: "very tall" is a stronger claim so it is harder to satisfy and the membership falls. "Somewhat tall" is a weaker claim so the membership rises.
  11. Draw the graph showing the Somewhat Tall, Tall and Very Tall curves.
  12. Conclusion: hedges let fuzzy systems understand and use natural language words that change the strength of a statement.

6. Fuzzy Propositions and Inference Rules

Simple idea

  • A fuzzy rule is an IF-THEN statement written with words: IF temperature is Hot THEN fan speed is Fast.
  • The part after IF is the antecedent (condition). The part after THEN is the consequent (result).
  • The inference method works out the output from the rules and the actual input.

Example: fan controller rules

  • R1: IF temperature is Cold THEN fan speed is Slow
  • R2: IF temperature is Warm THEN fan speed is Medium
  • R3: IF temperature is Hot THEN fan speed is Fast

Rules with more than one condition

  • AND: IF x is A AND y is B THEN z is C → firing strength α = min(μA(x), μB(y))
  • OR: IF x is A OR y is B THEN z is C → firing strength α = max(μA(x), μB(y))
  • Firing strength α tells how strongly the rule is activated.

Fuzzy implication (how IF-THEN becomes a number)

Method Formula for μR(x, y)
Mamdani (min) min(μA(x), μB(y))
Larsen (product) μA(x) · μB(y)
Zadeh max(1 − μA(x), min(μA(x), μB(y)))

Mamdani is the most commonly used.

Compositional rule of inference (max-min composition)

  • Used when the given fact A′ matches the rule's condition only partly.
  • μB′(y) = max over x of [ min( μA′(x), μR(x, y) ) ]
  • In words: take the min of the fact and the rule, then take the max over all x.

Steps of fuzzy (Mamdani) inference

 1. FUZZIFY  crisp input  → get μ for each condition
        ▼
 2. APPLY connective: AND = min, OR = max → firing strength α
        ▼
 3. CLIP the consequent MF at height α (implication)
        ▼
 4. AGGREGATE all clipped outputs using max
        ▼
 5. DEFUZZIFY → one crisp output

Worked example

Rule: IF temperature is Hot THEN fan speed is Fast.

  • Fuzzification gives μHot(current temp) = 0.7, so firing strength α = 0.7.
  • Clip the "Fast" curve at height 0.7. Anything above 0.7 is cut off.
 Antecedent: Temp is Hot            Consequent: Fan speed is Fast
 μ                                  μ
 1 |        ┌─────                   1 |       /\
   |       /                          |      /  \
0.7|- - - ●                         0.7|- - ┌────┐ - -   ← clipped at α = 0.7
   |     /|                           |    /      \
 0 |____/ |_____► temp                0 |___/        \____► fan speed
        input

The clipped shape is this rule's output. It is combined (max) with the outputs of other fired rules before defuzzification.

Exam answer (5 marks)

Q. Explain fuzzy IF-THEN rules and the fuzzy inference process with an example.

  1. A fuzzy rule has the form IF x is A THEN y is B, where A and B are linguistic values (fuzzy sets). "x is A" is the antecedent (premise) and "y is B" is the consequent (conclusion).
  2. Example (fan controller): R1: IF temp is Cold THEN fan is Slow. R2: IF temp is Warm THEN fan is Medium. R3: IF temp is Hot THEN fan is Fast.
  3. Multiple conditions: with AND, firing strength α = min(μA(x), μB(y)). With OR, α = max(μA(x), μB(y)).
  4. Fuzzy implication turns a rule into a fuzzy relation R on X × Y. Methods: Mamdani (min): min(μA(x), μB(y)); Larsen (product): μA(x)·μB(y); Zadeh: max(1 − μA(x), min(μA(x), μB(y))).
  5. Compositional rule of inference (max-min composition): when a fact "x is A′" partly matches the rule, the conclusion "y is B′" is found by μB′(y) = max over x of [min(μA′(x), μR(x, y))].
  6. Steps of Mamdani inference:
    1. Fuzzify the crisp input to get μA(x0) for each condition.
    2. Apply the connective (min for AND, max for OR) to get the firing strength α.
    3. Clip (or scale) the consequent membership function at height α.
    4. Aggregate the clipped outputs of all fired rules using max.
    5. Defuzzify to get a crisp output.
  7. Example: Rule: IF temperature is Hot THEN fan speed is Fast. If μHot(current temp) = 0.7, then α = 0.7 and the "Fast" curve is clipped at 0.7. This is combined with other rules' outputs before defuzzification. (Draw the clipping diagram and the 5-step flow.)
  8. Conclusion: fuzzy rules put expert knowledge into IF-THEN form with words, and the inference process turns exact inputs into a final output.

7. Fuzzy Systems

Simple idea

  • A Fuzzy Inference System (FIS) takes a crisp (exact) input, does its reasoning using fuzzy sets and rules, and gives a crisp (exact) output.
  • Example: a washing machine reads dirt level (number) and gives wash time (number). In the middle it thinks with words like "Low", "Medium", "High".

Architecture of a Fuzzy Inference System

                  ┌───────────────┐
                  │   RULE BASE   │ (IF-THEN rules)
                  └───────┬───────┘
                          ▼
 Crisp   ┌──────────┐  ┌───────────────┐  ┌────────────┐   Crisp
 Input──►│ FUZZIFIER│─►│   INFERENCE   │─►│DEFUZZIFIER │──► Output
         │ crisp →  │  │    ENGINE     │  │  fuzzy →   │
         │ fuzzy    │  │ (applies rules)│  │  crisp     │
         └──────────┘  └───────▲───────┘  └────────────┘
                               │
                  ┌────────────┴──────────┐
                  │ DATABASE (membership  │
                  │       functions)      │
                  └───────────────────────┘
Component Function
Fuzzifier Converts crisp inputs into fuzzy degrees of membership
Knowledge base Rule base stores the IF-THEN rules. Database stores the membership function definitions.
Inference engine Does the fuzzy reasoning by combining rules and facts (e.g. max-min composition) to give a fuzzy output
Defuzzifier Converts the fuzzy output into a single crisp value for the real system

Types of fuzzy inference systems

Type Consequent Notes
Mamdani A fuzzy set (e.g. "Fast") Most intuitive and widely used. Output needs defuzzification. Rules are easy for humans to read.
Sugeno (TSK) A linear function or constant, e.g. z = px + qy + r Computationally efficient. Output is a weighted average, so no defuzzification needed. Good for optimisation and adaptive systems (ANFIS).

Defuzzification

Defuzzification converts the final fuzzy output set into one crisp number.

Method Idea
Centroid (Centre of Gravity) z* = ∫μ(z)·z dz / ∫μ(z) dz. The balance point of the area. Most common.
Bisector Vertical line that splits the area into two equal halves
Mean of Maximum (MOM) Average of the values where membership is maximum
Smallest / Largest of Maximum Smallest (or largest) value with maximum membership
Weighted average z* = Σ(αi·zi) / Σαi. Used in Sugeno.
 μ
 1 |    ┌──┐         ┌──┐
   |   /    \__┌──┐_/    \         z* (centroid) = balance point
   |  /            \      \          │
 0 |_/_______________\______\______  ▼
   +--------------------------------► Output z

Centroid calculation (discrete)

Aggregated output: z = 1→0, 2→0.3, 3→0.7, 4→1.0, 5→0.7, 6→0.3, 7→0

z* = Σ(z·μ) / Σμ = (2×0.3 + 3×0.7 + 4×1.0 + 5×0.7 + 6×0.3) / (0.3 + 0.7 + 1.0 + 0.7 + 0.3) = (0.6 + 2.1 + 4.0 + 3.5 + 1.8) / 3.0 = 12.0 / 3.0 = 4.0

Complete worked example: washing machine controller

Inputs: Dirtiness (0 to 100), Grease (0 to 100). Output: Wash time (0 to 60 min).

Rules:

  • R1: IF Dirtiness is Low AND Grease is Low THEN WashTime is Short
  • R2: IF Dirtiness is Medium OR Grease is Medium THEN WashTime is Medium
  • R3: IF Dirtiness is High THEN WashTime is Long

Given (after fuzzification): μLow(Dirt) = 0.2, μMedium(Dirt) = 0.6, μHigh(Dirt) = 0.1; μLow(Grease) = 0.3, μMedium(Grease) = 0.5

Rule Connective Calculation Firing strength α
R1 AND = min min(0.2, 0.3) 0.2
R2 OR = max max(0.6, 0.5) 0.6
R3 single condition μHigh(Dirt) 0.1
  • Each α clips its output set (Short, Medium, Long) at that height.
  • The three clipped sets are combined using max (aggregation).
  • Centroid defuzzification gives one crisp wash time, about 34 minutes.

Flowchart of the whole example

 Dirtiness, Grease (crisp numbers)
              ▼
 FUZZIFY → Low / Medium / High degrees
              ▼
 Apply rules: R1 (min) = 0.2, R2 (max) = 0.6, R3 = 0.1
              ▼
 Clip Short at 0.2, Medium at 0.6, Long at 0.1
              ▼
 AGGREGATE (max of the clipped shapes)
              ▼
 DEFUZZIFY (centroid)
              ▼
 Wash time ≈ 34 minutes

Exam answer (5 marks)

Q. Explain the architecture of a fuzzy inference system. Describe defuzzification methods.

  1. A Fuzzy Inference System (FIS) takes crisp inputs, reasons internally using fuzzy sets and rules, and gives crisp outputs.
  2. Draw the architecture diagram: Crisp input → Fuzzifier → Inference engine (with Rule base and Database) → Defuzzifier → Crisp output.
  3. Fuzzifier: converts crisp input values into degrees of membership in fuzzy sets.
  4. Knowledge base: the rule base stores IF-THEN rules, and the database stores membership function definitions.
  5. Inference engine: performs the fuzzy reasoning by combining rules and facts (for example using max-min composition) to produce a fuzzy output.
  6. Defuzzifier: converts the fuzzy output set into a single crisp value usable by the real system.
  7. Types of FIS:
    • Mamdani: consequent is a fuzzy set, most intuitive and widely used, needs defuzzification.
    • Sugeno (TSK): consequent is a linear function or constant (z = px + qy + r), computationally efficient, output is a weighted average.
  8. Defuzzification converts the aggregated fuzzy output into one crisp number. Methods:
    • Centroid (COG): z* = ∫μ(z)·z dz / ∫μ(z) dz, the balance point of the area. Most common.
    • Bisector: line dividing the area into two equal halves.
    • Mean of Maximum (MOM): average of values with maximum membership.
    • Smallest / Largest of Maximum (SOM / LOM).
    • Weighted average: z* = Σ(αi·zi)/Σαi, used in Sugeno.
  9. Numeric example (centroid): z = 2→0.3, 3→0.7, 4→1.0, 5→0.7, 6→0.3. z* = (0.6 + 2.1 + 4.0 + 3.5 + 1.8)/3.0 = 12.0/3.0 = 4.0.
  10. Application example (washing machine): α1 = min(0.2, 0.3) = 0.2, α2 = max(0.6, 0.5) = 0.6, α3 = 0.1. Clip, aggregate with max, then defuzzify by centroid to get about 34 minutes. (Draw the flowchart.)
  11. Conclusion: a fuzzy inference system converts exact inputs into fuzzy form, applies human-like rules, and converts the result back into an exact output.

Priority for tonight (Unit 5)

  • Must practise (numericals): union, intersection and complement; hedges (very, somewhat); triangular MF values; centroid calculation.
  • Must draw: crisp vs fuzzy graph, six MF shapes, FIS architecture, clipping diagram.
  • Most likely 5-markers: fuzzy set operations, membership functions, hedges, FIS architecture with defuzzification.
  • Easy marks: crisp vs fuzzy table, Mamdani vs Sugeno table, types of fuzzy propositions.

Which unit next? Say the unit number, or quiz for a quick test on Unit 5.

Built With

Share this project:

Updates