Fuzzy Relations and Reasoning

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
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)  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:

 yx
 , if y  x
 R ( x, y )   x  y  2
 0 , if y  x

if X = {3,4,5} & Y = {3,4,5,6,7}
Extension Principle
The image of a fuzzy set A on X
A   A ( x1 ) / x1   A ( x 2 ) / x 2     A ( x n ) / x n

under f(.) is a fuzzy set B:


B   B ( x1 ) / y 1   B ( x 2 ) / y 2     B ( x n ) / y n
where yi = f(xi), i = 1 to n
If f(.) is a many-to-one mapping, then
 B ( y )  max  A ( x )
x  f 1 ( y )
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
R1 (defined on X and Y) and R2 (defined on Y and
Z) is
 R1 R2 ( x , z )  [ R1 ( x , y )   R2 ( y , z )]
y
Properties:
– Associativity: R  (S  T )  ( R  S )  T
R  ( S T )  ( R  S ) ( R  T )
– Distributivity over union:

– Week distributivity over intersection:


R  ( S T )  ( R  S ) ( R  T )
– Monotonicity:
S  T  (R  S)  (R T )
Max-Star Composition
• Max-product composition:
 R1 R2 ( x , z )  [ R1 ( x , y ) R2 ( y , z )]
y
• In general, we have max-* composition:
 R1 R2 ( x , z )  [ R1 ( x , y ) *  R2 ( y , z )]
y
where * is a T-norm operator.
Example of max-min & max-
product composition
Let R1 = “x is relevant to y”
R2 = “y is relevant to z”
be two fuzzy relations defined on XY and
YZ respectively :X = {1,2,3}, Y = {,,,}
and Z = {a,b}. Assume that:
0.9 0.1 
0.1 0.3 0.5 0.7  0.2 0.3 
R 1  0.4 0.2 0.8 0.9 R2   
  0.5 0.6 
0.6 0.8 0.3 0.2  
0.7 0.2
R1oR2 may be interpreted as the derived fuzzy
relation “x is relevant to z” based on R1 & R2
Let’s assume that we want to compute the
degree of relevance between 2  X & a  Z
Using max-min, we obtain:
 R1 R 2 ( 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
Using max-product composition, we obtain:
 R1 R 2 ( 2, a )  max 0.4 * 0.9,0.2 * 0.2,0.8 * 0.5,0.9 * 0.7
 max 0.36,0.04,0.40,0.63
 0.63
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(.)

A k   [ A ( x )]k / x
X
– 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
Linguistic variables
– Composite linguistic terms
NOT( A )  A   [1   A ( x)] / x,
X
– Let’s define: A and B  A  B   [ A ( x )   B ( x )] / x
X

A or B  A  B   [ A ( x )   B ( x )] / x
X

– 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
Linguistic variables 1
 (...) ( x )  bell ( x,  , k ,  ) 
2k
x
– Example: Construction of MFs for composite 1  
  
linguistic terms. Let’s define
1
 young ( x )  bell ( x,20,2,0)  4
 x 
1  
 20 
1
 old ( x )  bell ( x,30,3,100)  6
 x  100 
1  
 30 
– Where x is the age of a person in the universe of
discourse [0,100]
1
 6
/x
• More or less = DIL(old) = old = X  x  100 
1  
 30 
Linguistic variables
• Not young and not old = young  old =
   
   
1  1   1  1 /x
 4   x  100  
6
X  x 
 1      1    
  20     30  

• Young but not too young = young  young2 (too =


very) =   
 


 
 
2

1   1   1  
     /x
 x   
4 4
x   x   
1      1   20  
  20         

• Extremely old  very very very old = CON


(CON(CON(old))) =  
8

 
 1 
 6
/x
x  x  100 
1    
  30  
Linguistic variables
– Contrast intensification
– the operation of contrast intensification on a
linguistic value A is defined by

 2 A 2
if 0   A ( x )  0.5
INT( A )  
2

  2(  A ) if 0.5   A ( x )  1

• 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
Linguistic variables
– Orthogonality
• A term set T = t1,…, tn of a linguistic variable x on the
universe X is orthogonal if:
n
  t i ( x)  1, x  X
i 1

• Where the ti’s are convex & normal fuzzy sets


defined on 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
Two ways to interpret “If x is A then y is B”:

A coupled with B A entails 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)
Rm  A * B  
X *Y
A ( x )   B ( y ) /( x, y )

