Professional Documents
Culture Documents
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
2
Classical Relations and Fuzzy Relations
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
4
Cartesian Product
Note that:
A =
A =
For non-empty sets A and B: AB AB BA
|AB| = |A||B|
5
Cartesian Product
The Cartesian product of two sets is defined as:
AB = {(a, b) | aA bB}
Example:
A = {good, bad}, B = {student, prof}
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.
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) = 2MN
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.
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
12
Crisp Relations
Examples:
A = {Mercedes, BMW, Porsche}, |A| = 3
B = {1, {2, 3}, {4, 5}, 6} |B| = 4
C= |C| = 0
D = { xN | x 7000 } |D| = 7001
E = { xN | 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
222 = 8 elements in P(A)
15
The Power Set
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
21
Classical Relations
Relation Matrix ?
Classical Relations
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 “<“
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
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
32
Cardinality of the Crisp Relation R
T: mapping from X to Z
T=RS
Two ways to compute XT(xz)
1. XT(xz) = (XR(xy) Xs(yz))
yY
= max(min{XR(xy),XS(yz)})
yY
Max-min composition
– Max–min composition,
– Max–product composition.
Sagittal diagram?
Relation matrix?
Max-min composition operations?
Classical Composition
R S
Classical Composition
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,
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
XE
Properties of Crisp Relations
Commutativity
Associativity
Distributivity
Idempotency All hold
De Morgan Law
Excluded middle Law
Etc.
47
Fuzzy Relations
48
Fuzzy Relation
50
Fuzzy relations
• E.g.
51
Fuzzy Relation
Cartesian Product
Examples
~
( (x 1, x 2 ), ~ (x1, x 2 ) ) | (x 1, x 2 ) X1 X 2
~
denotes a fuzzy relation
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 }
59
Fuzzy Relations Matrices
Red 0 0.2 1
60
Fuzzy Relations
…
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
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
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.
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))
yY
2. Fuzzy max-production composition
T(xz) = (R(xy) s(yz))
yY
Note: R S S R multiplication
68
Max-Min Composition
X Y Z
R: fuzzy relation defined on X and Y.
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) (RT)
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
~ ~ ~
If T RoS
~ ~ ~
T ( x, z) (R ( x, y) S ( y, z))
~ yY ~ ~
RoS S o R
~ ~ ~ ~
74
.
Max-Product Composition
X Y Z
R: fuzzy relation defined on X and Y.
75
Properties of Fuzzy Relations
76
Properties of Fuzzy Relations
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
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
Example
• X = {x1, x2}, Y = {y1, y2}, and Z = {z1, z2, z3}
Consider the following fuzzy relations:
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)]
0.2
o =
0.8 0.1 0.9 0.2
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)
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
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
101
Example 3.8
Cartesian product to determine S:
102
Example 3.8
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:
106
107
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
Example
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:
Example
• The graph for this tolerance relation
Example:
• This matrix is equivalence relation because it has
(x1,x5)
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
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
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
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.
131
Cosine Amplitude
| 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
| 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:
Scalar Product:
Where:
141
Other Similarity Methods
Where: and
142
Other Similarity Methods
Absolute subtrahend:
143
Other Similarity Methods
.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