You are on page 1of 149

CLASSICAL AND

FUZZY RELATIONS

Instructor : Dr S.Natarajan
Professor and Key Resource Person
Department of Computer Science and
Engineering
PES University
Bengaluru
natarajan@pes.edu
9945280225

1
Classical Relations and Fuzzy Relations

Cartesian Product, Crisp Relations – Cardinality of Crisp


Relations, Operations on Crisp Relations, Properties of Crisp
Relations, Composition

Fuzzy Relations – Cardinality of Fuzzy Relations, Operations


on Fuzzy Relations, Properties of Fuzzy Relations, Fuzzy
Cartesian Product and Composition

Tolerance and Equivalence Relations – Crisp Equivalence


Relation, Crisp Tolerance Relation, Fuzzy Tolerance and
Equivalence Relations, Value Assignments - Cosine Amplitude,
Max-Min Method, Other Similarity methods.

2
Classical Relations and Fuzzy Relations

A relation is of fundamental importance in all-engineering, science, and


mathematically based fields. Relations are involved in logic, approximate reasoning,
classification, rule-based systems, pattern recognition, and control.

Relations represent the mapping of the sets.

In the case of crisp relation there are only two degrees of relationship between the
elements of sets in a crisp relation, i.e., “completely related” and “not related”. A
crisp relation represents the presence or absence of association, interaction, or
interconnectedness between the elements of two or more sets.

But fuzzy relations have infinite number of relationship between the extremes of
completely related and not related between the elements of two or more sets
considered.
Cartesian Product

A = {a,b}
B = {0,1}
A x B = { (a,0) (a,1) (b,0) (b,1) }
Ordered Pairs
Consider
AxA
or A x B x C if C is given

Based on the above, Crisp Relations are discussed


next…

4
Cartesian Product
Note that:
A = 
A = 
For non-empty sets A and B: AB  AB  BA
|AB| = |A||B|

The Cartesian product of two or more sets is


defined as:
A1A2…An = {(a1, a2, …, an) | aiA for 1  i  n}

5
Cartesian Product
The Cartesian product of two sets is defined as:
AB = {(a, b) | aA  bB}
Example:
A = {good, bad}, B = {student, prof}

AB = { (good, student), (good, prof), (bad, student), (bad, prof) }

BA = { (student, good), (prof, good), (student, bad), (prof, bad)}

6
Cartesian Product
The ordered n-tuple (a1, a2, a3, …, an) is an
ordered collection of objects.
Two ordered n-tuples (a1, a2, a3, …, an) and
(b1, b2, b3, …, bn) are equal if and only if they
contain exactly the same elements in the same
order, i.e. ai = bi for 1  i  n.

The Cartesian product of two sets is defined as:


AB = {(a, b) | aA  bB}
Example: A = {x, y}, B = {a, b, c}
AB = {(x, a), (x, b), (x, c), (y, a), (y, b), (y, c)}
7
Crisp Cartesian product
• Lets consider properties of crisp relations first and
then extend the mechanism to fuzzy sets.

• Definition of (crisp) Product set: Let A and B be


two non-empty sets, the product set or Cartesian
product A  B is defined as follows,
• A  B  {(a, b) | a  A, b  B }

• (a set of ordered pairs a,b)

8
Crisp Cartesian product

9
http://if.kaist.ac.kr/lecture/cs670/textbook/
Crisp Relations

Cardinality:
N: # of elements in X
M: # of elements in y
Cardinality of R
nX x Y = nX • nY = M • N
Cardinality of the Power set of this relation
nP(X x Y) = 2MN

10
Cartesian Product

For the crisp sets A1, A2, . . . , An, the set of n-tuples a1, a2, . . ., an, where a1 ∈ A1,
a2 ∈ A2, . . . , an ∈ An, is called the Cartesian product of A1, A2, . . . , An.

The Cartesian product is denoted by


A1 × A2 ×· · ·×An.

In Cartesian product the first element in each pair is a member of x and the second
element is a member of y formally, X x Y

XxY

CARTESIAN PRODUCT OF TWO OR MORE SET IS NOT THE SAME THING


