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 = μA(x1)/x1 + μA(x2)/x2 + . . . + μA(xi)/xi + . . . .
– Or discrete continous
fuzzy operations
• In the crisp, bivalent logic, the union of a set
with the complement of a second set
represents an “implication” of the first set by
the second set.
• Set inclusion (subset) is a special case of
implication in which the two sets belong to
the same universe.
Generalized fuzzy operations
A generalized complement operation, denoted by C, should satisfy the
following
axioms:
• (1) Boundary conditions: C(φ) = X and C(X) = φ where X is the
universal set (having membership function μX = 1) and φ is the null
set (having membership function μφ = 0).
• (2) Non-increasing: For two fuzzy sets A and B with membership
functions a = μA(x) and b = μB(x) in the same universe X, if a > b,
then C(a) ≤ C(b). Another way of expressing this property is by using
the concept of subsets (⊂). Specifically, if A ⊃ B then C(A) ⊂ C(B).
• (3) Involutive: C(C(A)) = A. Note that this property of involution is
analogous to double negation
Basic fuzzy set operations: Products
Algebric product or Vector product (A•B):
µA•B (x ) = µA(x ) • µB (x)
Scalar product (α × A):
µα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 )
Power of a fuzzy set Aα :
µAα (x ) = {µA(x )}α
If α < 1, then it is called dilation
If α > 1, then it is called concentration
53 / 69
Basic fuzzy set operations: Cartesian product
Caretsian Product (A × B):
µ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
Let’s plot the two membership functions 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
Determine the membership functions of the following and draw them
graphically.
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
Two fuzzy sets A and B with membership functions µA(x ) and µB (x ),
respectively defined as below.
A = Cold climate with µA(x ) as the MF.
B = Hot climate with µB (x ) as the M.F.
µA µB
1.0
0.5
µ
-15 -10 -5 0 5 10 15 20 25 30 35 40 45 50
Here, X being the universe of discourse representing entire range of
temperatures.
63 / 69
Example 2: A real-life example
What are the fuzzy sets representing the following?
1 Not cold climate
2 Not hold climate
3 Extreme climate
4 Pleasant climate
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
Young Middle-Aged Old
Very Old
Very young
0 30 60 100
X = Age
µyoung (x ) = bell (x , 2O, 2, O) = 1
1+( x2O)4
µold (x ) = bell (x , 3O, 3, 1OO) = 1
1+( x −1OO
3O
)6
µmiddle−aged = bell(x , 3O, 6O, 5O)
Not young = µyoung (x ) = 1 - µyoung (x )
Young but not too young = µyoung (x ) ∩ µyoung (x )
68 / 69
• Intersection (conjunction, AND) ∧ /*
– Min -x must simultaneously belong to both sets,
• Union (disjunction, OR)V/+
– max - x may belong to one set or the other
Grade of inclusion
• a grade of inclusion of a fuzzy set A in another
fuzzy set B.
• accordingly we have used T-norm.
• the maximum value of a function over a
continuous (or piecewise continuous) interval of
its variable.
• the function (c) is the variable itself
• Notation
Set equality (A = B)
• A fuzzy set A is equal to another fuzzy set B, in universe
X, if and only if
• If A ⊂ B and A ≠ B, then A is called a proper subset of B.
• As before, in a specific application, we may use either
min or product to represent the T-norm in this general
definition.
Implication (if-then)
• In a knowledge-based system, the knowledge
base is commonly represented using if-then rules.
• in fuzzy logic may be expressed by a set of
linguistic Rules of the if-then type, containing
fuzzy terms
• a fuzzy rule is a fuzzy relation
• A knowledge base containing several fuzzy rules
is also a relation, which is formed by combining
(aggregating) the individual rules according to
how they are interconnected.
• A defined in a universe X and a second fuzzy
set B defined in another universe Y
• “If A then B” is denoted Implication (if -then)
by A → B. is a relation
• A represents some “fuzzy” situation, and is the
condition or the antecedent of the rule.
• B represents another fuzzy situation, and is
the action or the consequent of the fuzzy rule.
• A →B are defined in the Cartesian product
space X × Y. [matrix]
• Fuzzy implication may be defined (interpreted)
in several ways. Two definitions of fuzzy
implication are
• the sets A and B represent fuzzy logic propositions,
and are defined In different universes X and Y
• Method 1-Mamdani : Symmetric with respect to A and
B is not intuitively satisfying as “implication” is not a
commutative operation (specifically, A → B does not
necessarily satisfy B → A).
• more commonly used because it is simpler to use and
often provides quite accurate results
• Method 2 - Lukasiewicz: crisp bivalent logic, A → B has
the same truth table as [(NOT A) OR B], upper-bounded
to 1
BOOK Review
• Any doubts till now??
Larsen implication
Fuzzy Relations
39 / 64
Crisp relations
To understand the fuzzy relations, it is better to discuss first
crisp relation.
Suppose, A and B are two (crisp) sets. Then Cartesian
product denoted as A × B is a collection of order pairs, such
that
A × B = { (a,b)|a ∈ A and b ∈ B}
Note :
(1) A × B /= B × A
(2) |A × B| = |A| × |B|
(3)A × B provides a mapping from a ∈ A to b ∈ B.
The mapping so mentioned is called a relation.
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:
R(x,y) ∪ S(x,y) = max (R(x,y),S(x,y));
Intersection:
R(x,y) ∩ S(x,y) = min(R(x,y),S(x,y));
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
Given R is a relation on X ,Y and S is another relation on Y ,Z .
Then R ◦S is called a composition of relation on X and Z which
is defined as follows.
R ◦S = {(x, z)|(x, y) ∈ R and (y, z) ∈ S and ∀y ∈ Y }
Max-Min Composition
Given the two relation matrices R and S, the max-min composition
is defined as T = R ◦S ;
T (x, z) = max {min{R(x, y ), S(y, z) and ∀y ∈ Y } }
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
runningnose hightemperature shivering
typhoid 0.1 0.9 0.8
viral 0.2 0.9 0.7
cold 0.9 0.4 0.6
46 / 64
Fuzzy Cartesian product
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:
µR∪S (a,b) = max { µR (a,b),µS (a,b)}
Intersection:
µR∩S (a,b) = min{ µR (a,b),µS (a,b)}
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
x10.5 0.4 0.5
R ◦S = x2 0 .5 0.8 0.9
x3 0.6 0.6 0.7
µR◦S (x1 ,y1 ) = max{ min(x1 ,y1 ),min(y1 ,z1 ),min(x1 ,y2 ),min(y2 ,z1 )}
= max {min(0.5, 0.6), min(0.1, 0.5)} = max {0.5, 0.1} = 0.5 and so on.
Fuzzy relation : An example
Consider the following two sets P and D, which represent a set
of paddy plants and a set of plant diseases. More precisely
P = {P 1 , P2, P3, P 4 } a set of four varieties of paddy plants
D = {D 1 , D2, D3, D 4 } of the four various diseases affecting the plants
In addition to these, also consider another set S = {S 1 , S2, S3, S 4 }
be the common symptoms of the diseases.
Let, R be a relation on P × D, representing which plant is
susceptible to which diseases, then R can be stated as
D1 D2 D3 D4
P1 0.6 0.6 0.9 0.8
P2 0.1 0.2 0.9 0.8
R=
P3 0.9 0.3 0.4 0.8
P4 0.9 0.8 0.4 0.2
Fuzzy relation : An example
Also, consider T be the another relation on D × S, which is given
by S1 S2 S3 S4
D1 0.1 0.2 0.7 0.9
D2 1.0 1.0 0.4 0.6
S=
D3 0.0 0.0 0.5 0.9
D4 0.9 1.0 0.8 0.2
Obtain the association of plants with the different symptoms of
the disease using max-min composition.
Hint: Find R ◦T , and verify that
S1 S2 S3 S4
P1 0.8 0.8 0.8 0.9
P2 0.8 0.8 0.8 0.9
R ◦S =
P3 0 .8 0.8 0.8 0.9
P4 0.8 0.8 0.7 0.9
Fuzzy relation : Another example
Let, R = x is relevant to y
and S = y is relevant to z
be two fuzzy relations defined on X × Y and Y × Z ,
respectively, where X = {1, 2, 3} ,Y = {α, β, γ, δ} and Z = {a,
b}.
Assume that R and S can be expressed with the following
relation matrices : α β γ δ
1 0.1 0.3 0.5 0.7
R= 2 0.4 0.2 0.8 0.9 and
3 0.6 0.8 0.3 0.2
a b
α 0.9 0.1
β 0.2 0.3
S=
γ 0.5 0.6
δ 0.7 0.2
Fuzzy relation : Another example
Now, we want to find R ◦S, which can be interpreted as a
derived
fuzzy relation x is relevant to z.
Suppose, we are only interested in the degree of relevance
between 2 ∈ X and a ∈ Z . Then, using max-min composition,
µR◦S (2, a) = max {(0.4 ∧0.9), (0.2 ∧ 0.2), (0.8 ∧ 0.5), (0.9 ∧0.7)}
= max { 0.4,0.2,0.5,0.7} = 0.7
R s
2D membership function : An example
Let, X = R + = y (the positive real line)
and R = X × Y = ”y is much greater than x”
The membership function of µR (x, y) is defined as
(y −x)
µR (x,y) = 4 if y >x
0 if y≤x
Suppose, X = { 3,4,5} and Y = { 3,4,5,6,7} , then
3 4 5 6 7
3 0 0.25 0.5 0.75 1.0
R= 4 0 0 0.25 0.5 0.75
5 0 0 0 0.25 0.5
Problems to ponder:
How you can derive the following?
If x is A or y is B then z is C;
Given that
1 R1 : If x is A then z is c [R1 ∈ A × C]
2 R2: If y is B then z is C [R2 ∈ B × C]
Hint:
You have given two relations R1 and R2.
Then, the required can be derived using the union operation of R1
and R2