Fuzzy Logic 1
Fuzzy Logic 1
Fuzzy Logic 1
Fuzzy Set
• A={a1,a2,……,an}
Sets
• A={x|P(x)}, P: property
• Using characteristic function
1, if x belongs to A,
μA(x)=
0, if x does not belong to A.
Notations Used in Set Theory
• : Empty/Null set
• x A : Element x of the Universal set X belongs to set A
• x A : x does not belong to set A
• A B : set A is a subset of set B
• A B : set A is a superset of set B
• A B : A and B are equal
• A B : A and B are not equal
• A B : A is a proper subset of B
• A B : A is a proper superset of B
• A : Cardinality of set A is defined as the total number of
elements present in that set
• p(A) : Power set of A is the maximum number of subsets
including the null that can be constructed from a set A
Note: p A 2 A
Crisp Set Operations
• Difference:
It is known as relative complement of set B with respect to set A
1. Law of involution:
2. Law of Commutativity:
3. Associativity: ;
5. Laws of Tautology: ;
4. Distributivity:
6. Laws of Absorption:
7. Laws of Identity:
8. De Morgan’s Laws:
9. Law of contradiction:
10. Law of excluded middle:
Fuzzy Sets
Note:
Probability: Frequency of likelihood that an element is in a class
Membership: Similarity of an element to a class
Types of Fuzzy sets
Ax A x / x
X
Convex vs. Non-Convex Membership Function Distribution
A fuzzy set A(x) will be convex, if
A x1 1 x2 min A x1 , A x2
Where 0.0 ≤ λ ≤ 1.0
Various Types of Membership Function Distributions
1. Triangular Membership
x a c x
triangle max min , ,0
b a c b
2. Trapezoidal Membership
x a d x
trapezoidal max min ,1, ,0
b a d c
3. Gaussian Membership
1
Gaussian 2
1 x m
2
e
4. Bell-shaped Membership Function
1
Bell shaped 2b
x c
1
a
5. Sigmoid Membership
1
Sigmoid a x b
1 e
Summary:
1.0
0.0
a=2 b=6 8 c=10
x
𝝁𝒕𝒓𝒊𝒂𝒏𝒈𝒍𝒆 =𝒎𝒂𝒙 [ 𝒎𝒊𝒏 ( 𝒙−𝒂 𝒄− 𝒙
,
𝒃−𝒂 𝒄−𝒃 )
,𝟎 ]
We put, x=8.0
[ ( ) ]
𝝁𝒕𝒓𝒊𝒂𝒏𝒈𝒍𝒆 =𝒎𝒂𝒙 𝒎𝒊𝒏
𝟑 𝟏
,
𝟐 𝟐
𝟏
, 𝟎 = =𝟎 . 𝟓
𝟐
Trapezoidal Membership
•Determine μ corresponding to x = 3.5
𝜇 𝒕𝒓𝒂𝒑𝒆𝒛𝒐𝒊𝒅𝒂𝒍max min x a
,1,
d x
,0
b a d c
x 2 10 x
max min ,1, ,0
4 2 10 8
x 2 10 x
max min ,1, ,0
2 2
•We put x = 3.5
max0.75,0
0.75
Gaussian Membership:
Determine corresponding to
1.0
0.0
𝒎
𝒙
𝟏
𝝁 𝑮𝒂𝒖𝒔𝒔𝒊𝒂𝒏 = 𝟐
𝒆
𝟐 (
𝟏 𝒙 −𝒎
𝝈 )
𝑻𝒂𝒌𝒆𝒎=𝟏𝟎 . 𝟎 𝒂𝒏𝒅 𝝈 =𝟑 .𝟎
𝟏
𝝁 𝑮𝒂𝒖𝒔𝒔𝒊𝒂𝒏 = 𝟐
𝒆
𝟏
𝟐 ( 𝒙 −𝟏𝟎 .𝟎
𝟑 .𝟎 )
We put
𝟏
∴ 𝝁 𝑮𝒂𝒖𝒔𝒔𝒊𝒂𝒏= 𝟐 =𝟎 .𝟗𝟒𝟓𝟗
𝒆
𝟐(
𝟏 𝟗 .𝟎 −𝟏𝟎 .𝟎
𝟑.𝟎 )
Bell-shaped Membership function: Determine μ
corresponding to
1.0
0.0
c
x
𝟏
𝝁 𝑩𝒆𝒍𝒍 − 𝒔𝒉𝒂𝒑𝒆𝒅 =
| |
𝟐𝒃
𝒙−𝒄
𝟏+
𝒂
1 e a( x b)
1
sigmoid
Take b = 6.0; a = 2
1e
sigmoid 12( x 6.0)
we put x = 8.0
0.98
1e 1e
1 1
sigmoid
22.0
4
Difference Between Crisp and Fuzzy
Sets
A Few Definitions in Fuzzy Sets
• α-cut of a fuzzy set
+ ¿ ( 𝒙 ) = { 𝒙 |𝝁 ( 𝒙 )> 𝜶 } ¿
𝜶 𝝁𝑨
𝑨
Numerical Example
The membership function distribution of a fuzzy set is assumed to follow a
Gaussian distribution with mean m = 100 and standard deviation σ =20 .
Determine 0.6 – cut of this distribution.
Solution:
Gaussian distribution : 1
1 x m
e
2
2
e
2
2 20
1 x 100
e
2
0.6
2 20
1
By taking ln
1 x 100 2
ln e2 20 ln1.6667
Figure : 0.6-cut of a fuzzy set.
x ( 79.7846 ,120.2153)
• Support of a Fuzzy Set A(x)
supp(A)
| 𝑨 ( 𝒙 )|= ∑ 𝝁 𝑨 ( 𝒙 )
𝒙∈ 𝑿
Numerical Example
𝑨 ( 𝒙 ) ⊂ 𝑩 ( 𝒙 ) , 𝒊𝒇 𝝁 𝑨 ( 𝒙 ) <𝝁 𝑩 ( 𝒙 )
Numerical Example
As for all x X, A x B x ,
A x B x , that is , A x is the proper subset of B x
Some Standard Operations in Fuzzy
Sets (contd.)
𝑨 ( 𝒙 )= 𝑩 ( 𝒙 ) ,𝒊𝒇 𝝁 𝑨 ( 𝒙 )=𝝁 𝑩 ( 𝒙 )
Numerical Example
𝑨 ( 𝒙 ) =𝟏 − 𝑨 ( 𝒙 )
Numerical Example
𝝁( 𝑨∩ 𝑩 ) ( 𝒙 )=𝒎𝒊𝒏 {𝝁 𝑨 ( 𝒙 ) ,𝝁 𝑩 ( 𝒙 ) }
x
𝝁( 𝑨∪ 𝑩 ) ( 𝒙 )= 𝒎𝒂𝒙 {𝝁 𝑨 ( 𝒙 ) , 𝝁 𝑩 ( 𝒙 ) }
Note: Union is analogous to logical OR operation
Numerical Example
Let us consider the following two fuzzy sets:
A x x1 ,0.1 , x2 ,0.2 , x3 ,0.3 , x4 ,0.4
B x x ,0.5 , x ,0.7 , x ,0.8 , x ,0.9
1 2 3 4
𝑨 ( 𝒙 ) . 𝑩 ( 𝒙 )={ ( 𝒙 , 𝝁 𝑨 ( 𝒙 ) .𝝁 𝑩 ( 𝒙 ) ) , 𝒙 ∈ 𝑿 }
Numerical Example
𝒅 . 𝑨 ( 𝒙 )={ ( 𝒙 , 𝒅 × 𝝁 𝑨 ( 𝒙 ) ) , 𝒙 ∈ 𝑿 }
Numerical Example
Concentration: p=2
Dilation: p=1/2
Numerical Example
𝑨 ( 𝒙 ) + 𝑩 ( 𝒙 )={( 𝒙 , 𝝁 𝑨+ 𝑩 ( 𝒙 ) ) , 𝒙 ∈ 𝑿 }
where
𝝁 𝑨+𝑩 ( 𝒙 )=𝝁 𝑨 ( 𝒙 ) +𝝁 𝑩 ( 𝒙 ) − 𝝁 𝑨 ( 𝒙 ) . 𝝁 𝑩 ( 𝒙 )
Numerical Example
𝑨 ( 𝒙 ) ⨁ 𝑩 ( 𝒙 )={( 𝒙 , 𝝁 𝑨 ⨁ 𝑩 ( 𝒙 ) ), 𝒙 ∈ 𝑿 }
where
𝝁 𝑨⨁ 𝑩 ( 𝒙 )=𝒎𝒊𝒏 {𝟏 , 𝝁 𝑨 ( 𝒙 ) +𝝁 𝑩 ( 𝒙 ) }
Numerical Example
𝑨 ( 𝒙 ) − 𝑩 ( 𝒙 )={( 𝒙 ,𝝁 𝑨− 𝑩 ( 𝒙 )) , 𝒙 ∈ 𝑿 }
where
𝝁 𝑨− 𝑩 ( 𝒙 ) =𝝁 𝑨∩ 𝑩 (𝒙)
Numerical Example
𝑨 ( 𝒙 ) 𝚯 𝑩( 𝒙 )={( 𝒙 , 𝝁 𝑨 𝚯 𝑩 ( 𝒙 )) , 𝒙 ∈ 𝑿 }
where
𝝁 𝑨 𝚯 𝑩 ( 𝒙 )=𝒎𝒂𝒙 {𝟎 , 𝝁 𝑨 ( 𝒙 ) +𝝁 𝑩 ( 𝒙 ) −𝟏 }
Numerical Example
In matrix form
[cik] = [aij] о [bjk]
Where
cik =max[min(aij, bjk)]
Numerical Example
•Let us consider the following two Fuzzy relations:
0.2 0.3
A a ij
0.5 0.7
max0.2,0.1
0.2
c12 maxmin( a11 , b12 ), min( a12 , b22 )
max0.2,0.3
0.3
c13 maxmin( a11 , b13 ), min( a12 , b23 )
max0.2,0.3
0.3
c21 maxmin( a 21 , b11 ), min( a 22 , b21 )
max0.3,0.1
0 .3
c22 maxmin( a 21 , b12 ), min( a 22 , b22 )
max0.5,0.7
0.7
c23 maxmin( a 21 , b13 ), min( a 22 , b23 )
max0.5,0.6
0 .6
0.2 0.3 0.3
C
0.3 0.7 0.6
Properties of Fuzzy Set
Fuzzy sets follow the properties of crisp sets except the following two:
In crisp set,
In fuzzy set,
• Law of contradiction
In crisp set, O
In fuzzy set, O
Summary:
explained