AS THE ARITHMETIC PRODUCT OF TWO OR MORE SETS (EXTENSION
PRINCIPLE
Example: The elements in the two sets A and B are given as A ={0,1}
and B= { a,b,c}. Various Cartesian products of these two sets can be
written as below:

A X B = { (0,a), (0,b), (0,c), (1,a), (1,b), (1,c) }

B X A = { (a,0), (a,1), (b,0), (b,1), (c,0), (c,1) }


A X A = A2 = { (0,0), (0,1), (1,0), (1,1) }
B X B = B2 = { (a,a), (a,b), (a,c), (b,a), (b,b), (b,c), (c,a), (c,b),
(c,c) }

12
Crisp Relations

A subset of a Cartesian Product A1 x A2 x … x Ar is


called an r-ary relation over A1,A2,…,Ar
If r = 2, the relation is a subset of A1 x A2
Binary relation from A1 into A2
The strength of a relation:
Characteristic Function
Χ(x,y) = 1 (x,y)  X x Y
0 (x,y)  X x Y
For Classical relations, the value is 1 or 0
If the universes or sets are finite, we can use relational
matrix to represent it.
13
Cardinality of Sets

If a set S contains n distinct elements, nN,


we call S a finite set with cardinality n.

Examples:
A = {Mercedes, BMW, Porsche}, |A| = 3
B = {1, {2, 3}, {4, 5}, 6} |B| = 4
C= |C| = 0
D = { xN | x  7000 } |D| = 7001
E = { xN | x  7000 } E is infinite!

14
The Power Set
Cardinality of power sets:
| P(A) | = 2|A|
Imagine each element in A has an “on/off” switch
Each possible switch configuration in A corresponds
to one element in 2A
A 1 2 3 4 5 6 7 8
x x x x x x x x x 4 on and 4 off in
different positions
y y y y y y y y y
z z z z z z z z z
• For 3 elements in A, there are
222 = 8 elements in P(A)
15
The Power Set

P(A) “power set of A”


P(A) = {B | B  A} (contains all subsets of A)

Examples:
A = {x, y, z}
P(A) = {, {x}, {y}, {z}, {x, y}, {x, z}, {y, z}, {x, y, z}}

A=
P(A) = {}
Note: |A| = 0, |P(A)| = 1
16
Y
12 pairs – elements of
the set XxY
y3
y2
y1 If the cardinality of the set X is
n(X) and the cardinality of the
set Y is n(Y), then the
x1 x2 x3 x4 X cardinality of the Cartesian
See the previous slide... product (set of elements) is
n(XxY) = n(X)*n(Y)

17
51
means of membership function:
 1, if (x1, x 2 ,..., xn )  
     (X1,X 2 , ..., Xn )  
 0, if (x1, x 2 ,..., xn )  
(arbitrary n-ary relation is a mapping:
(X1,X2,…, Xn) : X1xX2x …xXn  {0,1} )
If a set X1xX2 is finite, then the values of function  can be
collected into a relational matrix
Relations are intimately involved in logic, approximate
reasoning, rule-based systems, etc.
A rule «IF x is A THEN y is B» describes a relation between the
variables x and y - as implication A  B, rule expresses a mapping
(subset of Cartesian product) between input and output domains

18
Crisp Relation (R)

b1
a1
b2
a2
A a3
b3 B
b4
a4 b5

19
R  A B
Crisp Relation (R)

b1
a1
b2
a2
A a3
b3 B
b4
a4 b5

1 0 1 0 0 a1 Rb1 a1 Rb3 a2 Rb5


0 1 
0 0 0 (a1 , b1 ), (a1 , b3 ), (a2 , b5 ) 
MR   R 
1 0 0 1 0  3 1
( a , b ), ( a3 , b4 ), ( a4 , b2 
)
 
0 1 0 0 0 a3 Rb1 a3 Rb4 a4 Rb2 20
CRISP RELATIONS
A subset of the Cartesian product A1 X A2 X … X A r is called an
r-ary relation over A1 , A2, … A r
Most common case is for r= 2; in this situation the relation is a
subset of the Cartesian product A1 X A2 ( i.e, set of pairs , the first
co-ordinate is from A1 and the second from A2 )
This subset of the full Cartesian product is called a “binary
relation from A1 into A2”
If three, four or five sets are involved in a subset of the full
Cartesian product, the relation is called ternary, quartenary or
quinary, respectively
The Cartesian product of two universes X and Y is determined
as the Cartesian product of two sets is defined as:
X  Y = {(x, y) | xX , yY}

21
Classical Relations

Example: Let R be a relation among the three sets


X= {Hindi, English},
Y = {Dollar, Euro, Pound, Rupees}, and
Z ={India, Nepal, United States, Canada}

R (x, y, z) = {Hindi, Rupees, India}


{Hindi, Rupees, Nepal}
{English, Dollar, Canada}
{English, Dollar, United States}.

Relation Matrix ?
Classical Relations

Example: Let R be a relation among the three sets


X= {Hindi, English}, Y = {Dollar, Euro, Pound, Rupees}, and Z ={India, Nepal, United
States, Canada}
R (x, y, z) = {Hindi, Rupees, India}
{Hindi, Rupees, Nepal}
{English, Dollar, Canada}
{English, Dollar, United States}.
Solution.
India Nepal US Canada
Dollar 0 0 0 0
Euro 0 0 0 0
Pound 0 0 0 0
Rupees 1 1 0 0
Hindi

India Nepal US Canada


Dollar 0 0 1 1
Euro 0 0 0 0
Pound 0 0 0 0
Rupees 0 0 0 0
English
Operations on Crisp Relations

Complete Relation Matrix


1 1 1
1 1 1
1 1 1

Null relation Matrix


0 0 0
0 0 0
0 0 0
24
Crisp Binary Relation

• Cartesian product of n sets


n
A 1  A 2  ...  A n   i 1
A i  { ( a 1 ,..., a n ) a 1  A 1 ,..., a n  A n }

• Definition of Binary Relation


If A and B are two sets and there is a specific property
between elements x of A and y of B, this property can
be described using the ordered pair (x, y). A set of
such (x, y) pairs, x  A and y  B, is called a relation R.
• R = { (x,y) | x  A, y  B }

25
http://if.kaist.ac.kr/lecture/cs670/textbook/
Crisp Relations
• Ordered pairs showing connection between two sets:
• (a,b): a is related to b
• (2,3) are related with the relation “<“

• Relations are set themselves


• < = {(1,2), (2, 3), (2, 4), ….}

• Relations can be expressed as matrices < 1 2


1  
2  

26
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

27
Crisp Relations
Relations can also be defined for continuous universes
R = { (x,y) | y  2x, x  X, y  Y}
X= 1 y  2x
0 otherwise

28
CRISP RELATIONS
Cartesian products of two Universes Y and Y is determined as

Strength of the relationship between ordered pairs of


elements in each universe is measured by the
characteristic function

Relation matrix of the ordered pairs of mapping in the relation for the
universes defined as X= {1,2,3} and Y = {a.b.c}

29
Properties of Crisp Relations

Composition
Let R be a relation representing a mapping from X to Y
X
Y University sets
Let S be a relation, a mapping from Y to Z
Can we find T from R to S?

30
31
General Crisp Relation R

This Relation R exists when matches between elements in two


universes are constrained
Again, the characteristic function is used to assign values of
relationship in the mapping of the Cartesian space X x Y to the
binary values of (0,1)

32
Cardinality of the Crisp Relation R

Here , the n elements of Universe X is related to m elements of Universe Y.


If cardinality of X is nX and the cardinality of Y is nY then the cardinality of
the Relation R, between the two universes is nX xY = nX * nY
Cardinality the power set describing this relation, P( X x Y) is then nP(XxY) =
2(nXnY)

Sagittal diagram for a constrained relation


33
34
35
Classical 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.

A useful question we seek to answer is whether we can


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
Properties of Crisp Relations

T: mapping from X to Z
T=RS
Two ways to compute XT(xz)
1. XT(xz) =  (XR(xy)  Xs(yz))
yY
= max(min{XR(xy),XS(yz)})
yY
Max-min composition

2. XT(xz) =  (XR(xy)  Xs(yz))


yY
Max-product composition
multiplication
37
Properties of Crisp Relations
Using Matrix representation:
y1 y2 y3 y4
x1 1 0 1 0
R = x2 0 0 0 1 row by column operation
x3 0 0 0 0 similar to matrix multiplication
z1 z2 max-min principle
y1 0 1 z1 z2
y2 0 0 x1 0 1
S= y3 0 1 T= x2 0 0
y4 0 0 x3 0 0
T(x1,z1) = max[min(1,0) min(0,0) min(1,0) min(0,0)]
= max[0,0,0,0] = 0
Similar, but not the same as matrix multiplication! 38
Classical Composition

The two methods of the composition operations are:

– Max–min composition,
– Max–product composition.

The max–min composition is defined by the set-theoretic and membership


function-theoretic expressions:

The max–product composition is defined by the set-theoretic and membership


function-theoretic expressions:
Composition

We have three universes (x1,x2,x3), (y1,y2,y3,y4) and (z1,z2) . We wish to find a


relation T that relates the ordered pair (x1, z2), i.e., (x1, z2) ∈ T.
In this example,

R = {(x1, y1), (x1, y3), (x2, y4)}


S = {(y1, z2), (y3, z2)}

Sagittal diagram?
Relation matrix?
Max-min composition operations?
Classical Composition

R S
Classical Composition

We wish to find a relation T that relates the ordered pair


(x1, z2), i.e., (x1, z2) ∈ T.
In this example,

R = {(x1, y1), (x1, y3), (x2, y4)}


S = {(y1, z2), (y3, z2)}

Relation matrix
Classical Composition
We wish to find a relation T that relates the ordered pair (x1, z2), i.e., (x1, z2) ∈ T.
In this example,

R = {(x1, y1), (x1, y3), (x2, y4)}


S = {(y1, z2), (y3, z2)}

max-min composition operations


μT (x1,z1) = max(min(1,0), min(1,0),min(1,0),min(0,0)) = max(0,0,0,0) = 0

μT (x1,z2) = max(min(1,1), min(0,0),min(1,1), min(0,0)) = max(1,0,1,0) = 1

μT (x2,z1)= max(min(0,0), min(0,0),min(0,0), min(1,0)) = max(0,0,0,0) = 0

μT (x2,z2) = max(min(0,1), min(0, 0),min(0,1), min(0,0)) = max(0,0,0,0) = 0

μT (x3,z1) = max(min(0,0), min(0,0),min(0,0), min(0,0)) = max(0,0, 0,0) = 0

μT (x3,z2) = max(min(0,1), min(0,0),min(0,1), min(0,0)) = max(0,0, 0,0) = 0


44

A chain is only as strong as its weakest


link
PHYSICAL ANALOGY FOR COMPOSITION

System comprising of large chains placed


together in a
parallel fashion - each chain has a number of
chains links
Testing – take out one chain and place it in a
tensile test machine and exert a large tensile force
on the chain – chain would break at its weakest
link – hence the strength of one chain is the
strength of the weakest link (minimum ٨ ) strength

45
Operations on Crisp Relations

Union
R  S  XR  S(x,y)
XR  S(x,y) = max{ XR(x,y),XS(x,y) }
Intersection
R  S  XR S(x,y)
XR  S(x,y) = min{ XR(x,y),XS(x,y) }
Complement
R’  XR’(x,y)
XR’(x,y) = 1 – XR(x,y)
Containment
R  S  XR(x,y)  XS(x,y)
Identity
0
46
XE
Properties of Crisp Relations

Commutativity
Associativity
Distributivity
Idempotency All hold
De Morgan Law
Excluded middle Law
Etc.

47
Fuzzy Relations

• Fuzzy relation generalizes classical


relation into one that allows partial
membership and describes a relationship
that holds between two or more objects.
• Example: a fuzzy relation “Friend” describe
the degree of friendship between two
persons (in contrast to either being friend or
not being friend in classical relation!)

48
Fuzzy Relation

Fuzzy relations are fuzzy subsets of X×Y , i.e., mapping from X →


Y.
Fuzzy relations maps elements of one universe, X to
those of another universe, say Y , through the Cartesian
product of the two universes.
A fuzzy relation R∼ is mapping from the Cartesian space
X × Y to the interval [0, 1] where the strength of the
mapping is expressed by the membership function of
the relation for ordered pairs. This can be expressed as

is called a fuzzy relation on X × Y .


Fuzzy Relations

Cardinality of Fuzzy Relations


Since the cardinality of fuzzy sets on any universe is
infinity, the cardinality of a fuzzy relation is also infinity.

Note: other books have different discussions!

50
Fuzzy relations

• A fuzzy relation for N sets is defined as an extension of


the crisp relation to include the membership grade.

R = {R(x1, x2, … xN)/(x1, x2, … xN) | xi  X, i=1, … N}


• which associates the membership grade, R , of each
tuple.

• E.g.

Friend = {0.9/(Manos, Nacho), 0.1/(Manos, Dan),


0.8/(Alex, Mike), 0.3/(Alex, John)}

51
Fuzzy Relation
Cartesian Product

Example: Suppose we have two fuzzy sets, A∼ defined


on a universe of three discrete temperatures, X = {x1, x2
, x3}, and B∼ defined on a universe of two discrete
pressures, Y = {y1, y2}, and we want to find the fuzzy
Cartesian product between them. Fuzzy set A∼ could
represent the ‘‘ambient’’ temperature and fuzzy set B∼
the ‘‘near optimum’’ pressure for a certain heat
exchanger, and the Cartesian product might represent
the conditions (temperature–pressure pairs) of the
exchanger that are associated with ‘‘efficient’’
operations. For example, let
=
y1 y2
x1 0.2 0.3 0.9
=
x2 0.5 1 X2
x3 1
3 X1
y1 y2
x1 min((0.2,0.3) min(0.2,0.9)
=
x2 min(0.5,0.3) min(0.5,0.9)
x3 min(1,0.3) min(1,0.9)
y1 y2
x1 0.2 0.2
= x2 0.3 0.5
x3 0.3 0.9
A fuzzy relation generalizes the concept of classical (crisp)
relation introducing a degree of membership for each
ordered n-tuple (x1, x2,…, xn) in
For 2D case it can be defined as follows
X1  X2  ...  Xn

Examples
~

  ( (x 1, x 2 ),  ~ (x1, x 2 ) ) | (x 1, x 2 )  X1  X 2 
~
 denotes a fuzzy relation

a) x1 is close to x2 (both x1 and x2 are numbers)


b) if x1 is medium, then x2 is high (x1 is an observed state,
whereas x2 is a result state or action)
c) x1 is similar to x2 (x1 and x2 can be objects, human
beings, properties)
 55
