Department of Information Technology 1Soft Computing (ITC4256 )
Introduction to Fuzzy Logic
Dr. C.V. Suresh Babu
Professor
Department of IT
Hindustan Institute of Science & Technology
Department of Information Technology 2Soft Computing (ITC4256 )
Discussion Topics
• Outline to the left in green
• Current topic in yellow
• References
• Introduction
• Crisp Variables
• Fuzzy Variables
• Fuzzy Logic Operators
• Fuzzy Control
• Case Study
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 3Soft Computing (ITC4256 )
References
• L. Zadah, “Fuzzy sets as a basis of possibility”
Fuzzy Sets Systems, Vol. 1, pp3-28, 1978.
• T. J. Ross, “Fuzzy Logic with Engineering
Applications”, McGraw-Hill, 1995.
• K. M. Passino, S. Yurkovich, "Fuzzy Control"
Addison Wesley, 1998.
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 4Soft Computing (ITC4256 )
Introduction
• Fuzzy logic is not a vague logic system, but a system of logic
for dealing with vague concepts.
• Fuzzy logic:
– A way to represent variation or imprecision in logic
– A way to make use of natural language in logic
– Approximate reasoning
• Humans say things like "If it is sunny and warm today, I will
drive fast"
• Linguistic variables:
– Temp: {freezing, cool, warm, hot}
– Cloud Cover: {overcast, partly cloudy, sunny}
– Speed: {slow, fast}
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 5Soft Computing (ITC4256 )
Characteristics of Fuzzy Logic
• Implements machine learning technique.
• Mimics the logic of human thought.
• Logic may have two values which represent two possible solutions.
• Highly suitable for uncertain or approximate reasoning.
• Fuzzy logic view of inference.
• Allows to build nonlinear functions of arbitrary complexity.
• Guidance of experts needed.
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 6Soft Computing (ITC4256 )
Crisp Sets
• Crisp Sets or Classical Sets.
1. Classical set is a collection of distinct objects. For example, a set of students
passing grades.
2. Let A is a given set. The membership function can be use to define a set A is
given by:
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 7Soft Computing (ITC4256 )
Crisp Sets (Cont…)
3. Operations on classical sets: For two sets A and B and Universe X:
i. Union:
This operation is also called logical OR.
ii. Intersection:
This operation is also called logical AND.
iii. Complement:
iv. Difference:
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 8Soft Computing (ITC4256 )
Crisp Sets (Cont…)
4. Properties of classical sets: For two sets A and B and Universe X:
i. Commutativity:
ii. Associativity:
iii. Distributivity:
iv. Idempotency:
v. Identity:
vi. Transitivity:
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 9Soft Computing (ITC4256 )
Quiz - Questions
1. --------- is not a vague logic system, but a system of logic for dealing with
vague concepts.
a) fuzzy logic b) crisp logic c) neuron logic d) triple logic
2. What is the other name of crisp sets?
a) fuzzy sets b) classical sets c) cartesian sets d) neuron sets
3. ---------- is a collection of distinct objects.
a) fuzzy sets b) classical sets c) cartesian sets d) neuron sets
4. What is the other name of intersection operation?
a) logical AND b) logical NOR c) logical NAND d) logical OR
5. What is the other name of union operation?
a) logical AND b) logical NOR c) logical NAND d) logical OR
Department of Information Technology 10Soft Computing (ITC4256 )
Quiz - Answers
1. --------- is not a vague logic system, but a system of logic for dealing with
vague concepts.
a) fuzzy logic
2. What is the other name of crisp sets?
b) classical sets
3. ---------- is a collection of distinct objects.
b) classical sets
4. What is the other name of intersection operation?
a) logical AND
5. What is the other name of union operation?
d) logical OR
Department of Information Technology 11Soft Computing (ITC4256 )
Fuzzy Sets
1. Fuzzy set is a set having degrees of membership between 1 and 0. Fuzzy sets
are represented with tilde character(~). For example, Number of cars following
traffic signals at a particular time out of all cars present will have membership
value between [0,1].
2. A fuzzy set A~ in the universe of discourse, U, can be defined as a set of
ordered pairs and it is given by
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 12Soft Computing (ITC4256 )
Fuzzy Sets (Cont…)
5. When the universe of discourse, U, is discrete and finite, fuzzy set A~ is
given by
where “n” is a finite value.
6. Fuzzy sets also satisfy every property of classical sets.
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 13Soft Computing (ITC4256 )
Fuzzy Sets (Cont…)
7. Common Operations on fuzzy sets: Given two Fuzzy sets A~ and B~
i. Union: Fuzzy set C~ is union of Fuzzy sets A~ and B~ :
ii. Intersection: Fuzzy set D~ is intersection of Fuzzy sets A~ and B~ :
iii. Complement: Fuzzy set E~ is complement of Fuzzy set A~ :
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 14Soft Computing (ITC4256 )
Fuzzy Sets (Cont…)
8. Some other useful operations on Fuzzy set:
i. Algebraic sum:
ii. Algebraic product:
iii. Bounded sum:
iv. Bounded difference:
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 15Soft Computing (ITC4256 )
Quiz - Questions
1. Which one of the following is not a property of crisp set?
a) associativity b) identity c) transitivity d) linearity
2. Does fuzzy set satisfy all the properties of crisp set?
a) true b) false
3. Which of the following are the 2 algebraic operations on fuzzy sets?
a) sum b) product c) difference d) complement
4. Which of the following are the 2 bounded operations on fuzzy sets?
a) sum b) product c) difference d) complement
5. What are the 3 common operations on fuzzy sets?
Department of Information Technology 16Soft Computing (ITC4256 )
Quiz - Answers
1. Which one of the following is not a property of crisp set?
d) linearity
2. Does fuzzy set satisfy all the properties of crisp set?
a) true
3. Which of the following are the 2 algebraic operations on fuzzy sets?
a) sum b) product
4. Which of the following are the 2 bounded operations on fuzzy sets?
a) sum c) difference
5. What are the 3 common operations on fuzzy sets?
i. union ii. Intersection iii. complement
Department of Information Technology 17Soft Computing (ITC4256 )
Fuzzy Linguistic Variables
• Fuzzy Linguistic Variables are used to represent
qualities spanning a particular spectrum
• Temp: {Freezing, Cool, Warm, Hot}
• Membership Function
• Question: What is the temperature?
• Answer: It is warm.
• Question: How warm is it?
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 18Soft Computing (ITC4256 )
Membership Functions
• Temp: {Freezing, Cool, Warm, Hot}
• Degree of Truth or "Membership"
50 70 90 1103010
Temp. (F°)
Freezing Cool Warm Hot
0
1
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 19Soft Computing (ITC4256 )
Membership Functions
• How cool is 36 F° ?
50 70 90 1103010
Temp. (F°)
Freezing Cool Warm Hot
0
1
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 20Soft Computing (ITC4256 )
Membership Functions
• How cool is 36 F° ?
• It is 30% Cool and 70% Freezing
50 70 90 1103010
Temp. (F°)
Freezing Cool Warm Hot
0
1
0.7
0.3
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 21Soft Computing (ITC4256 )
Fuzzy Logic
• How do we use fuzzy membership functions in
predicate logic?
• Fuzzy logic Connectives:
– Fuzzy Conjunction, 
– Fuzzy Disjunction, 
• Operate on degrees of membership in fuzzy sets
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 22Soft Computing (ITC4256 )
Fuzzy Disjunction
• AB max(A, B)
• AB = C "Quality C is the
disjunction of Quality A and B"
0
1
0.375
A
0
1
0.75
B
(AB = C)  (C = 0.75)
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 23Soft Computing (ITC4256 )
Fuzzy Conjunction
• AB min(A, B)
• AB = C "Quality C is the
conjunction of Quality A and B"
0
1
0.375
A
0
1
0.75
B
(AB = C)  (C = 0.375)
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 24Soft Computing (ITC4256 )
Example: Fuzzy Conjunction
Calculate AB given that A is .4 and B is 20
0
1
A
0
1
B
.1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 25Soft Computing (ITC4256 )
Example: Fuzzy Conjunction
Calculate AB given that A is .4 and B is 20
0
1
A
0
1
B
.1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40
Determine degrees of membership:
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 26Soft Computing (ITC4256 )
Example: Fuzzy Conjunction
Calculate AB given that A is .4 and B is 20
0
1
A
0
1
B
.1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40
Determine degrees of membership:
A = 0.7
0.7
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 27Soft Computing (ITC4256 )
Example: Fuzzy Conjunction
Calculate AB given that A is .4 and B is 20
0
1
A
0
1
B
.1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40
Determine degrees of membership:
A = 0.7 B = 0.9
0.7
0.9
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 28Soft Computing (ITC4256 )
Example: Fuzzy Conjunction
Calculate AB given that A is .4 and B is 20
0
1
A
0
1
B
.1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40
Determine degrees of membership:
A = 0.7 B = 0.9
Apply Fuzzy AND
AB = min(A, B) = 0.7
0.7
0.9
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 29Soft Computing (ITC4256 )
Fuzzy Control
• Fuzzy Control combines the use of fuzzy
linguistic variables with fuzzy logic
• Example: Speed Control
• How fast am I going to drive today?
• It depends on the weather.
• Disjunction of Conjunctions
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 30Soft Computing (ITC4256 )
Inputs: Temperature
• Temp: {Freezing, Cool, Warm, Hot}
50 70 90 1103010
Temp. (F°)
Freezing Cool Warm Hot
0
1
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 31Soft Computing (ITC4256 )
Inputs: Temperature, Cloud Cover
• Temp: {Freezing, Cool, Warm, Hot}
• Cover: {Sunny, Partly, Overcast}
50 70 90 1103010
Temp. (F°)
Freezing Cool Warm Hot
0
1
40 60 80 100200
Cloud Cover (%)
OvercastPartly CloudySunny
0
1
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 32Soft Computing (ITC4256 )
Fuzzy Relations
• The characteristic function of a crisp relation can be generalized to allow
tuples to have degrees of membership.
• Then a fuzzy relation is a fuzzy set defined on tuples (x1, . . . , xn) that may
have varying degrees of membership within the relation.
• The membership grade indicates strength of the present relation between
elements of the tuple.
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 33Soft Computing (ITC4256 )
Output: Speed
• Speed: {Slow, Fast}
50 75 100250
Speed (mph)
Slow Fast
0
1
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 34Soft Computing (ITC4256 )
Rules
• If it's Sunny and Warm, drive Fast
Sunny(Cover)Warm(Temp) Fast(Speed)
• If it's Cloudy and Cool, drive Slow
Cloudy(Cover)Cool(Temp) Slow(Speed)
• Driving Speed is the combination of output of
these rules...
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 35Soft Computing (ITC4256 )
Example Speed Calculation
• How fast will I go if it is
– 65 F°
– 25 % Cloud Cover ?
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 36Soft Computing (ITC4256 )
Fuzzification:
Calculate Input Membership Levels
• 65 F°  Cool = 0.4, Warm= 0.7
50 70 90 1103010
Temp. (F°)
Freezing Cool Warm Hot
0
1
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 37Soft Computing (ITC4256 )
Fuzzification:
Calculate Input Membership Levels
• 65 F°  Cool = 0.4, Warm= 0.7
• 25% Cover Sunny = 0.8, Cloudy = 0.2
50 70 90 1103010
Temp. (F°)
Freezing Cool Warm Hot
0
1
40 60 80 100200
Cloud Cover (%)
OvercastPartly CloudySunny
0
1
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 38Soft Computing (ITC4256 )
...Calculating...
• If it's Sunny and Warm, drive Fast
Sunny(Cover)Warm(Temp)Fast(Speed)
0.8  0.7 = 0.7
 Fast = 0.7
