0% found this document useful (0 votes)
2 views

Lecture_3

Uploaded by

aryanbsk12
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lecture_3

Uploaded by

aryanbsk12
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 51

Fuzzy Relations

01/04/2025 1 / 64
Soft Computing 1 / 64
Crisp relations

It is better to discuss the first crisp relation.


Suppose X and Y are two (crisp) sets. Then Cartesian product,
denoted as X × Y, is a collection of order pairs such that
X× Y = { (x, y)|x ∈ X and y ∈ Y}

Note :
(1) X × Y /= Y× X
(2) |X × Y| = |X| × |Y|
(3) X × Y provides a mapping from x ∈ X to y ∈ Y.

The mapping so mentioned is called a relation.

01/04/2025 2 / 64
Soft Computing 2 / 64
Crisp
relations
Example 1:
Consider the two crisp sets, A and B, as given below. A ={ 1, 2, 3, 4}
B = {4, 5, 6 }.
Then, A× B = {(1, 4), (1, 5), (1, 6), (2, 4), (2, 5), (2, 6), (3, 4), (3, 5),
(3, 6), (4, 4), (4, 5), (4, 6)}
Let us define a relation R as R = {(a, b)|b = a + 1, (x, y) ∈ A × B }
Then, R = { (3, 4), (4, 5)} in this case.
We can represent the relation R in a matrix form as follows.
𝜒 𝑋×𝑌 (𝑥, 𝑦) = 1,(𝑥, 𝑦) ∈ A × B
0, (𝑥, 𝑦) ∉ A × B

01/04/2025 3 / 64
Soft Computing 15.01.201 3 / 64
Operations on crisp
relations
Suppose R(x, y ) and S(x, y ) are the two relations define over two crisp
sets x ∈ X and y ∈ Y
Union:

R(x, y ) ∪ S(x, y ) = max (R(x, y ), S(x, y ));

Intersection:

R(x, y ) ∩ S(x, y ) = min(R(x, y ), S(x, y ));

Complement:

R(x, y ) = 1 − R(x, y )

01/04/2025 4 / 64
Soft Computing
Example: Operations on crisp
relations
Example:
Suppose R(x, y ) and S(x, y ) are the two relations defined over two
crisp sets x ∈ X and y ∈ Y

Find the
following:
1 R∪S
2 R∩S
3 R

01/04/2025 5 / 64
Soft Computing
CompositioComposition of Classical Relations
Given R is a relation ontwo
n of X ,Y,crisp
and Srelations
is another relation on Y,Z . Then R ◦
S is called a composition of relation on X and Z which is defined as
follows.

R ◦ S = {(x, z)|(x, y ) ∈ R and (y, z) ∈ S and ∀y ∈ Y }

Max-Min Composition
Given the two relation matrices R and S, the max-min composition is
defined as T = R ◦ S ;

T (x, z) = max {min{R(x, y ), S(y, z) and ∀y ∈ Y } }

01/04/2025 6 / 64
Soft Computing
Example:
Given X = {1, 2, 4}; Y = {1, 2, 5}; R = {(x, y )|y = x + 1}; S = {(x, y )|x <
y } Here, R and S is on X × Y
R = { (1, 2), (4, 5)}
S = { (1, 2), (1, 5), (2, 5), (4,5)}

01/04/2025 7 / 64
Fuzzy Relation

• Fuzzy relation is a fuzzy set defined on the Cartesian


product of crisp set X1, X2, ..., Xn
• Here, n-tuples (x1, x2, ..., xn) may have varying
degree of memberships within the relationship.
• The membership values indicate the strength of the
relation between the tuples.

01/04/2025 8 / 64
Example of fuzzy relation
Suppose
A is a fuzzy set on the universe of discourse X with µA(x )|x ∈ X
B is a fuzzy set on the universe of discourse Y with µB (y )|y ∈ Y
Then R = A × B ⊂ X × Y ; where R has its membership function given
by µR (x, y ) = µA×B (x, y ) = min{ µA (x ), µB (y )}
Example :

A = {(a 1 , 0.3), (a2, 0.8), (a3, 0.7)}and B = {(b 1 , 0.5), (b2, 0.6), ( b3,
0.4 }
R=A× B=

01/04/2025 9 / 64
Soft Computing
Operations on Fuzzy
relations
Let R and S be two fuzzy relations on A × B.
Union:

µR∪S (a, b) = max { µR (a, b), µS (a, b)}

Intersection:

µR∩S (a, b) = min{ µR (a, b), µS (a, b)}

Complement:

µR (a, b) = 1 − µR (a, b)

Composition

T =R◦S
01/04/2025
µR◦S = maxy ∈Y { min(µR (x, y ), µS (y, z))} 10 / 64
Soft Computing
Example

01/04/2025 11 / 64
Example 2

01/04/2025 12 / 64
Fuzzy Propositions

13 /
Soft Computing 01/04/202
Two-valued logic vs. Multi-valued logic

The basic assumption upon which crisp logic is based - that every
proposition is either TRUE or FALSE.

The classical two-valued logic can be extended to multi-valued


logic.

As an example, three valued logic to denote true(1), false(0) and


indeterminacy (1/2)

14 /
Soft Computing 01/04/202
Two-valued logic vs. Multi-valued logic

Different ooperations with three-valued logic can be extended, as shown in


the following truth table:
a b ∧ ∨ ¬a =⇒ =
0 0 0 0 1 1 1
1 1 1
0 2 0 2 1 1 2
0 1 0 1 1 1 0
1 1 1 1 1
2 0 0 2 2 2 2
1 1 1 1 1 1
2 2 2 2 2 2 1
1 1 1 1
2 1 2 1 2 1 2
1 0 0 1 1 0 0
1 1 1 1
1 2 2 1 1 2 2
1 1 1 1 1 1 1

Fuzzy connectives used in the above table are:


AND (∧), OR (∨), NOT (¬), IMPLICATION (=⇒) and EQUAL (=).

15 /
Soft Computing 01/04/202
Three-valued logic
Fuzzy connectives defined for such a three-valued logic better can be stated
as follows:
Symbol Connective Usage Definition
¬ NOT ¬P 1 − T (P)
∨ OR P∨Q max{T(P), T(Q) }
∧ AND P∧Q min{ T(P),T(Q) }
=⇒ IMPLICATION (P =⇒ Q) or max{(1 - T(P)),
(¬P ∨ Q) T(Q) }
= EQUALITY (P = Q) or 1 − |T (P) − T (Q)|
[(P =⇒ Q) ∧
(Q =⇒ P)]

16 /
Soft Computing 01/04/202
Fuzzy proposition
Example 1:
P : X is honest

1 T(P) = 0.0 : Absolutely false


2 T(P) = 0.2 : Partially false
3 T(P) = 0.4 : May be false or not false
4 T(P) = 0.6 : May be true or not true
5 T(P) = 0.8 : Partially true
6 T(P) = 1.0 : Absolutely true.

17 /
Soft Computing 01/04/202
P : A is efficient ; T(P) = 0.8;
Q : B is efficient ; T(Q) = 0.6

1 B is not efficient.
T (¬P) = 1 − T (P) = 0.2
2 B is efficient and so is Ram.
T (P ∧ Q) = min{T (P), T (Q)} = 0.6
3 Either B or A is efficient
T (P ∨ Q) = max T (P), T (Q) = 0.8
4 If B is efficient then so is A
T (P =⇒ Q) = max {1 − T (P), T (Q)} = 0.6

18 /
Soft Computing 01/04/202
Fuzzy proposition vs. Crisp proposition

The fundamental difference between crisp (classical) proposition and


fuzzy propositions is in the range of their truth values.

While each classical proposition is required to be either true or false,


the truth or falsity of fuzzy proposition is a matter of degree.

The degree of truth of each fuzzy proposition is expressed by a value


in the interval [0,1] both inclusive.

19 /
Soft Computing 01/04/202
Fuzzy
Implications

20 /
Soft Computing 01/04/202
Fuzzy rule
A fuzzy implication (also known as fuzzy If-Then rule, fuzzy rule, or
fuzzy conditional statement) assumes the form :

If x is A then y is B

where, A and B are two linguistic variables defined by fuzzy sets A


and B on the universe of discourses X and Y , respectively.

Often, x is A is called the antecedent or premise, while y is B is


called the consequence or conclusion.

21 /
Soft Computing 01/04/202
Fuzzy implication : Example 1

If pressure is High then temperature is Low

If mango is Yellow then mango is Sweet else mango is Sour If

road is Good then driving is Smooth else traffic is High

The fuzzy implication is denoted as R : A → B

In essence, it represents a binary fuzzy relation R on the


(Cartesian) product of A × B

22 /
Soft Computing 01/04/202
Fuzzy implication : Example 2
Suppose, P and T are two universes of discourses representing
pressure and temperature, respectively as follows.

P = { 1,2,3,4} and T ={ 10, 15, 20, 25, 30, 35, 40, 45, 50 }

Let the linguistic variable High temperature and Low pressure are given
as

THIGH =
{(20, 0.2), (25, 0.4), (30, 0.6), (35, 0.6), (40, 0.7), (45, 0.8), (50, 0.8)}

PLOW = (1, 0.8), (2, 0.8), (3, 0.6), (4, 0.4)

23 /
Soft Computing 01/04/202
Fuzzy implications: Example 2

01/04/2025 24 / 64
Interpretation of fuzzy rules

In general, there are two ways to interpret the fuzzy rule A → B as A


coupled with B

A entails B

01/04/2025 25 / 64
Soft Computing
Interpretation as A coupled with B

R:A→B=A×B X µA(x ) ∗ µB (y )|(x,y ) ; where ∗ is
= ×Y called a
T-norm operator.
T-norm operator
The most frequently used T-norm operators are:
Minimum : Tmin(a, b) = min(a, b) = a ∧ b Algebric
product : Tap (a, b) = ab
Bounded product : Tbp (a, b) = 0 ∨ (a + b − 1)
a if b=
Drastic product : Tdp = b 1
if a=1
0 if a, b < 1
Here, a = µA(x ) and b = µB (y ). T∗ is called the function of T-norm operator.

26 /
Soft Computing 01/04/202
Interpretation as A coupled with B

Based on the T-norm operator as defined above, we can automatically define


the fuzzy rule R : A → B as a fuzzy set with two-dimentional MF:
µR (x, y ) = f (µA(x ), µB (y )) = f (a, b) with a=µA(x ) , b=µB (y ), and f is
the fuzzy implication function.

01/04/2025 27 / 64
Soft Computing
Interpretation as A coupled with B
In the following, few implications of R : A → B

Min operator:
Rm = A × B = ∫X µA (x ) ∧ µB (y )|
(x,y ) or min(a, b) = a ∧
×Y f [Mamdanib rule]

Algebric product operator



Rap = A × B X µA(x ).µB or f (a, b) =
(x,y ) ap
= ×Y (y )| ab
[Larsen rule]

28 /
Soft Computing 01/04/202
Product Operators
Bounded product operator

Rbp = A × B = X ×Y µA(x ) ⊙ µB (y )|(x,y )
=

X ×Y 0 ∨ (µA(x ) + µB (y ) − 1)|(x,y )

or fbp = 0 ∨ (a + b − 1)


Drastic product
 a operator
if b=
1∫
or f = A × B = X ×Y µAa(x=)ˆ•µB (y )|(x,y )
Rdp dp (a, b) = b if
1 0 if otherwise

29 /
Soft Computing 01/04/202
Product Operators

01/04/2025 30 / 64
Interpretation of A entails B
There are three main ways to interpret such implication:
Material implication :

R : A → B = A¯ ∪ B

Propositional calculus :

R : A → B = A¯ ∪ (A ∩ B)

Extended propositional calculus :

R : A → B = (A¯ ∩ B¯ ) ∪ B

31 /
Soft Computing 01/04/202
With the above mentioned implications, there are a
number of fuzzy implication functions that are popularly
followed in fuzzy rule-based system.

Zadeh’s arithmetic rule :



Rza = ¯A ∪ B X 1 ∧ (1 − µA(x ) + µB (y(x,y
=
or ×Y ))| )

fza(a, b) = 1 ∧ (1 − a +
b)

∫ :
Zadeh’s¯ max-min rule
Rmm = A ∪ (A ∩ B) X (1 − µA(x )) ∨ (µA(x ) B (y ))
=
or ×Y ∧ µ | )
(x,y

fmm(a, b) = (1 − a) ∨(a ∧
b)
32 /
Soft Computing 01/04/202
Interpretation of A entails B

01/04/2025 33 / 64
Interpretation of A entails B
Boolean fuzzy rule

Rbf = ¯A ∪ B ∫X (1 − µA(x )) ∨ µB (x )|
=
or ×Y
(x,y )
fbf (a, b) = (1 − a) ∨
b;

Goguen’s fuzzy rule: 1 if a≤



Rgf = X µA(x ) ∗ µB (y( )|
, )
x y where a ba if a>
×Y b
∗b= b

34 /
Soft Computing 01/04/202
Example 3: Zadeh’s Max-Min rule

•If x is A then y is B with the implication of Zadeh’s max-min rule can be


written equivalently as :

• Rmm = (A × B) ∪ (A¯ × Y )

•Here, Y is the universe of discourse with membership values for all


•y ∈ Y is 1, that is , µY (y ) = 1∀y ∈ Y.
•Suppose X = {a, b, c, d } and Y = {1, 2, 3, 4}
•and A = {(a, 0.0), (b, 0.8), (c, 0.6), (d, 1.0)}
•B = {(1, 0.2), (2, 1.0), (3, 0.8), (4, 0.0)} are two fuzzy sets.

•We are to determine Rmm = (A × B) ∪ (A¯ × Y )


35 /
Soft Computing 01/04/202
Example 3: Zadeh’s min-max rule:

01/04/2025 36 / 64
Example 3: Zadeh’s min-max rule:

Therefor
e,

Rmm = (A × B) ∪ (A¯ × Y
)=

37 /
Soft Computing 01/04/202
Example

01/04/2025 38 / 64
Example:

01/04/2025 39 / 64
Example

IF x is A THEN y is B ELSE y is C.
The relation R is equivalent to

R = (A × B)
∪ (A¯ × C)

The membership function of R is


given by
µR (x, y ) =max [min{µA(x ), µB (y )},
min{µA¯ (x ), µC (y )]

40 /
Soft Computing 01/04/202
Fuzzy
Inferences

41 /
Soft Computing 01/04/202
Fuzzy inferences

Let’s start with propositional logic. We know the following in


propositional logic.

1 Modus Ponens : P, P =⇒ Q, ⇔Q

2 Modus Tollens : P =⇒ Q, ¬Q ⇔, ¬P

3 Chain rule : P =⇒ Q, Q =⇒ R ⇔, P =⇒ R

42 /
Soft Computing 01/04/202
An example from propositional logic
Give
n1 C ∨
D
2 ~ H =⇒ (A∧ ∼

B)
3 C ∨ D =⇒∼

H
4 (A∧ ∼ B) =⇒ (R ∨

S)
From the above can we infer R ∨ S?

Similar concept is also followed in fuzzy logic to infer a fuzzy rule from a
set of given fuzzy rules (also called fuzzy rule base).

43 /
Soft Computing 01/04/202
Inferring procedures in Fuzzy logic
Two important inferring procedures are used in fuzzy systems :

Generalised Modus Ponens (GMP)


If x is A Then y is B

x is A
————————
————

y is B

Generalised Modus
Tollens (GMT)
If x is A Then y is B

y is B
————————
———— 44 /

Soft Computing 01/04/202
Fuzzy inferring procedures
′ ′
Here, A, B, A and B are fuzzy sets.
′ ′
To compute the membership function A and B the max-min
′ ′
composition of fuzzy sets B and A ,respectively with R(x, y )
(which is the known implication relation) is to be used.

Thus,
′ ′
B = A ◦ R(x, µB (y ) = max [min(µA′ (x ), µR (x, y
y) ))]
′ ′
A = B ◦ R(x, µA(x ) = max [min(µB′ (y ), µR (x,
y)
y ))]

45 /
Soft Computing 01/04/202
Generalized Modus Ponens
Generalized Modus Ponens (GMP)

P : If x is A then y is B
Let us consider two sets of variables x and y be
X = {x1, x2, x 3 } and Y = {y1, y 2 }, respectively.

Also, let us consider the following.


A = {(x1, 0.5), (x2, 1), (x3, 0.6)}
B = {(y1, 1), (y2, 0.4)}
′ ′
Then, given a fact expressed by the proposition x is A , where A =

{(x1, 0.6), (x2, 0.9), (x3, 0.7)} derive a conclusion in the form y is B
(using generalized modus ponens (GMP)).
46 /
Soft Computing 01/04/202
01/04/2025 47 / 64
Example: Generalized Modus Ponens
y1 y2

x 
1
.5 0.5
R(x, y ) = (A × B) ∪ (A × y ) 02  1 
= x x3 0.4 0.4
0.6


Now, A = {(x1, 0.6), (x2, 0.9), (x3, 0.7)}
′ ′
Therefore, B = A ◦ R(x, 
y)= 0.5

0.6 0.9 0.7 ◦ 0.51 0.4 = 0.9
0.5 0.6 0.4

′ ′
Thus we derive that y is B where B = {(y1, 0.9), (y2,
0.5)}

48 /
Soft Computing 01/04/202
Example: Generalized Modus Tollens
Let sets of variables x and y be X = {x1, x2, x 3 } and y = {y1, y 2 },
respectively.

Assume that a proposition If x is A Then y is B given where


A = {(x1, 0.5), (x2, 1.0), (x3, 0.6)} and B = {(y1, 0.6), (y2, 0.4)}

Assume now that a fact expressed by a proposition y is B is given



where B = {(y1, 0.9), (y2, 0.7)}.


From the above, we are to conclude that x is A . That is, we are to

determine A

49 /
Soft Computing 01/04/202
Example: Generalized Modus
Tollens

01/04/2025 50 / 64
Example: Generalized Modus
Tollens

01/04/2025 51 / 64

You might also like