56
57
Fuzzy Relations
A fuzzy relation R is a 2D MF(Membership
Function):
R  {(( x , y ),  R ( x , y ))|( x , y )  X  Y}

Examples:
• 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)
• If x is large, then y is small (x is an observed
reading and Y is a corresponding action)
Fuzzy Relations
Example:
X = { rainy, cloudy, sunny }

Y = { swimming, bicycling, camping, reading }

X/Y swimming bicycling camping reading


rainy 0.0 0.2 0.0 1.0
cloudy 0.0 0.8 0.3 0.3
sunny
1.0 0.2 0.7 0.0

59
Fuzzy Relations Matrices

• Example: Color-Ripeness relation for tomatoes

R1(x, y) unripe semi ripe ripe


green 1 0.5 0

yellow 0.3 1 0.4

Red 0 0.2 1

60
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


61
Operations on Fuzzy Relations

Union:
R  S = max{ R(x,y),S(x,y) }

Intersection:
R  S = min{ R(x,y),S(x,y) }

Complement:
R’(x,y) = 1 - R(x,y)

Containment:
R  S  R(x,y)  S(x,y)

62
Properties of Fuzzy Relations

Commutativity
Associativity
Distributivity
Idempotency All hold
De Morgan Law
Excluded middle Law
Etc.
Note: R  R’  E
R  R’  0
In general. 63
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)}


