You are on page 1of 42

Fuzzy Relations and

Reasoning
Dr. Ngo Thanh Long
Department of Information Systems,
Faculty of Information Technology
Email: ngotlong@gmail.com
Fuzzy Relations
A fuzzy relation R is a 2 D MF:
R :{ ((x, y),
R
(x, y)) | (x, y) e X Y}
Examples:
x is close to y (x & y are real numbers)
x depends on y (x & y are events)
x and y look alike (x & y are persons or objects)
Let X = Y = IR+
and R(x,y) = y is much greater than x
The MF of this fuzzy relation can be subjectively defined as:




if X = {3,4,5} & Y = {3,4,5,6,7}

s
>
+ +

=
x y if , 0
x y if ,
2 y x
x y
) y , x (
R
Extension Principle
The image of a fuzzy set A on X
n n A 2 2 A 1 1 A
x / ) x ( x / ) x ( x / ) x ( A + + + =
under f(.) is a fuzzy set B:
n n B 2 2 B 1 1 B
y / ) x ( y / ) x ( y / ) x ( B + + + =
where y
i
= f(x
i
), i = 1 to n
If f(.) is a many-to-one mapping, then
) x ( max ) y (
A
) y ( f x
B
1
=
Defintion: Extension Principle
Suppose that function f is a mapping from an n-
dimensional Cartesian product space X1 X2 Xn
to a 1-dimensional universe Y s.t. y=f(x1, , xn), and
suppose A1, , An are n fuzzy sets in X1, , Xn,
respectively.
Then, the extension principle asserts that the fuzzy set B
induced by the mapping f is defined by
Example
Application of the extension principle to fuzzy
sets with discrete universes

Let A = 0.1 / -2+0.4 / -1+0.8 / 0+0.9 / 1+0.3 / 2
and f(x) = x2 3
Applying the extension principle, we obtain:
B = 0.1 / 1+0.4 / -2+0.8 / -3+0.9 / -2+0.3 /1
= 0.8 / -3+(0.4V0.9) / -2+(0.1V0.3) / 1
= 0.8 / -3+0.9 / -2+0.3 / 1
where V represents the max operator, Same
reasoning for continuous universes
Max-Min Composition
The max-min composition of two fuzzy relations
R
1
(defined on X and Y) and R
2
(defined on Y
and Z) is

Properties:
Associativity:

Distributivity over union:

Week distributivity over intersection:

Monotonicity:

R R
y
R R
x z x y y z
1 2 1 2

( , ) [ ( , ) ( , )] = v .
R S T R S R T ( ) ( ) ( ) =
R S T R S T ( ) ( ) =
R S T R S R T ( ) ( ) ( ) _
S T R S R T _ _ ( ) ( )
Max-Star Composition
Max-product composition:

In general, we have max-* composition:

where * is a T-norm operator.


R R
y
R R
x z x y y z
1 2 1 2

( , ) [ ( , ) ( , )] = v

R R
y
R R
x z x y y z
1 2 1 2

( , ) [ ( , )* ( , )] = v
Example of max-min & max-
product composition
Let R
1
= x is relevant to y
R
2
= y is relevant to z
be two fuzzy relations defined on XY and
YZ respectively :X = {1,2,3}, Y = {o,|,_,o}
and Z = {a,b}. Assume that:

(
(
(
(

=
(
(
(

=
0.2 0.7
0.6 0.5
0.3 0.2
0.1 9 . 0
R
0.2 0.3 0.8 0.6
0.9 0.8 0.2 0.4
0.7 0.5 0.3 1 . 0
R
2 1
R
1
oR
2
may be interpreted as

the derived fuzzy
relation x is relevant to z based on R
1
& R
2
Lets assume that we want to compute the
degree of relevance between 2 e X & a e Z
Using max-min, we obtain:


{ }
{ }
0.7
5,0.7 0.4,0.2,0. max
7 . 0 9 . 0 , 5 . 0 8 . 0 , 2 . 0 2 . 0 , 9 . 0 4 . 0 max ) a , 2 (
2
R
1
R
=
=
. . . . =

{ }
{ }
0.63
0.40,0.63 0.36,0.04, max
7 . 0 * 9 . 0 , 5 . 0 * 8 . 0 , 2 . 0 * 2 . 0 , 9 . 0 * 4 . 0 max ) a , 2 (
2
R
1
R
=
=
=

Using max-product composition, we obtain:
Linguistic variables
The concept of linguistic variables introduced
by Zadeh is an alternative approach to
modeling human thinking.
Information is expressed in terms of
fuzzy sets instead of crisp numbers
Example
numerical values: Age = 65
*A linguistic variables takes linguistic values Age is old
*A linguistic value 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 young and A numerical variable
takes not very old, ...}
Where each term T(age) is characterized by fuzzy
set of a universe of discourse X= = [0,100]
Example:
A numerical variable takes numerical values
Age = 65
A linguistic variables takes linguistic values
Age is old
A linguistic value 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 young and not very old, ...}
Linguistic variables
Where each term T(age) is
characterized by a fuzzy set of a
universe of discourse X= [0,100]
Operations on linguistic variables

Let A be a linguistic value described by a fuzzy set
with membership function A(.)



is a modified version of the original linguistic value.
A2 = CON(A) is called the concentration operation
\A = DIL(A) is called the dilation operation
CON(A) & DIL(A) are useful in expression the hedges such as
very & more or less in the linguistic term A
Other definitions for linguistic hedges are also possible
=
X
k
A
k
x / )] x ( [ A
Linguistic variables


Composite linguistic terms

Lets define:



where A, B are two linguistic values whose
semantics are respectively defined by

A
(.) &
B
(.)
Composite linguistic terms such as: not very
young, not very old & young but not too young
can be easily characterized
}
}
}
v = =
. = =
= =
X
B A
X
B A
X
A
x / )] x ( ) x ( [ B A B or A
x / )] x ( ) x ( [ B A B and A
, x / )] x ( 1 [ A ) A ( NOT
Linguistic variables
Example: Construction of MFs for composite
linguistic terms. Lets define





Where x is the age of a person in the universe of
discourse [0,100]

More or less = DIL(old) = \old =
6
old
4
young
30
100 x
1
1
) 100 , 3 , 30 , x ( bell ) x (
20
x
1
1
) 0 , 2 , 20 , x ( bell ) x (
|
.
|

\
|

+
= =
|
.
|

\
|
+
= =
x /
30
100 x
1
1
X
6
}
|
.
|

\
|

+
k 2
x
1
1
) , k , , x ( bell ) x (
(...)
|
.
|

\
|
o

+
= o =
Linguistic variables
Not young and not old = young old =



Young but not too young = young young2 (too =
very) =


Extremely old very very very old = CON
(CON(CON(old))) =
x /
30
100 x
1
1
1
20
x
1
1
1
6
X
4
(
(
(
(

|
.
|

\
|

+
.
(
(
(
(

|
.
|

\
|
+

}
}
(
(
(
(
(

|
|
|
|
|
.
|

\
|
|
.
|

\
|
+
.
(
(
(
(

|
.
|

\
|
+
x
2
4 4
x /
20
x
1
1
1
20
x
1
1
}
(
(
(
(

|
.
|

\
|

+
x
8
6
x /
30
100 x
1
1
Linguistic variables
Contrast intensification
the operation of contrast intensification on a
linguistic value A is defined by



INT increases the values of A(x) which are greater
than 0.5 & decreases those which are less or equal
that 0.5
Contrast intensification has effect of reducing the
fuzziness of the linguistic value A

s s
s s
=
1 ) x ( 0.5 if ) A ( 2
5 . 0 ) x ( 0 if A 2
) A ( INT
A
2
A
2
Linguistic variables
Orthogonality
A term set T = t
1
,, t
n
of a linguistic variable x on the
universe X is orthogonal if:




Where the t
i
s are convex & normal fuzzy sets
defined on X.
=
e =
n
1 i
i
t
X x , 1 ) x (
Fuzzy if-then rules
General format:
If x is A then y is B
(where A & B are linguistic values defined by fuzzy sets
on universes of discourse X & Y).
x is A is called the antecedent or premise
y is B is called the consequence or conclusion
Examples:
If pressure is high, then volume is small.
If the road is slippery, then driving is dangerous.
If a tomato is red, then it is ripe.
If the speed is high, then apply the brake a little.
Fuzzy If-Then Rules
A coupled with B
A entails B
Two ways to interpret If x is A then y is B:
Fuzzy if-then rules
Note that R can be viewed as a fuzzy set with a
two-dimensional MF


R
(x, y) = f(
A
(x),
B
(y)) = f(a, b)

With a =
A
(x), b =
B
(y) and f called the fuzzy
implication function provides the membership
value of (x, y)

Fuzzy if-then rules
Case of A coupled with B (A and B)



(minimum operator proposed by Mamdani, 1975)




(product proposed by Larsen, 1980)






(bounded product operator)
}
. = =
Y X
B A m
y x y x B A R
*
) , /( ) ( ) ( *
) y , x /( ) y ( ) x ( B * A R
Y * X
B A p
= =
) y , x /( ) 1 ) y ( ) x ( ( 0
) y , x /( ) y ( ) x ( B * A R
B A
Y * X
Y * X
B A bp
+ v =
= =
}
}
Fuzzy if-then rules
Fuzzy implication function:
A coupled with B

A
(x)=bell(x;4,3,10) and
B
(y)=bell(y;4,3,10)

R A B
x y f x y f a b ( , ) ( ( ), ( )) ( , ) = =
Fuzzy if-then rules
Case of A entails B (not A or B)




(Zadehs arithmetic rule by using bounded sum
operator for union)




(Zadehs max-min rule)
) b a 1 ( 1 ) b , a ( f : where
) y , x /( ) y ( ) x ( 1 ( 1 B A R
a
Y * X
B A a
+ . =
+ . = =
) b a ( ) a 1 ( ) b , a ( f : where
) y , x /( )) y ( ) x ( ( )) x ( 1 ( ) B A ( A R
m
Y * X
B A A mm
. v =
. v = =
}
Fuzzy if-then rules






(Boolean fuzzy implication with max for union)






(Goguens fuzzy implication with algebraic product for T-norm)
b ) a 1 ( ) b , a ( f : where
) y , x /( ) y ( )) x ( 1 ( B A R
s
Y * X
B A s
v =
v = =

s
= <
< =
A
otherwise a / b
b a if 1
b
~
a : where
) y , x /( )) y (
~
) x ( ( R
Y * X
B A
Fuzzy if-then rules
A entails B
Fuzzy Reasoning

Known also as approximate reasoning

It is an inference procedure that derives
conclusions from a set of fuzzy if-then-rules &
known facts
The compositional rule of inference plays a key
role in F.R.
Using the compositional rule of inference, an
inference procedure upon a set of fuzzy if-
then rules are formalized.


Compositional Rule of Inference
Derivation of y = b from x = a and y = f(x):
a and b: points
y = f(x) : a curve
x
y
a
b
y = f(x)
a
b
y
x
a and b: intervals
y = f(x) : an interval-valued
function
y = f(x)
Compositional Rule of Inference
The extension principle is a special case of the
compositional rule of inference
F is a fuzzy relation on X*Y, A is a fuzzy set
of X & the goal is to determine the resulting
fuzzy set B
Construct a cylindrical extension c(A) with
base A
Determine c(A) . F (using minimum operator)
Project c(A) . F onto the y-axis which
provides B
Compositional Rule of Inference
a is a fuzzy set and y = f(x) is a fuzzy relation:
Compositional Rule of Inference
B?

(a) F: X Y

(b) c(A)


(c) c(A)F

(d) Y as a
fuzzy
set B
on the
y-axis.
Compositional Rule of Inference
(a) F: X Y F(x,y)
(b) c(A) c(A)(x,y) = A(x)
(c) c(A)F c(A)F(x,y) = min[c(A)(x,y), F(x,y)]
= min[A(x), F(x,y)]
= . [A(x), F(x,y)]
(d) Y as a fuzzy set B on the y-axis.

B
(y) = max
x
min[
A
(x),
F
(x,y)]
= v
x
[
A
(x) .
F
(x,y)]
B? B = A F
f) Extension principle is a special case of the compositional
rule of inference:



B
x f y
A
y x ( ) max ( )
( )
=
=
1
Fuzzy Reasoning
Given A, A B, infer B

A = today is sunny
A B: day = sunny then sky = blue
infer: sky is blue

illustration

Premise 1 (fact): x is A
Premise 2 (rule): if x is A then y is B

Consequence: y is B
Fuzzy Reasoning
Approximation
A = today is more or less sunny
B = sky is more or less blue
illustration
Premise 1 (fact): x is A
Premise 2 (rule): if x is A then y is B

Consequence: y is B

(approximate reasoning or fuzzy reasoning!)
Fuzzy Reasoning (Approximate Reasoning)
Approximate Reasoning Fuzzy Reasoning

Definition:
Let A, A, and B be fuzzy sets of X, X, and Y,
respectively. Assume that the fuzzy implication
AB is expressed as a fuzzy relation R on XY.
Then, the fuzzy set B induced by x is A' and the
fuzzy rule if x is A then y is B is defined by
B' (y) = max
x
min [
A'
(x),
R
(x,y)]
= v
x
[
A'
(x) .
R
(x,y)]
B' = A' R = A' (AB)

Mamdanis fuzzy implication functions and max-min
composition for simplicity and their wide applicability.
Fuzzy Reasoning (Approximate Reasoning)
Y
x is A
Y
A
X
w
A
B
B
A
X
y is B
Single rule with single antecedent
Rule: if x is A then y is B
Fact: x is A
B'
(y) = [v
x
(
A'
(x) .
A
(x))] .
B
(y)
Conclusion: y is B = w .
B
(y)

Graphic Representation:
Fuzzy Reasoning
Single rule with multiple antecedents
Premise 1 (fact): x is A and y is B
Premise 2 (rule): if x is A and y is B then z is C
Conclusion: z is C
Premise 2: A*B C
| | | |
| | { }
| | { } | |
) z ( ) w (w
) z ( ) y ( ) y ( ) x ( ) x (
) z ( ) y ( ) x ( ) y ( ) x (
) z ( ) y ( ) x ( ) y ( ) x ( ) z (
) C B * A ( ) ' B '* A ( ' C
) z , y , x /( ) z ( ) y ( ) x ( C * ) B * A ( ) C , B , A ( R
C 2 1
C
2 w
B ' B
y
w
A ' A
x
C B A ' B ' A
y , x
C B A ' B ' A
y , x
' C
2 premise 1 premise
C B
Z * Y * X
A mamdani
1
. . =
. . v . . v =
. . . . v =
. . . . v =
=
. . = =
}



Fuzzy Reasoning
A B
T-norm
X Y
w
A B C2
Z
C
Z
X Y
A B
x is A y is B z is C
Fuzzy Reasoning
Multiple rules with multiple antecedents
Premise 1 (fact): x is A and y is B
Premise 2 (rule 1): if x is A1 and y is B1 then z is C1
Premise 3 (rule 2): If x is A2 and y is B2 then z is C2

Consequence (conclusion): z is C
R1 = A1 * B1 C1
R2 = A2 * B2 C2
Since the max-min composition operator o is distributive over
the union operator, it follows:

C = (A * B) o (R1 R2) = [(A * B) o R1] [(A * B) o R2]
= C1 C2

Where C1 & C2 are the inferred fuzzy set for rules 1 & 2
respectively
Fuzzy Reasoning
A1 B1
A2 B2
T-norm
X
X
Y
Y
w1
w2
A
A B
B C1
C2
Z
Z
C
Z
X Y
A B
x is A y is B z is C

You might also like