• If it's Cloudy and Cool, drive Slow
Cloudy(Cover)Cool(Temp)Slow(Speed)
0.2  0.4 = 0.2
 Slow = 0.2
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 39Soft Computing (ITC4256 )
Defuzzification:
Constructing the Output
• Speed is 20% Slow and 70% Fast
• Find centroids: Location where membership is
100%
50 75 100250
Speed (mph)
Slow Fast
0
1
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 40Soft Computing (ITC4256 )
Defuzzification:
Constructing the Output
• Speed is 20% Slow and 70% Fast
• Find centroids: Location where membership is
100%
50 75 100250
Speed (mph)
Slow Fast
0
1
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 41Soft Computing (ITC4256 )
Defuzzification:
Constructing the Output
• Speed is 20% Slow and 70% Fast
• Speed = weighted mean
= (2*25+...
50 75 100250
Speed (mph)
Slow Fast
0
1
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 42Soft Computing (ITC4256 )
Defuzzification:
Constructing the Output
• Speed is 20% Slow and 70% Fast
• Speed = weighted mean
= (2*25+7*75)/(9)
= 63.8 mph
50 75 100250
Speed (mph)
Slow Fast
0
1
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 43Soft Computing (ITC4256 )
Definition of Relation
• A relation among crisp sets X1, . . . ,Xn is a subset of X1 × . . . × Xn
denoted as R(X1, . . . , Xn ) or R(Xi | 1 ≤ i ≤ n).
• So, the relation R(X1, . . . ,Xn ) ⊆ X1 × . . . × Xn is set, too.
• The basic concept of sets can be also applied to relations:
- containment, subset, union, intersection, complement
• Each crisp relation can be defined by its characteristic function
R(x1, . . . , xn) = 1, if and only if (x1, . . . , xn) ∈ R,
0, otherwise.
• The membership of (x1, . . . , xn) in R signifies that the elements of
(x1, . . . , xn) are related to each other.
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 44Soft Computing (ITC4256 )
Relation as Ordered Set of Tuples
A relation can be written as a set of ordered tuples.
Thus R(X1, . . . ,Xn) represents n-dim. membership array R = [ri1,...,in].
• Each element of i1 of R corresponds to exactly one member of X1.
• Each element of i2 of R corresponds to exactly one member of X2.
And so on...
If (x1, . . . , xn) ∈ X1 × . . . × Xn corresponds to ri1,...,in ∈ R, then
ri1,...,in = 1, if and only if (x1, . . . , xn) ∈ R,
0, otherwise.
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 45Soft Computing (ITC4256 )
Cartesian Product of Relation
• Cartesian Product of Fuzzy Sets: n Dimensions
• Let n ≥ 2 fuzzy sets A1, . . . ,An be defined in the universes of discourse
X1, . . . ,Xn, respectively.
• The Cartesian product of A1, . . . ,An denoted by A1 × . . . × An is a
fuzzy relation in the product space X1 × . . . × Xn.
• It is defined by its membership function
µA1×...×An(x1, . . . , xn) = ⊤ (µA1(x1), . . . , µAn(xn))
whereas xi ∈ Xi, 1 ≤ i ≤ n.
• Usually ⊤ is the minimum (sometimes also the product).
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 46Soft Computing (ITC4256 )
Cartesian Product of Relation (Cont…)
• Cartesian Product of Fuzzy Sets: 2 Dimensions
• A special case of the Cartesian product is when n = 2.
• Then the Cartesian product of fuzzy sets A ∈ F(X) and B ∈ F(Y ) is a fuzzy relation
A × B ∈ F(X × Y ) defined by
• µA×B(x, y) = ⊤ [µA(x), µB(y)] , ∀x ∈ X, ∀y ∈ Y .
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 47Soft Computing (ITC4256 )
Quiz - Questions
1. A ---------- can be written as a set of ordered tuples.
a) fuzzy set b) relation c) crisp set d) Cartesian product
2. The ------------ indicates strength of the present relation between
elements of the tuple.
a) membership grade b) ownership grade c) fellowship grade d) none
3. The fuzzy relation can also be represented by an n-dimensional membership
array.
a) crisp relation b) fuzzy set c) fuzzy relation d) crisp set
4. The ------------ of two sets A and B, denoted A × B, is the set of all
possible ordered pairs where the elements of A are 1st and the elements of B
are 2nd.
a) Cartesian product b) fuzzy set c) crisp set d) relation
5. Two common methods for illustrating a Cartesian product are an -------- and a
---------- diagram.
a) array & linked list b) array & graph c) array & tree d) graph & tree
Department of Information Technology 48Soft Computing (ITC4256 )
Quiz - Answers
1. b) relation
2. a) membership grade
3. c) fuzzy relation
4. a) Cartesian product
5. c) array & tree
Department of Information Technology 49Soft Computing (ITC4256 )
Notes: Follow-up Points
• Fuzzy Logic Control allows for the smooth
interpolation between variable centroids with
relatively few rules
• This does not work with crisp (traditional
Boolean) logic
• Provides a natural way to model some types of
human expertise in a computer program
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 50Soft Computing (ITC4256 )
Notes: Drawbacks to Fuzzy logic
• Requires tuning of membership functions
• Fuzzy Logic control may not scale well to large or
complex problems
• Deals with imprecision, and vagueness, but not
uncertainty
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 51Soft Computing (ITC4256 )
Crisp Equivalence Relation
• The relation R is an equivalence relation and it has the following three
properties:
- Reflexivity
- Symmetry
- Transitivity
• Reflexivity
(xi ,xi ) ∈ R or χR(xi ,xi ) = 1
When a relation is reflexive every vertex in the graph originates a single
loop, as shown in
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 52Soft Computing (ITC4256 )
Crisp Equivalence Relation (Cont…)
• Symmetry
(xi, xj ) ∈ R -> (xj, xi) ∈ R
• Transitivity
(xi ,xj ) ∈ R and (xj ,xk) ∈ R -> (xi ,xk) ∈ R
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 53Soft Computing (ITC4256 )
Crisp Tolerance Relation
• A tolerance relation R (also called a proximity relation) on a universe X is a
relation that exhibits only the properties of reflexivity and symmetry.
Example:
Suppose in an airline transportation system we have a universe composed of five
elements: the cities Omaha, Chicago, Rome, London, and Detroit. The airline is
studying locations of potential hubs in various countries and must consider air
mileage between cities and take-off and landing policies in the various countries.
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 54Soft Computing (ITC4256 )
Crisp Equivalence & Tolerance Relation - Example
• These cities can be enumerated as the elements of a set, i.e.,
X ={x1,x2,x3,x4,x5}={Omaha, Chicago, Rome, London, Detroit}
• Suppose we have a tolerance relation, R1, that expresses relationships among
these cities:
This relation is reflexive and symmetric.
• The graph for this tolerance relation
If (x1,x5) ∈ R1can become an equivalence
relation.
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 55Soft Computing (ITC4256 )
Crisp Equivalence & Tolerance Relation - Example
• This matrix is equivalence relation because it has (x1,x5)
Five-vertex graph of equivalence relation
(reflexive, symmetric, transitive)
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 56Soft Computing (ITC4256 )
Fuzzy Tolerance & Equivalence Relation
• Reflexivity μR(xi, xi) = 1
• Symmetry μR(xi, xj ) = μR(xj, xi)
• Transitivity μR(xi, xj ) =λ1 and μR(xj, xk) = λ2
μR(xi, xk) =λ whereλ ≥ min[λ1, λ2].
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 57Soft Computing (ITC4256 )
Fuzzy Tolerance & Equivalence Relation - Example
Suppose, in a biotechnology experiment, five potentially new strains of
bacteria have been detected in the area around an anaerobic corrosion pit on a
new aluminium-lithium alloy used in the fuel tanks of a new experimental
aircraft. In order to propose methods to eliminate the bio corrosion caused by
these bacteria, the five strains must first be categorized. One way to categorize
them is to compare them to one another. In a pairwise comparison, the
following " similarity" relation,R1, is developed. For example, the first strain
(column 1) has a strength of similarity to the second strain of 0.8, to the third
strain a strength of 0 (i.e., no relation), to the fourth strain a strength of 0.1,
and so on. Because the relation is for pairwise similarity it will be reflexive
and symmetric. Hence,
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 58Soft Computing (ITC4256 )
Fuzzy Tolerance & Equivalence Relation - Example
is reflexive and symmetric. However, it is not transitive
μR(x1, x2) = 0.8, μR(x2, x5) = 0.9 ≥ 0.8
but
μR(x1, x5) = 0.2 ≤ min(0.8, 0.9)
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 59Soft Computing (ITC4256 )
Fuzzy Tolerance & Equivalence Relation - Example
One composition results in the following relation:
where transitivity still does not result; for example,
μR2(x1, x2) = 0.8 ≥ 0.5 and μR2(x2, x4) = 0.5
But
μR2(x1, x4) = 0.2 ≤ min(0.8, 0.5)
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 60Soft Computing (ITC4256 )
Fuzzy Tolerance & Equivalence Relation - Example
Finally, after one or two more compositions, transitivity results:
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 61Soft Computing (ITC4256 )
Non-Interactive Fuzzy Sets
• A non-interactive fuzzy set is defined as follows. We are defining fuzzy set
A on the Cartesian space X=X1 x X2.
• Set A is separable into two non-interactive fuzzy sets called orthogonal
projections, if and only if
• The equations represent membership functions for the orthographic
projections of A on universes X1 and X2, respectively.
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary
Department of Information Technology 62Soft Computing (ITC4256 )
Quiz - Questions
1. What are the properties exhibited by an equivalence relation R?
2. What are the properties exhibited by a tolerance relation R?
3. The independent events in probability theory are ---------- to non-interactive
fuzzy sets in fuzzy theory.
a) analogous b) digital c) both a & b d) none
4. Relations can be also be used to represent -----------.
a) ambiguity b) dissimilarity c) similarity d) none
5. A binary relation is called an --------------- if it is reflexive, symmetric
and transitive.
a) tolerance relation b) tuple c) crisp relation d) equivalence relation
Department of Information Technology 63Soft Computing (ITC4256 )
Quiz - Answers
1. i. Reflexivity ii. Symmetry iii. Transitivity
2. i. Reflexivity ii. Symmetry
3. a) analogous
4. c) similarity
5. d) equivalence relation
Department of Information Technology 64Soft Computing (ITC4256 )
Summary
• Fuzzy Logic provides way to calculate with imprecision
and vagueness
• Fuzzy Logic can be used to represent some kinds of
human expertise
• Fuzzy Membership Sets
• Fuzzy Linguistic Variables
• Fuzzy AND and OR
• Fuzzy Control
References
Introduction
Crisp Variables
Fuzzy Sets
Linguistic Variables
Membership
Functions
Fuzzy Logic
Fuzzy OR
Fuzzy AND
Example
Fuzzy Control
Variables
Rules
Fuzzification
Defuzzification
Summary