~ ~ ~ ~

Complement
 R ( x, y )  1   R ( x, y )
~ ~

Containment
If R  S then R ( x, y)  S ( x, y)
~ ~ ~ ~

64
Properties of fuzzy relation

R R  E
~ ~

R R  O
~ ~

65
Fuzzy Advice

Beware of the math!

66
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.

A useful question we seek to answer is whether we can


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. It turns out that we can find
such a relation using an operation known as composition.

67
Composition
If R is a fuzzy relation on the space X x Y
S is a fuzzy relation on the space Y x Z
Then, fuzzy composition is T = R  S
There are two common forms of the composition operation:
1. Fuzzy max-min composition
T(xz) =  (R(xy)  s(yz))
yY
2. Fuzzy max-production composition
T(xz) =  (R(xy)  s(yz))
yY
Note: R  S  S  R multiplication

68
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) 
69
70

Example
• Using the max–min composition operation, relation
matrices for R and S would be expressed as

µT(x1, z1) = max[min(1, 0), min(0, 0), min(1, 0), min(0, 0)] = 0
71

Example
• Using the max–min composition operation, relation
matrices for R and S would be expressed as

µT(x1, z1) = max[min(1, 0), min(0, 0), min(1, 0), min(0, 0)] = 0
µT(x1, z2) = max[min(1, 1), min(0, 0), min(1, 1), min(0, 0)] = 1
Max-Min Composition
The max-min composition of two fuzzy relations
R1 (defined on X and Y) and R2 (defined on Y and
Z) is
 R  R ( x , z )  [ R ( x, y )   R ( y , z )]