(minimum operator proposed by Mamdani, 1975)

Rp  A * B    A (x)  B (y ) /( x, y )
X*Y
(product proposed by Larsen, 1980)
R bp  A * B    A ( x )   B ( y ) /( x, y )
X* Y

  0  ( A ( x )   B ( y )  1) /( x, y )
X* Y

(bounded product operator)


Fuzzy if-then rules
• Fuzzy implication function:  R ( x, y )  f (  A ( x ),  B ( y ))  f ( a, b)

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


A coupled with B
Fuzzy if-then rules
– Case of “A entails B” (not A or B)
R a  A  B   1  (1   A (x)   B (y ) /(x, y )
X*Y
where : f a (a, b )  1  (1  a  b )
(Zadeh’s arithmetic rule by using bounded sum
operator for union)

R mm  A  ( A  B)   (1   A (x))  ( A (x)   B (y )) /(x, y )


X*Y
where : f m (a, b)  (1  a)  (a  b)
(Zadeh’s max-min rule)
Fuzzy if-then rules
R s  A  B   (1   A (x))   B ( y ) /(x, y )
X*Y
where : f s (a, b )  (1  a)  b
(Boolean fuzzy implication with max for union)
~  ( y )) /( x, y )
R   A
(  ( x )  B
X* Y

~ 1 if a  b
where : a  b  
b / a otherwise
(Goguen’s fuzzy implication with algebraic product for T-norm)
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):
y y

b b

y = f(x) y = f(x)

a x x
a
a and b: points
a and b: intervals
y = f(x) : a curve
y = f(x) : an interval-valued
function
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:

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


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) = maxx min[A(x), F(x,y)]
= x [A(x)  F(x,y)]
B? B = A  F
f) Extension principle is a special case of the compositional
rule of inference:
 B ( y )  max
1
 A( x)
x f ( y)
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
AB is expressed as a fuzzy relation R on XX.
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) = maxx min [A (x), R (x,y)]
= x [A (x)  R (x,y)]
 B = A  R = A  (AB)

Mamdani’s fuzzy implication functions and max-min


composition for simplicity and their wide applicability.
Fuzzy Reasoning (Approximate Reasoning)
• Single rule with single antecedent
– Rule: if x is A then y is B
– Fact: x is A’ B (y) = [x (A (x)  A (x))]  B (y)
– Conclusion: y is B’ = w  B (y)

• Graphic Representation:

A’ A B
w
X Y
A’
B’

X Y
x is A’ y is B’
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

R mamdani ( A , B, C)  ( A * B ) * C    ( x )  ( y )   ( z ) /( x, y , z )
A B C
X* Y* Z

C'  ( A'*B' )  ( A * B  C)
       
premise 1 premise 2

 C' ( z )  
x ,y
  A ' ( x )   B ' ( y )     A ( x )   B ( y )   C ( z )
    A ' ( x )   B ' ( y )   A ( x )   B ( y )    C ( z )
   
x ,y

 x
  A ' ( x )   A ( x)  y   B ' ( y )   B ( y )   C ( z )
               
w1 w2

 (w 1  w 2 )   C ( z )
Fuzzy Reasoning
T-norm
A’ A B’ B C2

Z
X Y

A’ B’
C’

Z
x is A’ X y is B’ Y 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]
= C’1  C’2

Where C’1 & C’2 are the inferred fuzzy set for rules 1 & 2
respectively
Fuzzy Reasoning
A’ A1 B’ B1 C1

w1
Z
X Y
A’ A2 B’ B2 C2
w2

Z
X Y
T-norm
A’ B’
C’
Z
x is A’ X y is B’ Y z is C’

You might also like