Introduction to fuzzy logic

  • 1.
    Department of InformationTechnology 1Soft Computing (ITC4256 ) Introduction to Fuzzy Logic Dr. C.V. Suresh Babu Professor Department of IT Hindustan Institute of Science & Technology
  • 2.
    Department of InformationTechnology 2Soft Computing (ITC4256 ) Discussion Topics • Outline to the left in green • Current topic in yellow • References • Introduction • Crisp Variables • Fuzzy Variables • Fuzzy Logic Operators • Fuzzy Control • Case Study References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 3.
    Department of InformationTechnology 3Soft Computing (ITC4256 ) References • L. Zadah, “Fuzzy sets as a basis of possibility” Fuzzy Sets Systems, Vol. 1, pp3-28, 1978. • T. J. Ross, “Fuzzy Logic with Engineering Applications”, McGraw-Hill, 1995. • K. M. Passino, S. Yurkovich, "Fuzzy Control" Addison Wesley, 1998. References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 4.
    Department of InformationTechnology 4Soft Computing (ITC4256 ) Introduction • Fuzzy logic is not a vague logic system, but a system of logic for dealing with vague concepts. • Fuzzy logic: – A way to represent variation or imprecision in logic – A way to make use of natural language in logic – Approximate reasoning • Humans say things like "If it is sunny and warm today, I will drive fast" • Linguistic variables: – Temp: {freezing, cool, warm, hot} – Cloud Cover: {overcast, partly cloudy, sunny} – Speed: {slow, fast} References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 5.
    Department of InformationTechnology 5Soft Computing (ITC4256 ) Characteristics of Fuzzy Logic • Implements machine learning technique. • Mimics the logic of human thought. • Logic may have two values which represent two possible solutions. • Highly suitable for uncertain or approximate reasoning. • Fuzzy logic view of inference. • Allows to build nonlinear functions of arbitrary complexity. • Guidance of experts needed. References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 6.
    Department of InformationTechnology 6Soft Computing (ITC4256 ) Crisp Sets • Crisp Sets or Classical Sets. 1. Classical set is a collection of distinct objects. For example, a set of students passing grades. 2. Let A is a given set. The membership function can be use to define a set A is given by: References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 7.
    Department of InformationTechnology 7Soft Computing (ITC4256 ) Crisp Sets (Cont…) 3. Operations on classical sets: For two sets A and B and Universe X: i. Union: This operation is also called logical OR. ii. Intersection: This operation is also called logical AND. iii. Complement: iv. Difference: References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 8.
    Department of InformationTechnology 8Soft Computing (ITC4256 ) Crisp Sets (Cont…) 4. Properties of classical sets: For two sets A and B and Universe X: i. Commutativity: ii. Associativity: iii. Distributivity: iv. Idempotency: v. Identity: vi. Transitivity: References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 9.
    Department of InformationTechnology 9Soft Computing (ITC4256 ) Quiz - Questions 1. --------- is not a vague logic system, but a system of logic for dealing with vague concepts. a) fuzzy logic b) crisp logic c) neuron logic d) triple logic 2. What is the other name of crisp sets? a) fuzzy sets b) classical sets c) cartesian sets d) neuron sets 3. ---------- is a collection of distinct objects. a) fuzzy sets b) classical sets c) cartesian sets d) neuron sets 4. What is the other name of intersection operation? a) logical AND b) logical NOR c) logical NAND d) logical OR 5. What is the other name of union operation? a) logical AND b) logical NOR c) logical NAND d) logical OR
  • 10.
    Department of InformationTechnology 10Soft Computing (ITC4256 ) Quiz - Answers 1. --------- is not a vague logic system, but a system of logic for dealing with vague concepts. a) fuzzy logic 2. What is the other name of crisp sets? b) classical sets 3. ---------- is a collection of distinct objects. b) classical sets 4. What is the other name of intersection operation? a) logical AND 5. What is the other name of union operation? d) logical OR
  • 11.
    Department of InformationTechnology 11Soft Computing (ITC4256 ) Fuzzy Sets 1. Fuzzy set is a set having degrees of membership between 1 and 0. Fuzzy sets are represented with tilde character(~). For example, Number of cars following traffic signals at a particular time out of all cars present will have membership value between [0,1]. 2. A fuzzy set A~ in the universe of discourse, U, can be defined as a set of ordered pairs and it is given by References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 12.
    Department of InformationTechnology 12Soft Computing (ITC4256 ) Fuzzy Sets (Cont…) 5. When the universe of discourse, U, is discrete and finite, fuzzy set A~ is given by where “n” is a finite value. 6. Fuzzy sets also satisfy every property of classical sets. References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 13.
    Department of InformationTechnology 13Soft Computing (ITC4256 ) Fuzzy Sets (Cont…) 7. Common Operations on fuzzy sets: Given two Fuzzy sets A~ and B~ i. Union: Fuzzy set C~ is union of Fuzzy sets A~ and B~ : ii. Intersection: Fuzzy set D~ is intersection of Fuzzy sets A~ and B~ : iii. Complement: Fuzzy set E~ is complement of Fuzzy set A~ : References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 14.
    Department of InformationTechnology 14Soft Computing (ITC4256 ) Fuzzy Sets (Cont…) 8. Some other useful operations on Fuzzy set: i. Algebraic sum: ii. Algebraic product: iii. Bounded sum: iv. Bounded difference: References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 15.
    Department of InformationTechnology 15Soft Computing (ITC4256 ) Quiz - Questions 1. Which one of the following is not a property of crisp set? a) associativity b) identity c) transitivity d) linearity 2. Does fuzzy set satisfy all the properties of crisp set? a) true b) false 3. Which of the following are the 2 algebraic operations on fuzzy sets? a) sum b) product c) difference d) complement 4. Which of the following are the 2 bounded operations on fuzzy sets? a) sum b) product c) difference d) complement 5. What are the 3 common operations on fuzzy sets?
  • 16.
    Department of InformationTechnology 16Soft Computing (ITC4256 ) Quiz - Answers 1. Which one of the following is not a property of crisp set? d) linearity 2. Does fuzzy set satisfy all the properties of crisp set? a) true 3. Which of the following are the 2 algebraic operations on fuzzy sets? a) sum b) product 4. Which of the following are the 2 bounded operations on fuzzy sets? a) sum c) difference 5. What are the 3 common operations on fuzzy sets? i. union ii. Intersection iii. complement
  • 17.
    Department of InformationTechnology 17Soft Computing (ITC4256 ) Fuzzy Linguistic Variables • Fuzzy Linguistic Variables are used to represent qualities spanning a particular spectrum • Temp: {Freezing, Cool, Warm, Hot} • Membership Function • Question: What is the temperature? • Answer: It is warm. • Question: How warm is it? References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 18.
    Department of InformationTechnology 18Soft Computing (ITC4256 ) Membership Functions • Temp: {Freezing, Cool, Warm, Hot} • Degree of Truth or "Membership" 50 70 90 1103010 Temp. (F°) Freezing Cool Warm Hot 0 1 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 19.
    Department of InformationTechnology 19Soft Computing (ITC4256 ) Membership Functions • How cool is 36 F° ? 50 70 90 1103010 Temp. (F°) Freezing Cool Warm Hot 0 1 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 20.
    Department of InformationTechnology 20Soft Computing (ITC4256 ) Membership Functions • How cool is 36 F° ? • It is 30% Cool and 70% Freezing 50 70 90 1103010 Temp. (F°) Freezing Cool Warm Hot 0 1 0.7 0.3 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 21.
    Department of InformationTechnology 21Soft Computing (ITC4256 ) Fuzzy Logic • How do we use fuzzy membership functions in predicate logic? • Fuzzy logic Connectives: – Fuzzy Conjunction,  – Fuzzy Disjunction,  • Operate on degrees of membership in fuzzy sets References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 22.
    Department of InformationTechnology 22Soft Computing (ITC4256 ) Fuzzy Disjunction • AB max(A, B) • AB = C "Quality C is the disjunction of Quality A and B" 0 1 0.375 A 0 1 0.75 B (AB = C)  (C = 0.75) References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 23.
    Department of InformationTechnology 23Soft Computing (ITC4256 ) Fuzzy Conjunction • AB min(A, B) • AB = C "Quality C is the conjunction of Quality A and B" 0 1 0.375 A 0 1 0.75 B (AB = C)  (C = 0.375) References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 24.
    Department of InformationTechnology 24Soft Computing (ITC4256 ) Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 0 1 A 0 1 B .1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 25.
    Department of InformationTechnology 25Soft Computing (ITC4256 ) Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 0 1 A 0 1 B .1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40 Determine degrees of membership: References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 26.
    Department of InformationTechnology 26Soft Computing (ITC4256 ) Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 0 1 A 0 1 B .1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40 Determine degrees of membership: A = 0.7 0.7 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 27.
    Department of InformationTechnology 27Soft Computing (ITC4256 ) Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 0 1 A 0 1 B .1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40 Determine degrees of membership: A = 0.7 B = 0.9 0.7 0.9 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 28.
    Department of InformationTechnology 28Soft Computing (ITC4256 ) Example: Fuzzy Conjunction Calculate AB given that A is .4 and B is 20 0 1 A 0 1 B .1 .2 .3 .4 .5 .6 .7 .8 .9 1 5 10 15 20 25 30 35 40 Determine degrees of membership: A = 0.7 B = 0.9 Apply Fuzzy AND AB = min(A, B) = 0.7 0.7 0.9 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 29.
    Department of InformationTechnology 29Soft Computing (ITC4256 ) Fuzzy Control • Fuzzy Control combines the use of fuzzy linguistic variables with fuzzy logic • Example: Speed Control • How fast am I going to drive today? • It depends on the weather. • Disjunction of Conjunctions References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 30.
    Department of InformationTechnology 30Soft Computing (ITC4256 ) Inputs: Temperature • Temp: {Freezing, Cool, Warm, Hot} 50 70 90 1103010 Temp. (F°) Freezing Cool Warm Hot 0 1 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 31.
    Department of InformationTechnology 31Soft Computing (ITC4256 ) Inputs: Temperature, Cloud Cover • Temp: {Freezing, Cool, Warm, Hot} • Cover: {Sunny, Partly, Overcast} 50 70 90 1103010 Temp. (F°) Freezing Cool Warm Hot 0 1 40 60 80 100200 Cloud Cover (%) OvercastPartly CloudySunny 0 1 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 32.
    Department of InformationTechnology 32Soft Computing (ITC4256 ) Fuzzy Relations • The characteristic function of a crisp relation can be generalized to allow tuples to have degrees of membership. • Then a fuzzy relation is a fuzzy set defined on tuples (x1, . . . , xn) that may have varying degrees of membership within the relation. • The membership grade indicates strength of the present relation between elements of the tuple. References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 33.
    Department of InformationTechnology 33Soft Computing (ITC4256 ) Output: Speed • Speed: {Slow, Fast} 50 75 100250 Speed (mph) Slow Fast 0 1 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 34.
    Department of InformationTechnology 34Soft Computing (ITC4256 ) Rules • If it's Sunny and Warm, drive Fast Sunny(Cover)Warm(Temp) Fast(Speed) • If it's Cloudy and Cool, drive Slow Cloudy(Cover)Cool(Temp) Slow(Speed) • Driving Speed is the combination of output of these rules... References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 35.
    Department of InformationTechnology 35Soft Computing (ITC4256 ) Example Speed Calculation • How fast will I go if it is – 65 F° – 25 % Cloud Cover ? References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 36.
    Department of InformationTechnology 36Soft Computing (ITC4256 ) Fuzzification: Calculate Input Membership Levels • 65 F°  Cool = 0.4, Warm= 0.7 50 70 90 1103010 Temp. (F°) Freezing Cool Warm Hot 0 1 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 37.
    Department of InformationTechnology 37Soft Computing (ITC4256 ) Fuzzification: Calculate Input Membership Levels • 65 F°  Cool = 0.4, Warm= 0.7 • 25% Cover Sunny = 0.8, Cloudy = 0.2 50 70 90 1103010 Temp. (F°) Freezing Cool Warm Hot 0 1 40 60 80 100200 Cloud Cover (%) OvercastPartly CloudySunny 0 1 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 38.
    Department of InformationTechnology 38Soft Computing (ITC4256 ) ...Calculating... • If it's Sunny and Warm, drive Fast Sunny(Cover)Warm(Temp)Fast(Speed) 0.8  0.7 = 0.7  Fast = 0.7 • If it's Cloudy and Cool, drive Slow Cloudy(Cover)Cool(Temp)Slow(Speed) 0.2  0.4 = 0.2  Slow = 0.2 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 39.
    Department of InformationTechnology 39Soft Computing (ITC4256 ) Defuzzification: Constructing the Output • Speed is 20% Slow and 70% Fast • Find centroids: Location where membership is 100% 50 75 100250 Speed (mph) Slow Fast 0 1 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 40.
    Department of InformationTechnology 40Soft Computing (ITC4256 ) Defuzzification: Constructing the Output • Speed is 20% Slow and 70% Fast • Find centroids: Location where membership is 100% 50 75 100250 Speed (mph) Slow Fast 0 1 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 41.
    Department of InformationTechnology 41Soft Computing (ITC4256 ) Defuzzification: Constructing the Output • Speed is 20% Slow and 70% Fast • Speed = weighted mean = (2*25+... 50 75 100250 Speed (mph) Slow Fast 0 1 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 42.
    Department of InformationTechnology 42Soft Computing (ITC4256 ) Defuzzification: Constructing the Output • Speed is 20% Slow and 70% Fast • Speed = weighted mean = (2*25+7*75)/(9) = 63.8 mph 50 75 100250 Speed (mph) Slow Fast 0 1 References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 43.
    Department of InformationTechnology 43Soft Computing (ITC4256 ) Definition of Relation • A relation among crisp sets X1, . . . ,Xn is a subset of X1 × . . . × Xn denoted as R(X1, . . . , Xn ) or R(Xi | 1 ≤ i ≤ n). • So, the relation R(X1, . . . ,Xn ) ⊆ X1 × . . . × Xn is set, too. • The basic concept of sets can be also applied to relations: - containment, subset, union, intersection, complement • Each crisp relation can be defined by its characteristic function R(x1, . . . , xn) = 1, if and only if (x1, . . . , xn) ∈ R, 0, otherwise. • The membership of (x1, . . . , xn) in R signifies that the elements of (x1, . . . , xn) are related to each other. References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 44.
    Department of InformationTechnology 44Soft Computing (ITC4256 ) Relation as Ordered Set of Tuples A relation can be written as a set of ordered tuples. Thus R(X1, . . . ,Xn) represents n-dim. membership array R = [ri1,...,in]. • Each element of i1 of R corresponds to exactly one member of X1. • Each element of i2 of R corresponds to exactly one member of X2. And so on... If (x1, . . . , xn) ∈ X1 × . . . × Xn corresponds to ri1,...,in ∈ R, then ri1,...,in = 1, if and only if (x1, . . . , xn) ∈ R, 0, otherwise. References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 45.
    Department of InformationTechnology 45Soft Computing (ITC4256 ) Cartesian Product of Relation • Cartesian Product of Fuzzy Sets: n Dimensions • Let n ≥ 2 fuzzy sets A1, . . . ,An be defined in the universes of discourse X1, . . . ,Xn, respectively. • The Cartesian product of A1, . . . ,An denoted by A1 × . . . × An is a fuzzy relation in the product space X1 × . . . × Xn. • It is defined by its membership function µA1×...×An(x1, . . . , xn) = ⊤ (µA1(x1), . . . , µAn(xn)) whereas xi ∈ Xi, 1 ≤ i ≤ n. • Usually ⊤ is the minimum (sometimes also the product). References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 46.
    Department of InformationTechnology 46Soft Computing (ITC4256 ) Cartesian Product of Relation (Cont…) • Cartesian Product of Fuzzy Sets: 2 Dimensions • A special case of the Cartesian product is when n = 2. • Then the Cartesian product of fuzzy sets A ∈ F(X) and B ∈ F(Y ) is a fuzzy relation A × B ∈ F(X × Y ) defined by • µA×B(x, y) = ⊤ [µA(x), µB(y)] , ∀x ∈ X, ∀y ∈ Y . References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 47.
    Department of InformationTechnology 47Soft Computing (ITC4256 ) Quiz - Questions 1. A ---------- can be written as a set of ordered tuples. a) fuzzy set b) relation c) crisp set d) Cartesian product 2. The ------------ indicates strength of the present relation between elements of the tuple. a) membership grade b) ownership grade c) fellowship grade d) none 3. The fuzzy relation can also be represented by an n-dimensional membership array. a) crisp relation b) fuzzy set c) fuzzy relation d) crisp set 4. The ------------ of two sets A and B, denoted A × B, is the set of all possible ordered pairs where the elements of A are 1st and the elements of B are 2nd. a) Cartesian product b) fuzzy set c) crisp set d) relation 5. Two common methods for illustrating a Cartesian product are an -------- and a ---------- diagram. a) array & linked list b) array & graph c) array & tree d) graph & tree
  • 48.
    Department of InformationTechnology 48Soft Computing (ITC4256 ) Quiz - Answers 1. b) relation 2. a) membership grade 3. c) fuzzy relation 4. a) Cartesian product 5. c) array & tree
  • 49.
    Department of InformationTechnology 49Soft Computing (ITC4256 ) Notes: Follow-up Points • Fuzzy Logic Control allows for the smooth interpolation between variable centroids with relatively few rules • This does not work with crisp (traditional Boolean) logic • Provides a natural way to model some types of human expertise in a computer program References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 50.
    Department of InformationTechnology 50Soft Computing (ITC4256 ) Notes: Drawbacks to Fuzzy logic • Requires tuning of membership functions • Fuzzy Logic control may not scale well to large or complex problems • Deals with imprecision, and vagueness, but not uncertainty References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 51.
    Department of InformationTechnology 51Soft Computing (ITC4256 ) Crisp Equivalence Relation • The relation R is an equivalence relation and it has the following three properties: - Reflexivity - Symmetry - Transitivity • Reflexivity (xi ,xi ) ∈ R or χR(xi ,xi ) = 1 When a relation is reflexive every vertex in the graph originates a single loop, as shown in References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 52.
    Department of InformationTechnology 52Soft Computing (ITC4256 ) Crisp Equivalence Relation (Cont…) • Symmetry (xi, xj ) ∈ R -> (xj, xi) ∈ R • Transitivity (xi ,xj ) ∈ R and (xj ,xk) ∈ R -> (xi ,xk) ∈ R References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 53.
    Department of InformationTechnology 53Soft Computing (ITC4256 ) Crisp Tolerance Relation • A tolerance relation R (also called a proximity relation) on a universe X is a relation that exhibits only the properties of reflexivity and symmetry. Example: Suppose in an airline transportation system we have a universe composed of five elements: the cities Omaha, Chicago, Rome, London, and Detroit. The airline is studying locations of potential hubs in various countries and must consider air mileage between cities and take-off and landing policies in the various countries. References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 54.
    Department of InformationTechnology 54Soft Computing (ITC4256 ) Crisp Equivalence & Tolerance Relation - Example • These cities can be enumerated as the elements of a set, i.e., X ={x1,x2,x3,x4,x5}={Omaha, Chicago, Rome, London, Detroit} • Suppose we have a tolerance relation, R1, that expresses relationships among these cities: This relation is reflexive and symmetric. • The graph for this tolerance relation If (x1,x5) ∈ R1can become an equivalence relation. References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 55.
    Department of InformationTechnology 55Soft Computing (ITC4256 ) Crisp Equivalence & Tolerance Relation - Example • This matrix is equivalence relation because it has (x1,x5) Five-vertex graph of equivalence relation (reflexive, symmetric, transitive) References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 56.
    Department of InformationTechnology 56Soft Computing (ITC4256 ) Fuzzy Tolerance & Equivalence Relation • Reflexivity μR(xi, xi) = 1 • Symmetry μR(xi, xj ) = μR(xj, xi) • Transitivity μR(xi, xj ) =λ1 and μR(xj, xk) = λ2 μR(xi, xk) =λ whereλ ≥ min[λ1, λ2]. References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 57.
    Department of InformationTechnology 57Soft Computing (ITC4256 ) Fuzzy Tolerance & Equivalence Relation - Example Suppose, in a biotechnology experiment, five potentially new strains of bacteria have been detected in the area around an anaerobic corrosion pit on a new aluminium-lithium alloy used in the fuel tanks of a new experimental aircraft. In order to propose methods to eliminate the bio corrosion caused by these bacteria, the five strains must first be categorized. One way to categorize them is to compare them to one another. In a pairwise comparison, the following " similarity" relation,R1, is developed. For example, the first strain (column 1) has a strength of similarity to the second strain of 0.8, to the third strain a strength of 0 (i.e., no relation), to the fourth strain a strength of 0.1, and so on. Because the relation is for pairwise similarity it will be reflexive and symmetric. Hence, References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 58.
    Department of InformationTechnology 58Soft Computing (ITC4256 ) Fuzzy Tolerance & Equivalence Relation - Example is reflexive and symmetric. However, it is not transitive μR(x1, x2) = 0.8, μR(x2, x5) = 0.9 ≥ 0.8 but μR(x1, x5) = 0.2 ≤ min(0.8, 0.9) References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 59.
    Department of InformationTechnology 59Soft Computing (ITC4256 ) Fuzzy Tolerance & Equivalence Relation - Example One composition results in the following relation: where transitivity still does not result; for example, μR2(x1, x2) = 0.8 ≥ 0.5 and μR2(x2, x4) = 0.5 But μR2(x1, x4) = 0.2 ≤ min(0.8, 0.5) References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 60.
    Department of InformationTechnology 60Soft Computing (ITC4256 ) Fuzzy Tolerance & Equivalence Relation - Example Finally, after one or two more compositions, transitivity results: References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 61.
    Department of InformationTechnology 61Soft Computing (ITC4256 ) Non-Interactive Fuzzy Sets • A non-interactive fuzzy set is defined as follows. We are defining fuzzy set A on the Cartesian space X=X1 x X2. • Set A is separable into two non-interactive fuzzy sets called orthogonal projections, if and only if • The equations represent membership functions for the orthographic projections of A on universes X1 and X2, respectively. References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary
  • 62.
    Department of InformationTechnology 62Soft Computing (ITC4256 ) Quiz - Questions 1. What are the properties exhibited by an equivalence relation R? 2. What are the properties exhibited by a tolerance relation R? 3. The independent events in probability theory are ---------- to non-interactive fuzzy sets in fuzzy theory. a) analogous b) digital c) both a & b d) none 4. Relations can be also be used to represent -----------. a) ambiguity b) dissimilarity c) similarity d) none 5. A binary relation is called an --------------- if it is reflexive, symmetric and transitive. a) tolerance relation b) tuple c) crisp relation d) equivalence relation
  • 63.
    Department of InformationTechnology 63Soft Computing (ITC4256 ) Quiz - Answers 1. i. Reflexivity ii. Symmetry iii. Transitivity 2. i. Reflexivity ii. Symmetry 3. a) analogous 4. c) similarity 5. d) equivalence relation
  • 64.
    Department of InformationTechnology 64Soft Computing (ITC4256 ) Summary • Fuzzy Logic provides way to calculate with imprecision and vagueness • Fuzzy Logic can be used to represent some kinds of human expertise • Fuzzy Membership Sets • Fuzzy Linguistic Variables • Fuzzy AND and OR • Fuzzy Control References Introduction Crisp Variables Fuzzy Sets Linguistic Variables Membership Functions Fuzzy Logic Fuzzy OR Fuzzy AND Example Fuzzy Control Variables Rules Fuzzification Defuzzification Summary