1 2 1 2
y

Properties:
• Associativity: R  ( S  T )  ( R  S )  T
• Distributivity over union:
R  ( S  T )  ( R  S ) ( R  T )
• Weak distributivity over intersection:
R  ( S  T )  ( R  S ) ( R  T )
• Monotonicity:
S  T  (R S)  (RT)
Linguistic Variables
A numerical variables takes numerical values:
Age = 65
A linguistic variables takes linguistic values:
Age is old
A linguistic values is a fuzzy set.
All linguistic values form a term set:
T(age) = {young, not young, very young, ...
middle aged, not middle aged, ...
old, not old, very old, more or less old, ...
not very yound and not very old, ...}
Fuzzy Cartesian product and composition

If A B  R  X  Y
~ ~ ~

 R ( x, y)   AB ( x, y)  min{  A ( x),  B ( y)}


~ ~ ~ ~ ~

If T  RoS
~ ~ ~

T ( x, z)   (R ( x, y)  S ( y, z))
~ yY ~ ~

RoS  S o R
~ ~ ~ ~

74
.

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) 

75
Properties of Fuzzy Relations

Vector Outer Product


If R is a fuzzy relation on the space X x Y
S is a fuzzy relation on the space Y x Z
Then, fuzzy composition is T = R  S
1. Fuzzy max-min composition
T(xz) =  (R(xy)  s(yz))
yY
2. Fuzzy max-production composition
T(xz) =  (R(xy)  s(yz))
yY
Note: R  S  S  R

76
Properties of Fuzzy Relations

Fuzzy Cartesian Product and Composition


R(x y) = A x B(x y) = min(A(x), B(y))

Example:
A = 0.2/x1 + 0.5/x2 + 1/x3
B = 0.3/y1 + 0.9/y2
y1 y2
0.2 x1 0.2 0.2
AxB= 0.5 0.3 0.9 = x2 0.3 0.5
1 x3 0.3 0.9

77
Fuzzy Relations

Let A and B be two fuzzy sets defined as

The fuzzy relation i.e. the Cartesian product of A and B


using the min operation will be:

78
1 1 1 2 3 4
A= 2 0.8 B= 0.5 1 0.3 0
3 0.6 1X4
4 0.5 4X1

1 2 3 4
1 min (1,0.5) min (1,1) min(1,0.3) min(1,0)
R= 2 min(0.8,0.5) min(0.8,1) min(0.8,0.3) min(0.8,0)
3 min(0.6,0.5) min(0.6,1) min(0.6,0.3) min(0.6,0)
4 min(0.5,0.5) min(0.5,1) min(0.5,0.3) min(0.5,0)

79
1 2 3 4
1 0.5 1 0.3 0
R= 2 0.5 0.8 0.3 0
3 0.5 0.6 0.3 0
4 0.5 0.5 0.3 0

80
81

• Fuzzy Cartesian product, using


µS•R (x, z) = max [min (µR (x, y), µS (y, z))]
results in a fuzzy relation R (of size 3 × 2)
representing ‘‘efficient’’ conditions,
82

Example
• X = {x1, x2}, Y = {y1, y2}, and Z = {z1, z2, z3}
Consider the following fuzzy relations:

Then the resulting relation, T, which relates


elements of universe X to elements of universe Z,
μT(x1, z1) = max[min(0.7, 0.9), min(0.5, 0.1)] = 0.7
83

and by max–product composition,

μT(x2, z 2) = max[(0.8 . 0.6), (0.4 . 0.7)] = 0.48


Fuzzy Relation
Cartesian Product
Example: Suppose we have two fuzzy sets, A∼ defined on a universe of three
discrete temperatures, X = {x1, x2, x3}, and B∼ defined on a universe of two discrete
pressures, Y = {y1, y2}, and we want to find the fuzzy Cartesian product between
them. Fuzzy set A∼ could represent the ‘‘ambient’’ temperature and fuzzy set B∼ the
‘‘near optimum’’ pressure for a certain heat exchanger, and the Cartesian product
might represent the conditions (temperature–pressure pairs) of the exchanger that
are associated with ‘‘efficient’’ operations. For example, let

The fuzzy Cartesian product results in a fuzzy relation R∼ representing ‘‘efficient’’


conditions,
Fuzzy Relation
Composition
Solution:Max–Min Composition

T
Fuzzy Relation
Composition
Solution:Max–Product Composition
87
Fuzzy Composition:
A Simple Introduction to
Resemblance

Robert J. Marks II

88
Fuzzy
Resemblance
(on a scale of 0 to 1)

0.8 0.1

0.2 0.9

89
Matt Damon resembles Tom Cruz if
[(Matt Damon resembles Josh)
and
(Josh resembles Tom Cruz)]
or
[(Matt Damon resembles the
0.8 0.1 Professor)
and
(The Professor resembles Tom Cruz)]

