Download as pdf or txt
Download as pdf or txt
You are on page 1of 44

1 1 EE, DYU EE, DYU

Fuzzy System
Fuzzy System
Lecture 4
Lecture 4
Mu
Mu
-
-
Song Chen
Song Chen
Electrical Engineering,
Electrical Engineering,
Da
Da
-
-
Yeh University
Yeh University
chenms@
chenms@
mail
mail
.dyu.edu.tw
.dyu.edu.tw
H335, 04
H335, 04
-
-
8511888
8511888
-
-
2167
2167
2
Lecture 4
If x= x
i
then y= y
i
(input singletonsand output singletons)
If x
i-1
< x< x
i
then y= f
i
(x) or y= y
i
(input crisp setsand output
singletonsor crisp functions)
Types of Fuzzy Rules
3
Lecture 4
Example
Approximating a crisp function y =f(x) = (x-1)
2
by (1) a set of crisp
rules, (2) a set of interval rules, and (3) a set of fuzzy rules. The 4
exact rules cover only 4 points. The interval rules approximate the
function very roughly as a step function. The four fuzzy rules
approximate the function precisely.
9
1 2 3 4 0
x
1
4
y
crisp rules: If x =1 Then y =0
If x =2 Then y =1
If x =3 Then y =4
If x =4 Then y =9
interval rules : If x s 1 Then y =0
If 1 <x s 2 Then y =1
If 2 <x s 3 Then y =4
If 3 <x s 4 Then y =9
fuzzy rules : If x is about 1 Then y is about 0
If x is about 2 Then y is about 1
If x is about 3 Then y is about 4
If x is about 4 Then y is about 9
4
Lecture 4
If x
i-1
< x< x
i
then yis B(input crisp setsand output fuzzy sets)
If x is A then y = f
i
(x) (input fuzzy sets and output crisp functions,
linear (QLFM) or nonlinear (QNFM)) (TS fuzzy rule)
Types of Fuzzy Rules
5
Lecture 4
If xis Athen yis B(input fuzzy setsand output fuzzy sets)
(Mamdani fuzzy rule)
Types of Fuzzy Rules
6
Lecture 4
Extension Principle(Extend crisp domain to fuzzy domain)
y= f(x)
if x = x
1
then y = y
1
if x = x
2
then y = y
2
...
if x = x
n
then y = y
n
y= f(x)
if x is A
1
then y is B
1
if x is A
2
then y is B
2
...
if x is A
n
then y is B
n
7
Lecture 4
Ais a fuzzy set on X
A=
A
(x
1
)/x
1
+
A
(x
2
)/x
2
++
A
(x
n
)/x
n
The image of A under f( ) is a fuzzy set B
B=f(A) =
A
(x
1
)/y
1
+
A
(x
2
)/y
2
++
A
(x
n
)/y
n
where y
i
= f(x
i
) is a single variablecrisp function, for i = 1,2,,n.
If f( ) is a many-to-one mapping, then
) ( max ) (
) (
1
x y
A
y f x
B
=

=
Extension Principle (f : RR)
Ex : Given f(x) =x
2
- 3 and A =0.1/-2+0.4/-1+0.8/0 +0.9/1 + 0.3/2.
Applying extension principle, we have
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
..\..\NN\note\PPT17\fuller.pdf
8
Lecture 4
Extension principle (for continuous universe)
..\Roger\extensio.m
-3 -2 -1 0 1 2 3
-3
-2
-1
0
1
2
3
X
Y
y =f(x)
0
0.2
0.4
0.6
0.8
1
1.2
M
e
m
b
e
r
s
h
i
p

G
r
a
d
e
s
A
0 0.2 0.4 0.6 0.8 1 1.2
-3
-2
-1
0
1
2
3
Membership Grades
Y
B

s
>
=
0 if ,
0 if , 1 ) 1 (
) (
2
x x
x x
x f

A
(x) =bell(x,1.5,2,0.5)
9
Lecture 4
Suppose that a multi-variable crisp function f is a mapping
from an n-dimensional space X
1
xX
2
xxX
n
to a one-dimensional
universe Y such that y = f(x
1
,x
2
,,x
n
), and suppose A
1
,A
2
,,A
n
are nfuzzy sets in X
1
,X
2
,,X
n
, respectively. Then the extension
principle asserts that the fuzzy set B induced by the mapping f is
defined by
( )
1
1 2
1
, ,..., ( )
1
max min ( ) if ( ) 0
( )
0 if ( ) 0
i
n
A i
i
x x x f y
B
x f y
y
f y

(
=

Extension Principle (f : R
n
R)
If
A
(x), where A = A
1
xA
2
xxA
n
and x = [x
1
,x
2
,,x
n
]
T
, is
known, then

=
=
=

=

0 ) ( if 0
0 ) ( if ) ( max
) (
1
1
) (
1
y f
y f
y
y f
B
x
A
x

10
Lecture 4
f maps ordered pairs from X
1
and X
2
to Y, where X
1
= {-1,0,1}, X
2
= {-
2,2}, Y = {-2,-1,2,3} and y = f(x
1
,x
2
) = x
1
2
+x
2
. If fuzzy sets A
1
= 0.5/-1 +
0.1/0 + 0.9/1, A
2
= 0.4/-2 + 1/2, what isB = f(A
1
,A
2
) ?
Sol :

1 2 1 2
0.9 0.5 0.4 0.4
0.4 0.4
( 1) max min( ( 1), ( 2)),min( (1), ( 2)) 0.4
B A A A A




= =
`


)
_ _ _
_ _
Extension principle

1 2 1 2
0.9 0.5 1 1
0.9 0.5
(3) max min( ( 1), (2)),min( (1), (2)) 0.9
B A A A A




= =
`


)
_ _ _
_ _
x
1

A1
(x
1
)
x
2

A2
(x
2
)
A1xA2
(x1,x2) y=x
1
2
+x
2

B
(y)
-1 0.5 -2 0.4 0.4 -1 0.4
-1 0.5 2 1 0.5 3 0.9
0 0.1 -2 0.4 0.1 -2 0.1
0 0.1 2 1 0.1 2 0.1
1 0.9 -2 0.4 0.4 -1 0.4
1 0.9 2 1 0.9 3 0.9
Thus, B= 0.1/-2 + 0.4/-1 + 0.1/2 +0.9/3
11
Lecture 4
Given X
1
= {a,b,c}, X
2
= {x,y}, Y = {p,q,r}. Fuzzy sets A
1
= 0.3/a +
0.5/b+ 0.9/c, A
2
= 0.5/x+ 1/y. The crisp function f between X
1
xX
2
and Y
is
Extension principle
What is B =f(A
1
,A
2
) ?
Sol :
B
(y= p) = max{min[0.3,0.5], min[0.3,1],min[0.5,1]}= 0.5

B
(y= q) = max{min[0.9,1], min[0.5,0.5]}= 0.9

B
(y= r) = max{min[0.9,0.5]} = 0.5
B= 0.5/p+ 0.9/q+ 0.5/r
X
1
X
2
Y X
1
X
2
Y
a x p b x q
a y p c x r
b y p c y q
12
Lecture 4
Binary Relation
If A and B are two sets and there is a specific property between
elements xof Aand yof B, this property can be described using
the ordered pair (x,y). A set of such (x,y) pairs, xeAand yeB, is
called a relation R.
R= {((x, y),
R
(x, y))|
R
(x, y) > 0, xeA, yeB}
n-aryrelation
For sets A
1
,A
2
,A
3
,...,A
n
, the relation among elements x
1
eA
1
, x
2
eA
2
,..., x
n
eA
n
can be described by n-tuple (x
1
,x
2
,...,x
n
). A
collection of such n-tuples(x
1
,x
2
,...,x
n
) is a relation Ramong A
1
,
A
2
,..., A
n
.
(x
1
,x
2
,x
3
,,x
n
)eRandR_ A
1
A
2
A
3
A
n
Crisp Relation and Fuzzy Relation
13
Lecture 4
Binary Crisp Relation
A
a
1
a
2
a
3
a
4
B
b
1
b
2
b
3
b
4
b
5
1 1 1 3 2 5
3 1 3 4 4 2
( , ), ( , ), ( , )
( , ), ( , ), ( , )
a b a b a b
R
a b a b a b

=
`
)
1 0 1 0 0
0 0 0 0 1
1 0 0 1 0
0 1 0 0 0
R
M
(
(
(
=
(
(

1 1
a Rb
1 3
a Rb
2 5
a Rb
3 1
a Rb
3 4
a Rb
4 2
a Rb
14
Lecture 4
Fuzzy Relation
Fuzzy relation as a mapping from input to output linguistic terms
..\note\PPT18\Robert_Babuska\FUZZY AND NEURAL CONTROL.pdf p.51
15
Lecture 4
Crisp Relation v.s. Fuzzy Relation
Crisp relation R

R
(a,c) = 1,
R
(b,a) = 1,
R
(c,b) = 1 and
R
(c,d) = 1
Fuzzy relation R

R
(a,c) = 0.8,
R
(b,a) = 1.0,
R
(c,b) = 0.9,
R
(c,d) = 1.0
a
b
c
d
0.8
1.0
0.9
1.0
Fuzzy relation
A
A
a b c d
a 0.0 0.0 0.8 0.0
b 1.0 0.0 0.0 0.0
c 0.0 0.9 0.0 1.0
d 0.0 0.0 0.0 0.0

Corresponding fuzzy matrix
a
b
c
d
Crisp relation
1.0
1.0
1.0
1.0
16
Lecture 4
Let X = {NYC,SEL} and Y = {TPE,HKG,PEK} and R = very
close
If Ris a crisp relation, then
If Ris a fuzzyrelation, then
R(x,y) =0.3/(N,T) +0.1/(N,H) +0.1/(N,P) +0.8/(S,T) +0.7/(S,H) +1/(S,P)
Crisp Relation v.s. Fuzzy Relation
R(x,y) =1/(S,T) +1/(S,H) +1/(S,P)
1 1 1
0 0 0
2
1
3 2 1
SEL x
NYC x
PEK HKG TPE
y y y
1 7 . 0 8 . 0
1 . 0 1 . 0 3 . 0
2
1
3 2 1
SEL x
NYC x
PEK HKG TPE
y y y
17
Lecture 4
Representation of Fuzzy Relation
18
Lecture 4
Fuzzy Relation (Approximate Equal)
( ) { }
( , , ( , ) ( , ) ) |
R
x y x y x y R X Y = e
{1,2,3,4,5} X Y U = = =
1 0.8 0.3 0 0
0.8 1 0.8 0.3 0
0.3 0.8 1 0.8 0.3
0 0.3 0.8 1 0.8
0 0 0.3 0.8 1
R
M
(
(
(
= (
(
(
(

1 0
0.8 1
( , )
0.3 2
0
R
u v
u v
u v
u v
otherwise

=

=

19
Lecture 4
A fuzzy relation R is x is
approximately equal to y
Fuzzy Relation (single rule)
A fuzzy relation R is x is
much larger than y
) 0.5( -
1
1

y x
e

+
2
) - ( - y x
e
x x y y
20
Lecture 4
A fuzzy relation Ris a 2-D MF
R= {((x,y),
R
(x,y) | (x,y)eXxY}
xis close to y(xand yare numbers)
xdepends on y(xand yare events)
xand ylook alike (xand yare persons or objects)
Ex : Let X={3,4,5} and Y={3,4,5,6,7}and R = yis much larger than
x. The MF of fuzzy relation Rcan be defined as
Fuzzy Relations
, if
2 ( , )
0, if
R
y x
y x
x y x y
y x

>

+ + =

The fuzzy relation matrix Ris


(
(
(

=
143 . 0 077 . 0 0 0 0
231 . 0 167 . 0 091 . 0 0 0
333 . 0 273 . 0 200 . 0 111 . 0 0
R
3
4
5
21
Lecture 4
Fuzzy Relation
If O
2
flow rate is LOWthen heating power is LOW
If O
2
flow rate is OK then heating power is HIGH
If O
2
flow rate is HIGHthen heating power is LOW
What is the fuzzy relation Rbetween O
2
and heating power ?
What is heating power when O
2
is a little bit LOW? (GMP)
..\note\PPT15\fuzzymath.pdf
22
Lecture 4
A fuzzy relation Ris x is approximately equal to y
-3 -2 -1 0 1 2 3
0
0.5
1
Antecedent A
-3 -2 -1 0 1 2 3
0
0.5
1
consequent B
Fuzzy Relation (single rule)
..\Demo\imp1.m ../note/PPT14/ee481-08.pdf ..\Example\Ex_RulseBase.ppt
If xis about zerothen
yis about zero
23
Lecture 4
A fuzzy relation Ris x is approximately equal to y, using 5 rules
-3 -2 -1 0 1 2 3
0
0.5
1
Antecedent A
-3 -2 -1 0 1 2 3
0
0.5
1
consequent B
Fuzzy Relation (multiple rules)
..\Demo\imp2.m
If xis about -2then yis about -2
If xis about -1then yis about -1
If xis about 0then yis about 0
If xis about 1then yis about 1
If xis about 2then yis about 2
24
Lecture 4
Fuzzy Relation (multiple rules)
25
Lecture 4
Modus Ponens I nference Rule
Implication : If xis Athen yis B
Premise : xis A'
Conclusion : yis B'
Implication : If an apple is redthen the apple is ripe
Premise : This apple is very red
Conclusion : This apple is very ripe
Implication : xand yare approximately equal
Premise : xis little
Conclusion : yis more or less little
26
Lecture 4
Modus Ponens I nference Rule
The Modus Ponens deduction is used as a tool for inferencing
in rule-based systems.
A typical IFTHEN rule is used to determine whether an
antecedent (cause or action) infers a consequent (effect or
action). Suppose we have a rule of the form
( ) ( ) If then R A B A Y A B =
This rule could be translated into a relation using the Cartesian
product sets Aand B, that is
) (where Then
) (where If
Y Y, B y B y
X X, A x A x
c e e
c e e
B A then If
where AxBand Y Ax are Cartesian product
Y
B
A
X
27
Lecture 4
Modus Ponens I nference Rule
Now suppose a new antecedent, say A', is known. Can we use
Modus Ponens deduction to infer a new consequent, say B',
resulting from the new antecedent ? i.e.
If Athen BIf A' thenB'
where B' can be found through the following set-theoretic
formulation,
(( ' ) ' ) ' ) ( R A B A A B A Y = =
( )
( )
( ) ( )
If then If then
R A B A C
A B A C
=

Modus Ponens deduction can also be used for the compound


rule, If A then B elseC. Using the relation defined as
Y
C
B
A
X
and B' = A'R
28
Lecture 4
Two ways to interpret If xis Athen yis B, A B
Fuzzy Relation
A coupled with B
A A
B B
A entails B
y
x x
y
Fuzzy conjunction
it is true that A and B simultaneously hold
Fuzzy implication
if A holds, B must hold as well for the implication to be
true. Nothing can, however, be said about B when A does
not hold, and the relationship also cannot be inverted.
A B
( ) ( ) A B A Y
29
Lecture 4
Minimum implication or Mamdanianimplication, R
m
Algebraic product implication or Larsenimplication, R
p
Bounded product implication, R
bp
Drastic product implication, R
dp
Fuzzy Relation, A coupled with B
{ }
}
. = =
XxY
B A m
y x y x B A R ) , /( ) ( ) ( x
{ }
}
= =
XxY
B A p
y x y x B A R ) , /( ) ( ) ( x
( ) { }
}
+ v = =
XxY
B A bp
y x y x B A R ) , /( 1 ) ( ) ( 0 x
{ }
}
- = =
XxY
B A dp
y x y x B A R ) , /( ) ( ) ( x

) , /( ) ( ) (
~
y x y x B A B A R
B A
- = = =
}
T-norm
30
Lecture 4
( ) { } ) , /( ) ( ) ( 1 1 y x y x B A R
XxY
B A a }
+ . = =
( ) ( ) ( ) { } ) , /( ) ( ) ( ) ( 1 y x y x x B A A R
XxY
B A A mm }
. v = =
( ) { }
}
v = =
XxY
B A s
y x y x B A R ) , /( ) ( ) ( 1
) , /( ) ( ) (
~
y x y x R
XxY
B A }
)
`

< =
A

Material implication (or Zadehimplication), R
a
Propositional calculus, R
mm
Extended propositional calculus, R
s
Generalization of modus ponens, R
A
Fuzzy Relation, A entails with B
31
Lecture 4
..\Roger\fuzimp.m
A coupled with B v.s. A entails B
A entails B
A coupled with B
32
Lecture 4
Crisp Relation (Propositional calculus, R
mm
)
Let two universes of discourse be described by X={1,2,3,4} and
Y={1,2,3,4,5,6} and define the crisp set A={2,3} on X and B={3,4}
on Y. Determine the deductive inference IF ATHEN B.
Sol : Expressing the crisp sets in fuzzy notation
0 0 0 0 0 0

0

1 2 3 4 1 2 3 4 5 6 1 2 3 4 1 2 3
1 1 0 1 1 1 1 1 1 1 1 1 1
4 5 6
A B A Y = + + + = + + + + + = + + + = + + + + +
Taking the Cartesian product AxBand
The deductive inference yields
Y A
0 0 0 0 0 0 0 0 1 1 0 0
0 0 0 0 0 0
1 1 1 1 1 1 0 0 1 1 0 0
( ) ( ) 0 0 1 1 0 0
1 1 1 1 1 1 0 0 1 1 0 0
1
2
3 0 0 1 1 0 0
0 0 0 0 0 0 0 0 1 1 0 0
0 0 0 0 0 0 4
1 2 3 4 5 6
A B
x y
( (
(
( (
(
( (
. = =
(
( (
(
( (
(

1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1
0 0 0 0 0 0 1 1 1 1 1 1
( ) ( ) 0 0 0 0 0 0
0 0 0 0 0 0 1 1 1 1 1 1
1
2
3 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 4
1 2 3 4 5 6
Y A
x y
( (
(
( (
(
( (
. = =
(
( (
(
( (
(

0 0 0 0 0 0 1 1 1 1 1 1
1 1 1 1 1 1
0 0 1 1 0 0 0 0 0 0 0 0
( ) ( ) 0 0 1 1 0 0
0 0 1 1 0 0 0 0 0 0 0
1 2 3 4 5
1
2
3
0
0 0 1 1 0 0
0 0 0 0 0 0 1 1 1 1 1 1
1 1 1 1 1 1
6
4
R A B A Y
( (
(
( (
(
( (
= = =
(
( (
(
( (
(


33
Lecture 4
Fuzzy Relation (Propositional calculus, R
mm
)
Consider two universes of discourse described by X={1,2,3,4} and
Y={1,2,3,4,5,6}. Let two fuzzy sets Aand Bbe given by

1 2 3 4 1
0 0.8 1 0.3 0 0.4 1
2 3 4 5 6
0.6 0.2 0
A B = + + + = + + + + +
find a fuzzy relation Rcorresponding to If A then B.
Sol : Expressing fuzzy notation in Propositional calculus, R
mm
and hence } ' , max{ Y A B A R =
0 0 0 0 0 0 1 1 1 1 1 1

1 2 3 4 5 6 1 2 3 4 5
1 1
2 2
3 3
4 4
0 0.4 0.8 0.6 0.2 0 0.2 0.2 0.2 0.2 0.2 0.2
0 0.4 1 0.6 0.2 0 0 0 0 0 0 0
0 0.3 0.3 0.3 0.2 0 0.7 0.7 0.7 0.7 0.7 0.7
6
A B A Y
( (
( (
= =
( (
( (
( (

1 1 1 1 1 1
0.2 0.4 0.8 0.6 0.2 0.2
0 0.4 1 0.6 0.2 0
0.7
1 2
0.7 0.7 0.
3 4 5 6
7 0.7 0.7
1
2
3
4
R
(
(
=
(
(
(

a=[0.0 0.8 1 0.3]';
b=[0 0.4 1 0.6 0.2 0];

a_len= length(a); b_len= length(b); II = ones(1,b_len)

A = repmat(a,1,b_len); B = repmat(b,a_len,1);
AB = min(A,B)
A_bar = repmat(1-a,1,b_len); II = repmat(II,a_len,1);
A_bar_Y = min(A_bar,II);
max(AB,A_bar_Y)
35
Lecture 4
Given rule If xis Athen yis B, where
A= .1/x
1
+.4/x
2
+.7/x
3
+ 1/x
4
and B = .2/y
1
+ .5/y
2
+ .9/y
3
Acoupled with B
for Mamdanianimplication
..\Demo\m_file\single_rule_rel.m
Fuzzy Relation (R
m
and R
a
)
Aentails B
for Zadehimplication
.9 .2 .9 .5 .9 .9 1 1 1 1 1 1
.6 .2 .6 .5 .6 .9 1 1 1 .8 1 1

.3 .2 .3 .5 .3 .9 1 1 1 .5 .8 1
0 .2 0 .5 0 .9 1 1 1 .2 .5 .9
+ + +
( ( (
( ( (
+ + +
( ( (
=
( ( ( + + +
( ( (
+ + +


9 . 5 . 2 .
7 . 5 . 2 .
4 . 4 . 2 .
1 . 1 . 1 .
9 . 5 . 2 .
9 . 5 . 2 .
9 . 5 . 2 .
9 . 5 . 2 .
1 1 1
7 . 7 . 7 .
4 . 4 . 4 .
1 . 1 . 1 .
(
(
(
(

=
(
(
(
(

(
(
(
(

x
1
x
2
x
4
y
1
y
2
y
3
x
3
) , /( )) ( ) ( 1 ( 1 y x y x
B A B A R
B A
a
+ . =
= =
}

{ }
}
. =
= =
) , /( ) ( ) ( y x y x
B A B A R
B A
m

a=[.1 .4 .7 1]'; b=[.2 .5 .9];
a_len= length(a); b_len= length(b);
II = ones(1,b_len);
A = repmat(a,1,b_len); B = repmat(b,a_len,1);
min(A,B)
%%%%%%%%%%%%%%%%%%%%
A_bar = repmat(1-a,1,b_len); A_bar_B = A_bar+B;
II = repmat(II,a_len,1);
min(A_bar_B,I I )
37
Lecture 4
The max-mincomposition of two fuzzy relations R
1
(defined on X
and Y) and R
2
(defined on Y and Z) is
)] , ( ) , ( [ ) , (
2 1 2 1
z y y x z x
R R
y
R R
. v =

Rule Composition: Max-Min and Max-Product
Max-product composition
)] , ( ) , ( [ ) , (
2 1 2 1
z y y x z x
R R
y
R R
v =

In general, we have max-* composition (where * is T-norm


operation)
)] , ( * ) , ( [ ) , (
2 1 2 1
z y y x z x
R R
y
R R
v =

Properties
Associativity: R(ST) =(RS)T
Distributivityover union: R(ST) =(RS) (RT)
Week distributivityover intersection: R(ST) _ (RS) (RT)
Monotonicity: S _ T RS_ RT
..\book\dispf.pdf p.21
38
Lecture 4
Max-Min Composition
A fuzzy relation defined on Xan Z.
X Y Z
R : fuzzy relation defined on Xand Y.
S : fuzzy relation defined on Y and Z.
RS : the composition of Rand S.
( )
( )
( , ) maxmin ( , ), ( , )
( , ) ( , )
R S R S
y
y R S
x z x z
x z
y y
y y


=
= v .

39
Lecture 4
Example : Max-Min Rule Composition
1 0.1 0.2 0.0 1.0
2 0.3 0.3 0.0 0.2
3 0.8 0.9 1.0 0.4
R a b c d
0.9 0.0 0.3
0.2 1.0 0.8
0.8 0.0 0.7
0.4 0.2 0.3
S
a
b
c
d
o |
0.1 0.2 0.0 1.0
0.9 0.2 0.8 0.4 min
0.1 0.2 0.0 0.4 max
1 0.2 0.3
2 0.3 0.3 0.3
3 0.8 0.9 0.
0.4
8
R S o |
40
Lecture 4
Consider two fuzzy relations R = xis considerable smaller than y
and G= yis very close to z
Rule Composition : Max-min composition
The composition of Rand Gis nothing else, but the classical product of the
matrices R and G with the difference that instead of addition we use
maximumand instead of multiplication we use minimum operator.
Max-min
composition
R =[.5 .1 .1 .7;
0 .8 0 0;
.9 1 .7 .8]
G=[.4 .9 .3;
0 .4 0;
.9 .5 .8;
.6 .7 .5]
[R_rowR_col] =size(R); [G_rowG_col] =size(G);
RG =[];
for i=1:R_row
for j=1:G_col
RG(i,j) = max(min(R(i,:),G(:,j)'));
end
end
41
Lecture 4
42
Lecture 4
Max-Product Composition
( )
( , ) max ( , ) ( , )
R S R
y
S
y x x y z z =

A fuzzy relation defined on X an Z.


X Y Z
R : fuzzy relation defined on X and Y.
S : fuzzy relation defined on Y and Z.
RS : the composition of R and S.
43
Lecture 4
Let R
1
=xis relevant to y and R
2
=yis relevant to z be two
fuzzy relations defined on X*Y and Y*Z, where X={1,2,3},
Y={o,|,,o}, and Z={a,b}.
..\Demo\m_file\rules_comp.m
Max-min and max-product composition
1 2
(2, ) max(.4*.9,.2*.2,.8*.5,.9*.7) max(.36,.04,.40,.63)
.63 (b max product co y mpositi ) on
R R
a

= =
=

0.9 1
0.63 0.48
0.54 0.6
(
(
(
(

1 2
(2, ) max(.4 .9,.2 .2,.8 .5,.9 .7)
max(.4,.2,.5,.7) . max 7 (by min composition)
R R
a = . . . .
= =

0.9 1
0.7 0.6
0.6 0.6
(
(
(
(

1 2
0.9 1
1 1 0.3 0.5 0.7
0.2 0.3
2 0.4 0.2 0.8 0.9
0.5 0.6
3 0.6 0.8 0.3 0.2
0.7 0.2
a b
R R
o | o
o
|

(

(

(

(

(

(
= =

(
(

(
(

(
(


(

R1 =[1 .3 .5 .7; .4 .2 .8 .9; .6 .8 .3 .2]; R2 =[.9 1; .2 .3; .5 .6; .7 .2];


[R_row R_col] =size(R1); [G_row G_col] =size(R2);
RG =[];
for i=1:R_row
for j=1:G_col
RG(i,j) =max(min(R1(i,:),R2(:,j)'));
end
end
fprintf('max-min\n');
RG
RG =[];
for i=1:R_row
for j=1:G_col
RG(i,j) =max(R1(i,:).*R2(:,j)');
end
end
fprintf('max-product\n');
RG
44
Lecture 4

You might also like