FUZZY SET THEORY - Swati Varma
CONTENTS
➢Fuzzy sets
➢Fuzzy properties
➢Fuzzy operations
➢Fuzzy relations
➢Fuzzy composition
➢Fuzzy inference
➢Defuzzification methods
2
CLASSICAL SET
➢A set is a collection of distinct elements without ordering and without repetition.
➢Defined by crisp boundaries
➢No uncertainty about the set boundaries
➢Fuzzy set is defined by its ambiguous boundaries
Why?
➢Real world data is not precise
➢Fuzziness/vagueness/ inexatcness
3
FUZZY SET THEORY
Examples
Satish is a rich man
That blue car is expensive
No well-defined demarcations between
rich and poor
very and little
expensive and cheap
old and young
weak and strong
The classical set theory is not equipped to handle such vagueness as it does not allow an
element to be a partial member
Fuzzy set theory is a generalization of the classical set theory
4
FUZZY SET THEORY
Fuzzy set theory was proposed by Zadeh in 1965
A fuzzy set is defined as a set of ordered pairs where the first element is the element
and the second element is membership of that element
membership
function U : universe of
discourse.
5
REPRESENTATION
(1, 0.1) (2, 0.3) (3, 0.8) (4,1)
A=
(5, 0.9) (6, 0.5) (7, 0.2) (8, 0.1)
Alternative Representation:
A = 0.1/ 1 + 0.3 / 2 + 0.8 / 3 + 1.0 / 4 + 0.9 / 5 + 0.5 / 6 + 0.2 / 7 + 0.1/ 8
6
Properties of fuzzy sets
AB=BA
AB=BA
A (B C) = (A B) C
A (B C) = (A B) C
A (B C) = (A B) (A C)
A (B C) = (A B) (A C)
AA=A AA=A
AX=X AX=A
A=A A=
If A B C, then A C
A’’ = A
7
Properties of fuzzy sets
De Morgan’s Law also holds:
(A B)’ = A’ B’
(A B)’ = A’ B’
8
FUZZY SET OPERATIONS
Union
A B(x) = A(x) B(x)
= max(A(x), B(x))
Intersection
A B(x) = A(x) B(x)
= min(A(x), B(x))
Compliment
A’(x) = 1 - A(x)
9
FUZZY SET OPERATIONS: EXAMPLE
𝐴ҧ = {0.1/1 + 0.2/2 + 0.3/3)
𝐵ഥ = {0.6/1 + 0.5/2 + 0.4/3 + 0.5/4}
𝐴ҧ 𝐵ഥ = { 0.6/1 + 0.5/2 + 0.4/3 + 0.5/4}
𝐴ҧ 𝐵ഥ = {0.1/1 + 0.2/2 + 0.3/3 + 0/4}
𝐴’ҧ = {0.9/1 + 0.8/2 + 0.7/3 + 1/4}
𝐵ഥ ’ = {0./1 + 0.5/2 + 0.6/3 + 0.5/4}
10
FUZZY SET OPERATIONS
Comparison
Is 𝐴ҧ = 𝐵ഥ ?
𝐴ҧ = 𝐵ഥ if 𝐴(x)
ҧ = 𝐵ഥ (x) ∀𝑥 ∈ 𝑋
Containment
Is 𝐴ҧ ⊂ 𝐵ഥ ?
𝐴ҧ is in 𝐵ഥ if 𝐴(x)
ҧ < 𝐵ഥ (x) ∀𝑥 ∈𝑋
11
FUZZY SET OPERATIONS:EXAMPLE
𝐴ҧ = {0.1/1 + 0.2/2 + 0.3/3)
𝐵ഥ = {0.6/1 + 0.5/2 + 0.4/3 + 0.5/4}
4) The 2 sets are not equal
5) 𝐴ҧ is contained in 𝐵ഥ
12
FUZZY MEMBERSHIP FUNCTION
➢Membership function A(x) defines degree of membership of x in A
➢It assumes value in the range [0,1]
E.g. A(x) = 0.6
i.e. x belongs to Set A by 0.6 value
13
FUZZY MEMBERSHIP FUNCTION
The most concise way to define a MF is to express it as a mathematical formula
14
SOME POPULAR FUZZY MEMBERSHIP FUNCTIONS
Triangular function- the most frequently used membership function
15
SOME POPULAR FUZZY MEMBERSHIP FUNCTIONS
Trapezoidal function
16
SOME POPULAR FUZZY MEMBERSHIP FUNCTIONS
Gaussian function S-function
17
FUZZY RELATIONS
18
THE REAL-LIFE RELATION
▪x is close to y
▪ x and y are numbers
▪x depends on y
▪ x and y are events
▪x and y look alike
▪ x and y are persons or objects
19
CRISP RELATION (R)
b1
a1
b2
a2
A a3
b3 B
b4
a4 b5
R A B
20
CRISP RELATION (R)
b1
a1
b2
a2
A a3
b3 B
b4
a4 b5
R A B
1 0 1 0 0
0 0 0 0 1
MR =
1 0 0 1 0
0 1 0 0 0 21
Crisp Relations
Example:
If X = {1,2,3}
Y = {a,b,c}
R = { (1 a),(1 c),(2 a),(2 b),(3 b),(3 c) }
a b c
1 1 0 1
R=2 1 1 0
3 0 1 1
Using a diagram to represent the relation
22
FUZZY RELATIONS
Triples showing connection between two sets:
(a,b,#): a is related to b with degree #
Fuzzy relations are set themselves
Fuzzy relations can be expressed as matrices
…
23
FUZZY RELATIONS MATRICES
Example: relation between set of diseases and set of
symptoms
R1(x, y) Running High temp shivering
nose
Typhoid 0.1 0.9 0.8
Viral fever 0.2 0.9 0.7
Common 0.9 0.4 0.6
cold
24
FUZZY RELATIONS
Let A = B = C = {0, 1, 2, 3} and the relations R, S, and T defined as follows :
R ⊆ A × B, R = {(a, b) | a + b is an even number}}
S ⊆ A × B, S = {(a, b) | b = (a + 2) MOD 3}
T ⊆ B × C, T = {(b, c) | | b – c | = 1}
These relations can be explicitly written as
R = {(0, 0), (0, 2), (1, 1), (1, 3), (2, 0), (2, 2), (3, 1), (3, 3)}}
S = {(0, 2), (1, 0), (2, 1), (3, 2)}, and
T = {(0, 1), (1, 0), (1, 2), (2, 1), (2, 3), (3, 2)}.
25
FUZZY RELATIONS
R = {(0, 0), (0, 2), (1, 1), (1, 3), (2, 0), (2, 2), (3, 1), (3, 3)}}
S = {(0, 2), (1, 0), (2, 1), (3, 2)}, and
T = {(0, 1), (1, 0), (1, 2), (2, 1), (2, 3), (3, 2)}.
26
OPERATIONS ON FUZZY RELATIONS
Union (R ∪ S) (x, y) = max {R (x, y), S (x, y)}
Intersection (R ∩ S) (x, y) = min {R (x, y), S (x, y)}
Complementation R′ (x, y) = 1 – R (x, y)
27
OPERATIONS ON FUZZY RELATIONS
28
COMPOSITION
➢Let R be a relation that relates, or maps, elements from universe X to universe Y,
and let S be a relation that relates, or maps, elements from universe Y to universe
Z.
➢Can we find a relation, T, that relates the same elements in universe X that R
contains to the same elements in universe Z that S contains?
➢We can find such a relation using an operation known as composition.
R a b c d Y S Z
1 0.1 0.2 0.0 1.0 a 0.9 0.0 0.3
T?
X 2 0.3 0.3 0.0 0.2 b 0.2 1.0 0.8
Y
3 0.8 0.9 1.0 0.4 c 0.8 0.0 0.7
29
d 0.4 0.2 0.3
COMPOSITION
There are two common forms of the composition operation:
max–min composition
max–product composition.
30
MAX-MIN COMPOSITION
X Y Z
R: fuzzy relation defined on X and Y.
S: fuzzy relation defined on Y and Z.
R 。S: the composition of R and S.
A fuzzy relation defined on X an Z.
R S (x, z ) = max y min ( R ( x, y ), S ( y, z ) )
= y ( R ( x, y ) S ( y , z ) )
32
EXAMPLE
S R (x, y ) = max v min ( R ( x, v), S (v, y ) )
R a b c d S
1 0.1 0.2 0.0 1.0 a 0.9 0.0 0.3
2 0.3 0.3 0.0 0.2 b 0.2 1.0 0.8
3 0.8 0.9 1.0 0.4 c 0.8 0.0 0.7
0.1 0.2 0.0 1.0
d 0.4 0.2 0.3
min 0.9 0.2 0.8 0.4
max 0.1 0.2 0.0 0.4
R S
1 0.4 0.2 0.3
2 0.3 0.3 0.3
3 0.8 0.9 0.8
33
.
MAX-PRODUCT COMPOSITION
X Y Z
R: fuzzy relation defined on X and Y.
S: fuzzy relation defined on Y and Z.
R。S: the composition of R and S.
A fuzzy relation defined on X an Z.
R S (x, y ) = max v ( R ( x, v) S (v, y ) )
34
EXAMPLE
R a b c d S
1 0.1 0.2 0.0 1.0 a 0.9 0.0 0.3
2 0.3 0.3 0.0 0.2 b 0.2 1.0 0.8
3 0.8 0.9 1.0 0.4 c 0.8 0.0 0.7
0.1 0.2 0.0 1.0
d 0.4 0.2 0.3
Product 0.9 0.2 0.8 0.4
max .09 .04 0.0 0.4
RS
1 0.4 0.2 0.3
2 0.27 0.3 0.24
3 0.8 0.9 0.7
35
FUZZY INFERENCE PROCESS
36
FUZZY INFERENCE PROCESS
1. Fuzzification – input variables are assigned degrees of
membership in various classes
2. Rule evaluation – inputs are applied to a set of if-then control
rules
E.g. if temperature is very hot then set fan speed to very high
3. Defuzzification – fuzzy outputs are combined into discrete values
needed to drive the actual mechanism
38
FUZZY CONTROLLER
Design a fuzzy controller to determine the wash time of a domestic
washing machine. Assume that input is dirt, grease on clothes. Use 3
descriptors for input variables and 5 descriptors for output
variable. Device a set of rules for control action & defuzzification.
Clearly indicate that if the clothes are soiled to a larger degree
the wash time required will be more.
39
FUZZY CONTROLLER
Step 1: Identification of i/p and o/p using linguistic variables
Step 2: Assign membership function to the variables
Step 3: Build a rule base
Step 4: Generate a crisp controlled output
40
FUZZY CONTROLLER
Step 1: Identification of i/p and o/p using linguistic variables
Input 1: Dirt => { Small D, Medium D, Large D }
Input 2: Grease => {Small G, Medium G, Large G }
Output: Wash time => {Very Short, Short, Medium, Long, Very Long}
41
FUZZY CONTROLLER
Step 2: Assign membership function to
the variables
dirt (x) = SD (x) = (50-x)/50 , 0≤x≤50
= MD (x) = (x-0)/50, 0≤x≤50
= (100-x)/50, 50< x ≤ 100
= LD (x) = (x-50)/50 , 50 ≤x≤ 100
42
FUZZY CONTROLLER
grease (y) = SG (y) = (50-y)/50 , 0≤y≤50
= MG (y) = (y-0)/50, 0≤y≤50
= (100-y)/50, 50< y ≤ 100
= LG (y) = (y-50)/50 , 50 ≤y≤ 100
43
FUZZY CONTROLLER
WT (Z) = VS (z) = (10-z)/10 , 0≤z≤ 10
= S (z) = (z-0)/10, 0≤z≤ 10
= (25-z)/(25-10), 10< z ≤ 25
= M (z) = (z-10)/15, 10≤z≤25
= (40-z)/15, 25< z ≤ 40
= L (z) = (z-25)/15, 25≤z≤ 40
= (60-z)/20, 40< z ≤ 60
= VL (z) = (z-40)/20 , 40 ≤z≤ 60
44
FUZZY CONTROLLER
The sets of rules used to derive the output are:
Decide a fuzzy operator (AND or OR)
a) If dirt is Large and grease is Large then wash_time is Very Long;
b) If dirt is Medium and grease is Large then wash_time is Long;
c) If dirt is Small and grease is Large then wash_time is Long;
45
FUZZY CONTROLLER
Step 3: Build a rule base
y
x SG MG LG
SD VS M L
MD S M L
LD M L VL
46
FUZZY CONTROLLER
Rule evaluation
Assume D= 60%, G =70%
MD (60) = (100-60)/50 = 40/50 = 4/5
LD (60) = (60-50)/50 = 10/50 = 1/5
MG (70) = (100-70)/50 = 30/50 = 3/5
LG (70) = (70-50)/50 = 20/50 = 2/5
Substitute the values in the rule decision table
47
FUZZY CONTROLLER
Rule decision table
y
x SG MG LG
SD x x x
MD x M (z) L (z)
LD x L (z) VL (z)
48
DEFUZZIFICATION
Fuzzification -> precise quantity to a fuzzy quantity
Defuzzification -> fuzzy quantity to a precise quantity
49
FUZZY CONTROLLER
Defuzzification (Max membership method)
1. Fuzzy operator, i.e. AND(min)
2. Take max value
MD (60) MG (70) = min(4/5, 3/5) = 3/5
MD (60) LG (70) = min(4/5, 2/5) = 2/5
LD (60) MG (70) = min(1/5, 3/5) = 1/5
LD (60) LG (70) = min(1/5, 2/5) = 1/5
Max(3/5, 2/5, 1/5, 1/5) = 3/5
50
FUZZY CONTROLLER
Step 4: Generate a crisp controlled output
M (z) = (z-10)/15, 10≤z≤25
= (40-z)/15, 25< z ≤ 40
(z-10)/15 = 3/5
Z = 19
(40-z)/15 = 3/5
Z = 31
Therefore, Z= (19+31)/2 = 25 min
51
DEFUZZIFICATION METHODS
52
53
DEFUZZIFICATION METHODS
54
DEFUZZIFICATION METHODS
55
DEFUZZIFICATION METHODS
Centroid Method
➢The centroid method is also referred to as centre-of-gravity or centre-of-area
method.
➢The centroid, or centre-of-gravity, or centre-of-area of the resultant membership
profile is taken as the defuzzified output
56
57
DEFUZZIFICATION METHODS
Mean-of-Maxima (MoM) Method
The highest degree of membership among all fuzzy sets is taken as the output
defuzzified value.
58
DEFUZZIFICATION METHODS
Centre-of-Sums (CoS) Method
➢The CoS method works almost in the same way as that of the centroid method
➢This method employs the algebraic sum of the individual fuzzy subsets instead of
their union.
59