Lecture_3
Lecture_3
01/04/2025 1 / 64
Soft Computing 1 / 64
Crisp relations
Note :
(1) X × Y /= Y× X
(2) |X × Y| = |X| × |Y|
(3) X × Y provides a mapping from x ∈ X to y ∈ Y.
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:
Intersection:
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.
Max-Min Composition
Given the two relation matrices R and S, the max-min composition is
defined as T = R ◦ S ;
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
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:
Intersection:
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.
14 /
Soft Computing 01/04/202
Two-valued logic vs. Multi-valued logic
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
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
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
21 /
Soft Computing 01/04/202
Fuzzy implication : Example 1
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)}
23 /
Soft Computing 01/04/202
Fuzzy implications: Example 2
01/04/2025 24 / 64
Interpretation of fuzzy rules
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
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]
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)
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.
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;
34 /
Soft Computing 01/04/202
Example 3: Zadeh’s Max-Min rule
• Rmm = (A × B) ∪ (A¯ × Y )
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)
40 /
Soft Computing 01/04/202
Fuzzy
Inferences
41 /
Soft Computing 01/04/202
Fuzzy inferences
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
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.
′
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.
′
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