Fuzzy membership of Matt


Damon’s resemblance to Tom
Cruz =
0.2 0.9 max[ min(0.8, 0.2) ,
min(0.1,0.9)]
=0.2

Min = 0.2 Min = 0.1


Max= 0.2 90
Alternate view:

0.2

o =
0.8 0.1 0.9 0.2

The composition operator,


Recall the operation ‘o’, is the same as
of the inner product
of two vectors.
conventional matrix
operation, except max
replaces addition and min
= replaces multiplication.
91
Strongest
A longer example
Link
Pa =
[ 0.0 0.1 0.3 0.5 0.8 0.1 ]

[ 0.0 0.0 0.4 0.6 0.7 0.0 ]


= Mj

Composition:
Pa T O Mj = 0.7
0.7
92
Matrices

0.7 0.4
0.6 0.7 0.4
O
0.4 0.1
0.2 0.5 0.5
0.7 0.2
0.6 0.4
=

0.5 0.2
93
Max-min composition is not
mathematically tractable, therefore
other compositions such as max-
product composition have been
suggested

Max-product composition
Example 3.8 (Page 59)

Suppose we are interested in understanding the speed


control of the DC shunt motor under no-load condition,
as shown.

95
Example 3.8
Initially, the series resistance Rse in should be kept in the cut-in
position for the following reasons:
1. The back electromagnetic force, given by Eb = kNφ, where k
is a constant of proportionality, N is the motor speed, and φ is
the flux (which is proportional to input voltage, V ), is equal to
zero because the motor speed is equal to zero initially.
2. We have V = Eb + Ia(Ra + Rse), therefore Ia = (V − Eb)/(Ra
+ Rse), where Ia is the armature current and Ra is the armature
resistance. Since Eb is equal to zero initially, the armature
current will be Ia = V/(Ra + Rse), which is going to be quite
large initially and may destroy the armature.

96
Example 3.8
Let Rse be a fuzzy set representing a number of
possible values for series resistance, say sn values,
given as

and let Ia be a fuzzy set having a number of possible


values of the armature current, say m values, given as

The fuzzy sets Rse and Ia can be related through a


fuzzy relation, say R, which would allow for the
establishment of various degrees of relationship
between pairs of resistance and current.
97
Example 3.8
Let N be another fuzzy set having numerous values for
the motor speed, say v values, given as

Now, we can determine another fuzzy relation, say S, to


relate current to motor speed, that is, Ia to N.
Using the operation of composition, we could then
compute a relation, say T, to be used to relate series
resistance to motor speed, that is, Rse to N.

98
Example 3.8
The operations needed to develop these relations are
as follows – two fuzzy Cartesian products and one
composition:

99
Example 3.8
Suppose the membership functions for both series
resistance Rse and armature current Ia are given in
terms of percentages of their respective rated values,
that is,

100
Example 3.8

The following relation then result from use of the


Cartesian product to determine R:

101
Example 3.8
Cartesian product to determine S:

102
Example 3.8

The following relation results from a max–min


composition for T:

103
Tolerance and Equivalence relations
Relations exhibit various useful properties
Relations can be used in Graph Theory
Example : A universe of three elements described as X = {1,2,3}
We can use Graph Theory to describe the properties such as
reflexivity, symmetry, and transitivity
These graphs are as follows:

Graphs for properties of (a) reflexivity (b) symmetry and © transitivity104


Tolerance and Equivalence Relation

Crisp Equivalence Relation


RXxX
Relation has the following properties:
Reflexivity
(xi, xj)  R or XR(xi, xj) = 1
Symmetry
(xi, xj)  R  (xj, xi)  R
or XR(xi, xj) = XR(xj, xi)
Transitivity
(xi , xj)  R and (xj, xk)  R  (xi, xk)  R
or XR(xi , xj) = 1 and XR(xj, xk) = 1  XR(xi, xk) = 1
105
Crisp Tolerance Relation
(or proximity relation)

Only has reflexivity and symmetry


A tolerance relation, R1 can become an Equivalence
Relation by at most (n-1) compositions ( n-1), n is the
cardinal member of X.
R1n-1 = R1  R1  …  R1 = R

106
107

Crisp Equivalence Relation


• A relation R on a universe X can also be thought
of as a relation from X to X. The relation R is
an equivalence relation and it has the following
three properties:
• Reflexivity
• Symmetry
• Transitivity
108

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
109

Symmetry
• (xi, xj) ∈ R → (xj, xi) ∈ R
110

Transitivity
• (xi ,xj) ∈ R and (xj ,xk) ∈ R → (xi ,xk) ∈ R
Example – Crisp Tolerance Relation

111
112

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.
• A tolerance relation, R, can be
reformed into an equivalence relation by at most
(n − 1) compositions with itself, where n
is the cardinal number of the set defining R, in
this case X
113

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 takeoff
and landing policies in the various countries.
114

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.


115

Example
• The graph for this tolerance relation

• If (x1,x5) ∈ R1 can become an equivalence


relation
116

Example:
• This matrix is equivalence relation because it has
(x1,x5)

Five-vertex graph of equivalence relation


(reflexive, symmetric, transitive)
Crisp Tolerance Relation
(or proximity relation)

Example:
1 1 0 0 0 Note: symmetric, reflexive, but
1 1 0 0 1 not transitive, why?
R1 = 0 0 1 0 0
0 0 0 1 0 X(x1 x2) = 1
0 1 0 0 1 X(x2 x5) = 1 but
X(x1 x5)  1 (=0)

1 1 0 0 1
1 1 0 0 1
Try R2 = 0 0 1 0 0 Now, it is transitive!
0 0 0 1 0
1 1 0 0 1

117
Fuzzy Tolerance and Equivalence Relation

A fuzzy relation R has:


1. Reflexivity R(xi,xi) = 1
2. Symmetry R(xi, xj)= R(xj xi)
3. Transitivity R(xi, xj) = 1
R(xj, xk) = 2  R(xi, xk) = 
where   min{1, 2}
Fuzzy tolerance relation R1 has reflexivity, symmetry. It
can be transformed into a fuzzy equivalence relation by
at most (n-1) ( n-1) compositions.
R1n-1 = R1  R1  …  R1= R
118
119

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
aluminum-lithium alloy used in the fuel tanks of a new
experimental aircraft. In order to propose methods to
eliminate the biocorrosion 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,
120

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)
121

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)
122

Finally, after one or two more compositions, transitivity results:


123
124
125
126
Value assignments
 Cartesian product
 Closed-from expression
 Simple observation of a physical process
 No variation
 model the process crisp relation
 Y= f(X)
 Lookup table
 Variability exist
 Membership values on the interval [0,1]
 Develop a fuzzy relation
 Linguistic rules of knowledge
 If-then rules
 Classification
 Similarity methods in data manipulation
Fuzzy Tolerance and Equivalence Relation

Value Assignment(1)
How to find the membership values for the relation?

1. Cartesian Production
Note: you have to know the membership value for the
sets!
2. Y = f(x) X – input vector
Y – output vector

3. Look up table y1 y2 y3
x1
x2
x3 128
Fuzzy Tolerance and Equivalence Relation

Value Assignment
4. Linguistic rule of knowledge
5. Classification
6. Similarity methods in data manipulation

The more robust a data set, the more accurate the


relation entries!

129
VALUE ASSIGNMENTS(2)
The first method has already been discussed.
The second method is achieved by simple observation of a physical
process. Here the observation of the process is carried out for which
yield a set of outputs given a set of inputs. If there is no variation of the
input-output pairs then we may model the process with a crisp relation.
Or if no Variability exists, we may be able to express the relation as a
closed form algorithm of the form Y = f(X), where X is the vector of the
inputs, and Y is the vector of the outputs.

Third Method: Lookup table serves the need when there is variability .
The membership values in the interval [0,1] may lead to the
development of the Lookup table.

Fourth Method: Fuzzy relations can also be assembled from


linguistic knowledge, expressed as if-then rules – making use of
knowledge of experts,opinion polls etc
130
VALUE ASSIGNMENTS(3)
In the fifth method, we establish relationships among the elements of
two or more data sets. Here we need sufficient data to accurately
predict the relationship. The more robust a data set, the more accurate
is the relationship among the elements of the data sets.

In the sixth method, we look for similar pattern or structure in data


using various metrics. These come under the category of family of
procedures called SIMILARITY METHODS.

There are wide of techniques available in this domain but we will


confine ourselves to the most prevalent techniques.

131
Cosine Amplitude

X = {x1,x2,…,xn} each element is also a vector


Xi = {xi1,xi2,…,xim}
ij = R(xi,xj)
It will be n x n symmetric,reflexive… i.e. a tolerance
relation!

Note: this relates to the vector dot product for cosine


function 132
Cosine Amplitude
 X={x1,x2,….,xn}
xi={ xi1, xi 2,...., xim }

| k 1 xik x jk |
m

rij 
(k 1 xik2 )(k 1 x 2jk )
m m
Cosine Amplitude

• Example 3.12
Regions x1 x2 x3 x4 x5
Xi1—Ratio with no damage 0.3 0.2 0.1 0.7 0.4

Xi2—Ratio with medium damage 0.6 0.4 0.6 0.2 0.6


Xi3—Ratio with serious damage 0.1 0.4 0.3 0.1 0

| k 1 xik x jk |
3

rij 
r12=0.836
• ( x )(k 1 x 2jk )
3 3
2 r12 = (x11x21+x12x22+x13x23)/
k 1 ik
135
Cosine Amplitude
• Example 3.1
– Tolerance relation

– Equivalence relation
Max-min Method

137
Max-min Method
 rij= 
m
min( xik , xjk ) where i, j =1,2,…n
k 1


m
k 1
max( xik , xjk )
 Example 3.13
 Reconsider Example 3.12

3
(min( 0.3,0.2), min( 0.6,0.4), min( 0.1,0.4))
r12  k 1


3
k 1
(max( 0.3,0.2), max( 0.6,0.4), max( 0.1,0.4))

 Tolerance relation
139
Other Similarity Methods

Absolute Exponential:

Exponential Similarity Coefficient:

Where, Sk = any general measure for all the data i.e.


(Sk)2 ≥ 0
140
Other Similarity Methods

Other methods produce scalar quantities which are similar


to the cosine amplitude, such as the following:

Geometric average minimum:

Scalar Product:

Where:

141
Other Similarity Methods

Some methods are analogous to popular statistical


quantities, such as:
Correlation Coefficient:

Where: and

Arithmetic Average Minimum:

142
Other Similarity Methods

Some methods are based on the inverse relationships,


for example:
Absolute Reciprocal:

Where M is selected to make 0 ≤ rij ≤ 1

Absolute subtrahend:

Where c is selected to make 0 ≤ rij ≤ 1

143
Other Similarity Methods

Other methods are nonparametric, such as:


Nonparametric:
where x’ik = xik – xi and x’jk – xj
n+ = number of elements > 0 in
{x’i1x’j1,x’i2x’j2,…,x’imx’jm}
n- = number of elements < 0 in
{x’i1x’j1,x’i2,x’j2,…,x’im,x’jm}

In the above equations, terms such as x’i1 x’j1 are


products of data elements.
144
Application: Computer Engineering
Problem: In computer engineering, different logic families are often
compared on the basis of their power-delay product. Consider the fuzzy
~ of logic families, the fuzzy set ~
set F D of delay times(ns), and the fuzzy
set ~
P of power dissipations (mw).
If ~F = {NMOS,CMOS,TTL,ECL,JJ},
~D = {0.1,1,10,100},
~P = {0.01,0.1,1,10,100}
R1 = ~
Suppose ~ D x~F and ~R2 = ~
F x~P .01 .1 1 10 100
N C T E J N 0 .4 1 .3 0 
0.1 0 0 0 .6 1 C .2 1 0 0 0 
1 0 .1 .5 1 0
R˜1  and R˜2  T 0 0 .7 1 0 
10 .4 1 1 0 0 E 0 0 0 1 .5
100 
1 .2 0 0 0
 J  0 
1 .1 0 0 
Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill
Application: Computer Engineering (Cont)
We can use max-min composition to obtain a relation
between delay times and power dissipation: i.e., we can
compute R˜3  R˜1 R˜2 or R˜  ( R˜   R˜ ) 3 1 2

.01 .1 1 10 100
 
0.1 1 .1 0 .6 .5
˜R  1 .1 .1 .5 1 .5
3
10 .2 1 .7 1 0 
100 .2 .4 1 .3 0 
 

Fuzzy Logic with Engineering Applications: Timothy J. Ross, McGraw-Hill


Application: Fuzzy Relation Petite
Fuzzy Relation Petite defines the degree by which a person with
a specific height and weight is considered petite. Suppose the
range of the height and the weight of interest to us are {5’, 5’1”,
5’2”, 5’3”, 5’4”,5’5”,5’6”}, and {90, 95,100, 105, 110, 115, 120,
125} (in lb). We can express the fuzzy relation in a matrix form
as shown below: 90 95 100 105 110 115 120 125
5' 1 1 1 1 1 1 .5 .2 
5'1" 1 1 1 1 1 .9 .3 .1
5' 2" 1 1 1 1 1 .7 .1 0 
P˜  5' 3" 1 1 1 1 .5 .3 0 0 
 
5' 4" .8 .6 .4 .2 0 0 0 0
 
5' 5" .6 .4 .2 0 0 0 0 0
 
5' 6" 0 0 0 0 0 0 0 0 

Fuzzy Logic:Intelligence, Control, and Information, J. Yen and R. Langari, PrenticeHall


Application: Fuzzy Relation Petite
Given a two-dimensional fuzzy relation and the possible values of one
variable, infer the possible values of the other variable using similar
fuzzy composition as described earlier.

Definition: Let X and Y be the universes of discourse for variables x


and y, respectively, and xi and yj be elements of X and Y. Let R be a
fuzzy relation that maps X x Y to [0,1] and the possibility distribution
of X is known to be Px(xi). The compositional rule of inference
infers the possibility distribution of Y as follows:

max-min composition: PY (yj )  max(min( PX (xi ),PR (xi , yj )))


xi

max-product composition: PY (yj )  max(PX (xi )  PR (xi , yj ))


xi

Fuzzy Logic:Intelligence, Control, and Information, J. Yen and R. Langari, PrenticeHall


Application: Fuzzy Relation Petite
Problem: We may wish to know the possible weight of a petite female
who is about 5’4”.

Assume About 5’4” is defined as


About-5’4” = {0/5’, 0/5’1”, 0.4/5’2”, 0.8/5’3”, 1/5’4”, 0.8/5’5”, 0.4/5’6”}
Using max-min compositional, we can find the weight possibility
distribution of a petite person about 5’4” tall:
P weight (90)  (0 1)  (0 1)  (.4  1)  (.8 1)  (1  .8)  (.8  .6)  (.4  0)
90 95 100 105 110 115 120 125
5' 1 1 1 1 1 1 .5 .2   0.8
5'1" 1 1 1 1 1 .9 .3 .1
5' 2" 1 1 1 1 1 .7 .1 0 
Similarly, we can compute the possibility degree for
P˜  5' 3" 1 1 1 1 .5 .3 0 0  other weights. The final result is
 
5' 4" .8 .6 .4 .2 0 0 0 0
 
5' 5" .6 .4 .2 0 0 0 0 0 P weight  {0.8 / 90,0.8 / 95,0.8 /100,0.8/ 105,0.5 /110,0.4 /115, 0.1/ 120,0 /125}
 
5' 6" 0 0 0 0 0 0 0 0 

Fuzzy Logic:Intelligence, Control, and Information, J. Yen and R. Langari, PrenticeHall

You might also like