L3 - Fuzzy Relations
L3 - Fuzzy Relations
47 / 69
Basic fuzzy set operations: Union
Union (A ∪ B):
µA∪B (x ) = max{µA(x ), µB (x )}
Example:
A = {(x1 , 0.5), (x2 , 0.1), (x3 , 0.4)} and
B = {(x1 , 0.2), (x2 , 0.3), (x3 , 0.5)};
C = A ∪ B = {(x1 , 0.5), (x2 , 0.3), (x3 , 0.5)}
µA µA
µB µB
µ
µAUB
a p x b q c a p x b q c
48 / 69
Basic fuzzy set operations: Intersection
Intersection (A ∩ B):
µA∩B (x ) = min{µA(x ), µB (x )}
Example:
A = {(x1 , 0.5), (x2 , 0.1), (x3 , 0.4)} and
B = {(x1, 0.2), (x2, 0.3), (x3, 0.5)};
C = A ∩ B = {(x1 , 0.2), (x2 , 0.1), (x3 , 0.4)}
µA
µB
µAᴖB
µ
a p x b q c a p x b q c
49 / 69
Basic fuzzy set operations: Complement
Complement (AC ):
µAAC (x ) = 1-µA(x )
Example:
A = {(x1 , 0.5), (x2 , 0.1), (x3 , 0.4)}
C = AC = {(x1 , 0.5), (x2 , 0.9), (x3 , 0.6)}
µA µA
1.0 µA’
p x q p x q
50 / 69
Notation due to Zadeh
• notation due to Zadeh, in which each element
is paired with its grade of membership in the
form of a “formal series” as
µαA(x ) = α · µA(x )
51 / 69
Basic fuzzy set operations: Sum and Difference
52 / 69
Basic fuzzy set operations: Equality and Power
Equality (A = B):
µA(x ) = µB (x )
53 / 69
Basic fuzzy set operations: Cartesian product
µA×B (x , y ) = min{µA(x ), µB (y )
Example 3:
A(x) = {(x1 , O.2), (x2 , O.3), (x3 , O.5), (x4 , O.6)}
8(y) = {(y1 , O.8), (y2 , O.6), (y3 , O.3)}
y1 y2 y3
x1 O.2 O.2 O.2
O.3 O.3 O.3
A × 8 = min{µA (x ), µB (y )} = x2
x3 O.5 O.5 O.3
x4 O.6 O.6 O.3
54 / 69
Properties of fuzzy sets
Commutativity :
A∪8 = 8∪A
A∩8 = 8∩A
Associativity :
A ∪ (B ∪ C) = (A ∪ B) ∪
C
A ∩ (B ∩ C) = (A ∩ B) ∩
Distributivity : C
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪
C)
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩
C)
55 / 69
Properties of fuzzy sets
Idempotence :
A∪ A=A
A∩ A= ∅
A∪ ∅ =
A
A∩ ∅ =
Transitivity :
∅
If A ⊆ B, B ⊆ C then A ⊆ C
Involution :
(Ac )c = A
De Morgan’s law :
(A ∩ B)c = Ac ∪ Bc
(A ∪ B)c = Ac ∩ Bc
56 / 69
Few Illustrations on Fuzzy
Sets
57 / 69
Example 1: Fuzzy Set Operations
Let A and 8 are two fuzzy sets defined over a universe of discourse X
with membership functions µA(x ) and µB (x ), respectively. Two MFs
µA(x ) and µB (x ) are shown graphically.
µA(x)
a1 a2 a3 a4
µB(x) b1 a1=b2 a2=b3 a4
x x
58 / 69
Example 1: Plotting two sets on the same graph
µB µA
µ
b1 a1 a2 b4 a3 a4
x
59 / 69
Example 1: Union and Intersection
The plots of union A ∪ B and intersection A ∩ B are shown in the
following.
µB µA
b1 a1 a2 b4 a3 a4
x
x)
x)
(
(
B
A
a2 b4
b1 a1 a2 a3 a4
x
x
6O / 69
Example 1: Intersection
The plots of union µĀ (x ) of the fuzzy set A is shown in the following.
A ( x)
A(x)
a b a b
x x
61 / 69
Fuzzy set operations: Practice
Consider the following two fuzzy sets A and B defined over a universe
of discourse [O,5] of real numbers with their membership functions
µA(x ) = x and
1+x
µB (x ) = 2−x
i. A , B
ii. A∪ B
iii. A ∩ B
iv. (A ∪ B)c [Hint: Use De’ Morgan law]
62 / 69
Example 2: A real-life example
µA µB
1.0
0.5
µ
-15 -10 -5 0 5 10 15 20 25 30 35 40 45 50
63 / 69
Example 2: A real-life example
Note: Note that ”Not cold climate” = ”Hot climate” and vice-versa.
64 / 69
Example 2 : A real-life example
Answer would be the following.
1 Not cold climate
A with 1 - µA (x ) as the MF.
2 Not hot climate
B with 1 - µB (x ) as the MF.
3 Extreme climate
A ∪ B with µA∪B (x ) = max(µA(x ), µB (x )) as the MF.
4 Pleasant climate
A ∩ B with µA∩B (x ) = min(µA(x ), µB (x )) as the MF.
The plot of the MFs of A ∪ B and A ∩ B are shown in the following.
Extreme climate Pleasant climate
1.0
µA µB
1.0
0.
AB
AB
5
µ
- -
15 10 -5 0 5 10 15 20 25 30 35 40 45 50
x 5 15 25 5 25
x x
65 / 69
Few More on Membership
Functions
66 / 69
Generation of MFs
Given a membership function of a fuzzy set representing a linguistic
hedge, we can derive many more MFs representing several other
linguistic hedges using the concept of Concentration and Dilation.
Concentration:
Ak = [µA(x )]k ; k > 1
Dilation:
Ak = [µA(x )]k ; k < 1
Example : Age = { Young, Middle-aged, Old }
Thus, corresponding to Young, we have : Not young, Very young, Not
very young and so on.
Similarly, with Old we can have : old, very old, very very old, extremely
old etc.
Thus, Extremely old = (((old )2 )2 )2 and so on
Or, More or less old = AO.5 = (old )O.5
67 / 69
Linguistic variables and values
Very Old
Very young
0 30 60 100
X = Age
• Notation
Set equality (A = B)
39 / 64
Crisp relations
Note :
(1) A × B /= B × A
(2) |A × B| = |A| × |B|
(3)A × B provides a mapping from a ∈ A to b ∈ B.
40 / 64
Crisp relations
Example 1:
Consider the two crisp sets A and B as given below. A ={ 1, 2, 3, 4}
B = {3, 5, 7 }.
Then, A × B = {(1, 3), (1, 5), (1, 7), (2, 3), (2, 5), (2, 7), (3, 3), (3,
(3,7),(4,3),(4,5),(4,7)}
5),
Let us define a relation R as R = {(a, b)|b = a + 1, (a, b) ∈ A ×
B}
Then, R = { (2,3),(4,5)} in this case.
We can represent the relation R in a matrix form as follows.
3 5 7
1 0 0 0
2 1 0 0
R=
3 0 0 0
4 0 1 0
41 / 64
Operations on crisp relations
Suppose, R(x, y) and S(x, y) are the two relations define over
two crisp sets x ∈ A and y ∈ B
Union:
Intersection:
Complement:
R(x,y) = 1 − R(x,y)
42 / 64
Example: Operations on crisp relations
Example:
Suppose, R(x, y) and S(x, y) are the two relations define over
two crisp sets x ∈ A and y ∈ B
0 1 0 0 1 0 0 0
R = 0 0 1 0 and S = 0 1 0 0 ;
0 0 0 1 0 0 1 0
0 0 0 0 0 0 0 1
Find the following:
1 R ∪S
2 R ∩S
3 R
43 / 64
Composition of two crisp relations
Max-Min Composition
Given the two relation matrices R and S, the max-min composition
is defined as T = R ◦S ;
44 / 64
Composition: Composition
Example:
Given
X = {1, 3, 5}; Y = {1, 3, 5}; R = {(x, y)|y = x + 2}; S = {(x, y)|x < y
} ere, R and S is on X × Y .
H
Thus, we have
R = { (1,3),(3,5)}
S = { (1,3),(1,5),(3,5)}
1 3 5 1 3 5
1 0 1 0 1 0 1 1
R= 3 0 0 1 and S= 3 0 0 1
5 0 0 0 5 0 0 0
1 3 5
1 0 0 1
Using max-min composition R ◦S= 3 0 0 0
5 0 0 0
45 / 64
Fuzzy relations
Fuzzy relation is a fuzzy set defined on the Cartesian product
of crisp set X1, X2, ...,Xn
Here, n-tuples (x1, x2, ...,xn) may have varying degree
of memberships within the relationship.
The membership values indicate the strength of the
relation between the tuples.
Example:
X = { typhoid, viral, cold } and Y = { running nose, high
shivering }
temp,
The fuzzy relation R is defined as
Suppose
A is a fuzzy set on the universe of discourse X with µA(x )|x ∈ X
B is a fuzzy set on the universe of discourse Y with µB (y )|y ∈ Y
Then R = A × B ⊂ X × Y ; where R has its membership function given
by µR (x,y) = µA×B (x,y) = min{ µA (x),µB (y)}
Example :
A = {(a 1 , 0.2), (a2, 0.7), (a3, 0.4)}and B = {(b 1 , 0.5), (b2, 0.6)}
b1 b2
a1 0.2 0.2
R = A× B = a2 0.5 0.6
a3 0.4 0.4
47 / 64
Operations on Fuzzy relations
Let R and S be two fuzzy relations on A × B.
Union:
Intersection:
Complement:
µR (a,b) = 1 − µR (a,b)
Composition
T = R ◦S
µR◦S = maxy ∈Y { min(µR (x,y),µS (y,z))}
Operations on Fuzzy relations: Examples
Example:
X = (x1, x2, x3); Y = (y1, y2); Z = (z1, z2, z3);
y1 y2
x1 0.5 0.1
R= x2 0.2 0.9
x3 0.8 0.6
z1 z2 z3
y1 0.6 0.4 0.7
S=
y2 0.5 0.8 0.9
z1 z2 z3
2D membership function : An example
Hint: