Fuzzy Logic
Understanding Fuzzy Logic
● Fuzzy logic provides a framework for reasoning that is approximate rather
than exact.
● Unlike traditional binary logic (0 or 1), fuzzy logic allows for varying degrees
of truth.
● Enables more human-like decision-making.
● Example: In temperature sensing, a traditional system classifies
temperatures as “cold” or “warm.”
● Fuzzy logic system can describe temperatures as “slightly warm” or “fairly
cold.”
● Used in AI, automation, and decision-making systems.
Perspectives & Key Takeaways
● Two Perspectives of Fuzzy Logic:
○ Broadly: A technique for handling reasoning that is not strictly binary.
○ Specifically: Generalizes multivalued logics studied in symbolic logic.
● Importance:
○ Enhances human-like reasoning.
○ Reduces rigid classifications.
○ Crucial in AI systems and control mechanisms.
Classical (Crisp) Sets
● Classical (crisp) sets have strict boundaries
where an element either belongs or does
not.
● Defined by a universe of discourse, a
collection of elements sharing common
characteristics.
● Examples:
○ Set of boys and girls in a particular age
group.
○ Clock speeds of computer CPUs.
○ Integers greater than 8: A = {x | x > 8}
● Boundary is fixed
Limitations of Classical Sets
● Classical sets can lead to unrealistic classifications due to rigid boundaries.
● Example:
○ A “tall person” is defined as someone over 6 feet.
○ A person who is 5.999 feet is not considered tall, which is unreasonable.
● Human concepts are fluid:
○ Someone feeling cold at 7°C will likely feel similarly at 6.999°C.
○ Classical sets fail to capture this nuance.
● Solution:
○ Fuzzy sets allow for gradual membership, better representing real-
world scenarios.
Fuzzy Sets
● Unlike crisp sets, fuzzy sets do not have sharp boundaries.
● The boundary is ambiguous, allowing partial membership.
● Membership values:
○ A clear member of the set has a value of 1.
○ A non-member has a value of 0.
○ An element on the boundary has a membership value between 0 and 1.
● The transition from “belonging” to “not belonging” is smooth.
● Membership functions define the degree of membership and provide
flexibility for modeling real-world scenarios.
Example of Fuzzy Sets
● Comparison: Crisp vs. Fuzzy Set
○ Crisp Set: A person taller than 6 feet is “tall.”
○ Fuzzy Set: Height is a gradual measure—someone slightly below 6 feet may
still be considered tall.
● Universe of discourse: Heights from 3 feet to 9 feet.
● The term “tall” is represented as a curve that defines the degree of tallness.
● In abstract concepts like numbers, sharp boundaries may make sense.
● However, real-world concepts, such as human height, require a more flexible
classification.
● Fuzzy sets allow for gradual inclusion, avoiding unnatural distinctions.
Some Fundamental Definitions
Fuzzy Set: A fuzzy set is an extension of a crisp set. Crisp set allow only full
membership or no membership at all, where as fuzzy sets allow partial
membership.
Suppose X is a collection of objects and is collectively denoted by x [i.e., let X(x)
be a non-empty set], then a fuzzy set A in terms of X is defined as set of ordered
pairs:
A = {( x ), μA( x )) : x ε X}
Where, μA(x) is called the membership function of grade of membership (also
known as degree of truth or degree of compatibility).
μ(x)=1 (implies full membership)
Normalized Fuzzy Set
Support
The support of a fuzzy set A in X, is the crisp set of all elements x ∈ X, such that
μA (x) > 0. It is denoted by S(A).
S(A) = {x ∈ X: μA (x) > 0}
Crossover points
If A is a fuzzy set, then its crossover point is a point x ∈ X at which μA (x) = 0.5:
Crossover (A) = {x|μA (x) = 0.5}
Example: Let the universe space X = {1,2,3,….,15} and
fuzzy set A of X be, {(2,0), (3,0.1), (4,0.4), (5,0.5), (7,0.2), (8,0.6), (9,1.0), (10,0),
(11,0)}.
Then, support of fuzzy S(A) = {3,4,5,7,8,9}. and Crossover point of A is x = 5,
since μA (x) = 0.5.
Fuzzy Singleton
A fuzzy singleton is a fuzzy set that has a support of a single point in X and have
membership function μA (x) = 1.
Core
In a fuzzy set A, the core is defined as, the set of all points x in X such that μ A(x) =
1:
Core (A) = {x| μA(x) = 1}
α-cut, strong α-cut
The α-cut or α-level set of a fuzzy set A, is nothing but a crisp set defined by,
Aα= {x|μA(x) ≥ α}, α ∈ [0,1]
An α-cut of a fuzzy set A is Aα that contains all the elements of X that have a
membership greater than or equal to the specified value of α.
Strong α-cut or strong α-level set are defined similarly,
Aαi = { x | μA( x ) > α }, α ∈ [ 0 , 1 ]
Fuzzy set operations
Containment or subset:
Fuzzy set A is said to be the subset of B if and only if μA(x) ≤ μB(x) for all x.
Symbolically,
A ⊆ B ⇔ μA(x) ≤ μB(x)
Union:
The union of two fuzzy sets A and B is related to each other by,
μA∪B(x) = max(μA(x), μB(x))
Intersection
The intersection of two given fuzzy sets, A and B, is the “largest” fuzzy set which is
contained in both A and B
μA ∩ B(x) = min(μA(x), μB(x))
Complement (negation)
The complement of fuzzy set A, denoted by NOT A, is defined as,
μnot A(x) = (1 − μA(x))
Membership Function Formulation
A fuzzy set is completely characterized with its membership function.
A membership function (MF) is graphically represented by a curve that map each
point in the input space to a membership value (or degree of membership) in the
range between 0 and 1.
Membership function allow us to represent a fuzzy set graphically.
The x axis depicts the universe of discourse, whereas the y axis represents the
grades of membership in the [0, 1] interval.
There are various membership functions, the most commonly used ones are:
Triangular membership function
● Trapezoid membership function
● Gaussian membership function
● S-membership function
● Exponential membership functions
● Generalized bell shaped membership function
● Polynomial membership term
Triangular Membership Functions
Defined by a lower limit a, an upper limit b, and a value m, where a < m < b. the
tuple {a, m, b}, denotes the location of the corresponding corners.
The triangular MF is given by:
Trapezoidal Membership Function
Defined by a lower limit a, an upper limit d, a lower support limit b, and an upper
support limit c, where a < b < c < d.
Two special categories of a trapezoidal function, called as R- function and L-
function.
L-Functions
● Due to their simple formulae and computational efficiency, both triangular and trapezoidal MFs
have been extensively used in real time applications.
● However, they are not smooth at the corner points.
Gaussian Membership Function
Described by a central parameter m and a standard deviation denoted by k; k > 0.
The smaller the value of k is, the narrower the “bell” is.
S-membership function
● The point m = (a + b) / 2 is known as the crossover point of the S-function.
Generalized Bell membership function
A generalized bell membership function has three parameters: a –responsible for
its width, c – responsible for its center and b –responsible for its slopes.
Fuzziness vs. Probability
Illustrative Example
A thirsty man in a desert is given two glasses of water:
● Glass A (Fuzziness): Water is partially poisonous (0.1 degree)—causes illness but
not death.
● Glass B (Probability): Water is either pure (90%) or fully poisonous (10%)—could
be fatal.
Key Difference
● Fuzziness represents gradual change and partial truth (shades of gray), where
elements belong to a category to varying degrees.
● Probability represents uncertainty and binary outcomes (black or white), measuring
how likely an event is to happen.
Fuzzy Membership
Let a, b, c, d, and e be five students who scored 55, 35, 60, 85 and 75 out of 100
respectively in Mathematics. The students constitute the universe of discourse U =
{a, b, c, d, e} and a fuzzy set M of the students who are good in Mathematics is
defined on U with the help of the following membership function.
M = {(a, 0.375), (c, 0.5), (d, 1.0), (e, 0.875)} OR
OPERATIONS ON FUZZY SETS
Example (Fuzzy Set Operation)
U(universe of discourse): {Grand-pa, Grand-ma, Dad,
Mom, Sister, Brother, Aunt}
Fuzzy set A of senior persons: A = {(Grand-pa, 1.0), (Grand-ma, 0.825), (Dad,
0.275), (Mom, 0.2), (Aunty, 0.55)} OR
The membership function for A is:
Fuzzy set B of active persons:
Example 2
Properties of fuzzy set operations
Note: The relations P ∪ P ′ = U, and P ∩ P ′ = Φ obeyed by crisp sets
are no longer valid for fuzzy sets.
FUZZY RELATIONS
● Fuzzy sets as generalization of crisp sets where the degree of inclusiveness
of an element may be anything from 0 to 1.
● In a similar fashion, the concept of a relation between two, or more, sets can
be generalized to fuzzy relation.
Crisp Relations:
● Crisp relation R between two crisp sets A and B, two elements, x from A and y
from B, are either related, or not. (no scope of being partially related)
● Crisp relation is defined as a subset of the Cartesian product of sets
Example
In relation matrix form:
The entries of relation matrix are defined as:
Example:
Let P = {Tony, Bobby, Mike} be a set of three students and Q = {Math, Phy, Chem}
be a set of three subjects in which Tony, Bobby, and Mike have taken a test.
A relation R between a student and a subject in which they have secured A grade
as:
R = {(x, y) | x ∈ P, y ∈ Q, and x has secured grade A in subject y}.
The corresponding relation matrix is:
Operations on relations
Union, intersection, complementation, composition.
Example:
Let relation matrices TR , TS , TT are:
Operations on relations (cont.)
Composition (R ° S):
(0, 1) ∈ R ° T because (0, 2) ∈ R and (2, 1) ∈ T.
Computations of other elements of R ° T are:
Fuzzy Relations
● Fuzzy relations: Generalization of crisp relations.
● Entries of the relation matrix would be anything between 0 and 1.
Fuzzy Cartesian product:
● Let A and B be two fuzzy sets on reference sets X and Y respectively. The fuzzy
Cartesian product of A and B, denoted by A × B, is defined as A × B ⊆ X × Y, and μ A ×
(a, b) = min {μA(a), μB(b)} ∀a ∈ X, ∀b ∈ Y.
B
Example: Fuzzy sets A and B:
● A fuzzy relation R between two fuzzy sets A and B is a subset of the fuzzy
Cartesian product A×B. Hence R ⊆ A × B.
Operations on Fuzzy Relations
Example:
FUZZY LOGIC BASICS
Fuzzy Truth Values:
➔ In classical (or crisp) logic there are only two possible truth values, true and
false.
➔ Unlike crisp truth values, there are various fuzzy truth values including the
crisp truth values.
FUZZY LOGIC BASICS
Fuzzy Truth Values:
➔ In classical (or crisp) logic there are only two possible truth values, true and false.
➔ Unlike crisp truth values, there are various fuzzy truth values including the crisp
truth values.
Example:
● Classical Logic: A temperature sensor defines “Hot” as temperatures above 30°C (strict boundary).
● Fuzzy Logic: Instead of a hard threshold, we define a membership function where:
○ 28°C → 0.2 (Slightly Hot)
○ 30°C → 0.5 (Moderately Hot)
○ 35°C → 0.9 (Very Hot)
○ 40°C → 1 (Completely Hot)
This enables smooth transitions rather than abrupt changes.
Fuzzy Proposition
A fuzzy proposition is a statement where truth values are not strictly true or
false but lie in a range [0,1], indicating the degree of truth.
Example:
● Classical Proposition: "The water is hot" (either true or false).
● Fuzzy Proposition: "The water is somewhat hot (0.6 truth value)" or "The
water is very hot (0.9 truth value)".
This approach helps in natural decision-making where conditions are subjective.
Linguistic Variables: Expressing Propositions in Human Terms
A linguistic variable takes words instead of numbers to describe a condition.
These words are represented by fuzzy sets.
Example:
For Speed of a Car, instead of exact numbers, we use:
● Slow (0–40 km/h)
● Moderate (30–70 km/h)
● Fast (60–100 km/h)
Fuzzy Logic Operations: Making Decisions Based on Fuzzy Propositions
Fuzzy logic uses special operations to process fuzzy values. These are similar to
classical logic operations but work with degrees of truth.
Basic Operations:
1. Fuzzy Union (OR, max) – "At least one condition should hold."
○ If "Weather is Warm" = 0.6
○ If "Weather is Humid" = 0.8
○ Then "Weather is Warm OR Humid" = max(0.6, 0.8) = 0.8
2. Fuzzy Intersection (AND, min) – "Both conditions should hold."
○ If "Traffic is Heavy" = 0.7
○ If "Road is Slippery" = 0.5
○ Then "Traffic is Heavy AND Road is Slippery" = min(0.7, 0.5) = 0.5
3. Fuzzy Negation (NOT, 1 - value) – "Opposite of a condition."
○ If "Air is Polluted" = 0.6
○ Then "Air is NOT Polluted" = 1 - 0.6 = 0.4
Fuzzy truth and linguistic variables
● Consider the fuzzy proposition p = ‘Anita is young’.
● predicate young is a linguistic value of the linguistic variable age.
● Other possible linguistic values of age are very young, middle-aged, aged, old, very
old, and so on.
●
FUZZY RULES
● The core of fuzzy inference system is the fuzzy rule base, which consists of a
set of fuzzy rules.
● An elementary fuzzy rule R is a statement of the form:
If p Then q
● p and q are atomic fuzzy propositions known as the antecedent and the
consequent respectively.
● A fuzzy statement p = ‘x is A’: Its truth value is given by the membership value
of the fuzzy set A
● The fuzzy rule R : If ‘x is A’ Then ‘y is B’
● Symbolically expressed as R : A (x) → B (y)
The fuzzy rule If ‘x is A’ Then ‘y is B’ can be expressed as a fuzzy relation
between A and B where
Two popular interpretations of fuzzy rule are by:
1. Mamdani
2. Zadeh
● Mamdani’s interpretation of fuzzy rule:
● Zadeh’s interpretation of fuzzy rule:
● Equivalent to the relation:
Example
Using Zadeh’s interpretation, the truth value of rule R is expressed by the relation:
Fuzzy If-Then-Else
● A fuzzy If-Then-Else rule R has the form:
where A is a fuzzy set on some universe U and B and C are fuzzy sets on the
universe V.
● The truth value of R:
● Represented as:
Example