STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K.
Sahoo
UNIT-01
Fuzzy Logic Systems
Before going to understand about ‘fuzzy set’ we should understand about ‘crisp set’.
Let us take an example
i.e. The degree of truth/ degree of belongingness/ degree of membership is represented as 0 or
1. (Absolutely truth or absolutely false)
Example-1: Let X is a set which consists of all technical universities in India and Y is a set of
technical universities having 5-departments.
These sets have finite boundaries. X
Y
Example-2: Let X =Entire population of India X
H= All Hindu population
M H
M= All Muslim population
All sets have finite number of individuals. This type of sets are called crisp sets.
There are 3- ways we can represent a crisp set
Roster or Tabular Form
In this form, a set is represented by listing all the elements comprising it. The elements are
enclosed within braces and separated by commas.
Following are the examples of set in Roster or Tabular Form –
• Set of vowels in English alphabet, A = {a,e,i,o,u}
• Set of odd numbers less than 10, B = {1,3,5,7,9}
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
Set Builder Notation:
In this form, the set is defined by specifying a property that elements of the set have in
common. The set is described as A = {x: p(x)}
Example 1 − The set {a,e,i,o,u} is written as
A = {x: x is a vowel in English alphabet}
Example 2 − The set {1,3,5,7,9} is written as
B = {x: 1 ≤ x < 10}
If an element x is a member of any set S, it is denoted by x∈S and if an element y is not a
member of set S, it is denoted by y ∉ S.
Example − If S = {1, 1.2, 1.7, 2}, 1 ∈ S but 1.5 ∉ S
Using Characteristic Function/ Membership Function
µ(x) is represented as degree of membership. So in crisp set there are two degrees of
1
membership. i.e. (x) = x X
0 x X
Let us take a set of tall people having height between 150 cm to 210 cm. If we define people
having height 180 cm and above are called as tall & below 180cm are called as not tall then
using membership function we can write
• That means, in crisp set the boundary is always sharp
• It has only 2-degrees of membership. (0 or 1)
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
A set is an unordered collection of different elements. It can be written explicitly by listing its
elements using the set bracket. If the order of the elements is changed or any element of a set is
repeated, it does not make any changes in the set.
Example
• A set of all positive integers.
• A set of all the planets in the solar system.
• A set of all the states in India.
• A set of all the lowercase letters of the alphabet.
Notations Used in Set Theory:
Φ: Empty/ Null set
x∈A: Element of x of the universal set X belong 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 superset of Set B
A=B: A and B are equal
A B : A and B are not equal
A B : A is proper subset of set B
A B : A is proper superset of B
A : Cardinality of set A is defined as the total number of element in set A
P(A): Power set of A is the max number of subsets including the null set that can be constructed
from set A i.e. P( A) = 2 A
Let A={ a1 , a2 , a3} Here A=3 so P(A)= 23 = 8
Properties of Crisp Sets: It has 10 laws
1: Law of Involution: A= A
2. Law of Commutatively: A B = B A ; A B = B A
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
3. Law of Associatively: ( A B) C = A (B C) ; ( A B) C = A (B C)
4. Law of Distributive: A (B C) = ( A B) ( A C) ; A (B C) = ( A B) ( A C)
5. Law of Tautology: A A = A; A A = A
6. Law of Absorption: A ( A B) = A
7. Law of Identity: A X = X ; A X = A
8. De Morgan’s law: A B = A B ; A B = A B
9. Law of Contradiction: A A =
10: Law of Exclude Middle: A A = X
Fuzzy:
The word ‘Fuzzy’ means Uncertainness, Unclear or Vague. Many words we use arbitrarily in
our daily life are usually fuzzy in terms of verbal meanings.. When expressing or describing a
system or an event, we use words such as old, young, tall, short, cold, warm, hot, sunny, cloudy,
fast, slow, etc., which are fuzzy in nature.
• Depending on his/her age, we call a person old, middle aged, young, very old and very
young.
• If the lights in our study room are low, we increase brightness a little, else we decrease it.
All these examples show how our brain acts and takes decisions during the situations that are
uncertain and fuzzy.
In classical (Newtonian) mechanics, uncertainty was considered as undesirable and to be avoided
by any means. In the late nineteenth century, researchers started to realize that no physical
system exists without a certain amount of uncertainty. This is a phenomenon without which the
description of a system or model is incomplete. He proposed a degree as a measure of
vagueness. Vagueness can be used to describe a certain kind of uncertainty.
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
For Example, a person is Tall if his height is 180 cm or above and not Tall if his height is below
180cm, such definition follows Boolean Logic/ classical set theory. That means the degree of
membership is either 0 or 1
Example-2: If we say door is slightly open i.e. Let approx 20% of door is open then using fuzzy
set we represent the degree of truth is 0.2. But in crisp set we say either door is open or closed.
Example-3: Let A= {Calcutta, Bhubaneswar, Delhi} be the cities where we may build a home.
C= ‘desirable city to build a home’ may be defined as
C= {(Calcutta, 0.8), (Bhubaneswar, 0.9), (Delhi, 0.7)}
The fuzzy set is characterized by MFs.
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
C =(x1, 1),(x1, 1),(x1, 1) ..... (xi , i )
That means degree of truth/ degree of belongingness/ degree of membership of Fuzzy Set
varies from 0 to 1.
Example-3: Let us consider the set of days = {Sunday, Monday, Tuesday, Wednesday,
Thursday, Friday, and Saturday}.This is the set in which elements belongs to the set with 100%
membership.
Example-4: Let us consider the set of rainy days ={Sunday (0.6), Monday (0.4), Tuesday (0.4),
Wednesday (0.6), Thursday (0.2), Friday (0.6), Saturday (0.3)}. This is the set in which elements
are associated with fuzzy membership. Sunday (0.6) indicates that the Sunday belongs to the set
of rainy days with membership value 0.6.
Fuzzy Sets:
The fuzzy set is characterized by different degree of membership from 0 to 1. It is represented in
ordered pair. Therefore, fuzzy set is called as extension of crisp set.
• If an element is not a member of the fuzzy set, then its membership value is defined as 0.
• A membership value 1 is assigned as a full membership degree if an element is known to
be completely included in that set.
• On the other hand, crisp sets do not include any element with uncertainty. An
element is a member of crisp set or not.
A fuzzy set is represented by a membership or a characteristic function. Fuzzy membership
functions are defined either as continuous or discrete functions.
Fuzzy Set Expression:
There are two kinds of expression as follows:
(1) Fuzzy set A consists of discrete element:
Set (i) A= 1 + 2 + 3 ........ i + ... Or A =(x , ),(x , ),(x , ).....(x , ...)
x x x x 1 1 1 1 1 1 i i
1 2 3 i
(ii) Fuzzy set A consist of continuous function (MF)
A (x)
A=
x
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
Example 1: Let X= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, A= {2, 4}
This type of representation is crisp representation. But in terms of fuzzy set
A ={(x, A (x)) x X}
A={1,0), (2,1), (3,0), (4,1), (5,0), (6,0), (7,0), (8,0), (9,0), (10,0)}
Example 2. Let A = {x1, x2, x3, x4} in the universe of discourse X having membership
Values of 0.4, 1.0, 0.7 and 0.8, respectively. This fuzzy set can be written as
A = {0.4/x1 + 1.0/x2 + 0.7/x3 + 0.8/x4}
Example 3.
An element of a fuzzy set may be an element of other fuzzy set with some degree of
belongingness
Fuzzy Set Crisp Set
1. S ={s s X} 1. F={ (s, (s)) s X}(s) is the degree of
membership
2. It is a collection of elements [Link] is a collection of ordered pairs
3. Inclusion of an element s X 3. Inclusion of an element s X into F is
into s is crisp, i.e. it has strict fuzzy that is if present then with a degree of
boundary Yes or No membership
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
Logic: It is a tool for reasoning propositions. A proposition is a declarative or linguistic
statement within a universe of discourse.
Fuzzy Set Operations:
The fuzzy set operations are either done by using the fuzzy sets themselves or membership
functions carrying their characteristic properties. As in crisp sets, fuzzy sets also have
definitions such as subset, empty set, intersection set, union set and complement of a set.
Three main fuzzy set operators are given in this part:
● intersection
● union
● complement
Intersection of fuzzy sets:
The intersection of two fuzzy sets A and B with membership functions A and B , respectively,
is a fuzzy set C, denoted C = A ∩ B, with membership function c defined using the min
membership function or the product rule as
c (x) = min[A (x), B (x)] = c (x) = A (x) B (x)
Union of fuzzy sets:
C = A∪ B i.e. c (x) = max[A(x), B (x)] = c (x) = A (x) B (x)
Complement of fuzzy set: The complement of a fuzzy set A with membership function A (x)
is a fuzzy set, denoted A (x) =1- A (x)
xample Let A and B be two fuzzy sets in the universe of discourse X and (x1, x2, x3, x4) X
E
defined as follows:
A = {0/x1 + 1/x2 + 0.7/x3 + 0.4/x4 + 0.2/x5 + 0/x6}
B = {0/x1 + 0.4/x2 + 0.7/x3 + 0.8/x4 + 1/x5 + 0/x6}
The union of fuzzy sets A and B using the max membership function is
C max = A ∪ B = {0/x1 + 1/x2 + 0.7/x3 + 0.8/x4 + 1/x5 + 0/x6}
C min = A ∩ B = {0/x1 + 0.4/x2 + 0.7/x3 + 0.4/x4 + 0.2/x5 + 0/x6}
Example
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
Let A be a fuzzy set in the universe of discourse X and (x1, x2, x3, x4, x5, x6, x7, x8) X defined
as follows:
A = {1/x1 + 1/x2 + 0.9/x3 + 0.8/x4 + 0.7/x5 + 0.3/x6 + 0.1/x7 + 0/x8}
The complement of fuzzy set A is A (x) =1- A (x)
A = {0/x1 + 0/x2 + 0.1/x3 + 0.2/x4 + 0.3/x5 + 0.7/x6 + 0.9/x7 + 1/x8}
Example: If A (x) = 0.4 then A (x) will be 1-0.4=0.6
So A (x) A (x) =0.4 0.6 =0.6
A (x) A (x) =0.4 0.6 =0.4
Dot product of Two Fuzzy Sets:
Let A (x) = {(x1, 0.2), (x2, 0.3)} and B (x) = {(x1, 0, 3), (x2, 0.5)}
AB (x) = A (x) . B (x) = {(x1, 0.06), (x2, 0.15)}
Multiplying a Fuzzy Set by a Crisp Number:
A(x) = A(x) or .A = .A(x) = .A(x)
A={(x1,0.2), (x2, 0.3)} Let =0.3
0.3A= {(x1, 0.06), (x2, 0.09)}
Power of Fuzzy Set: A (x) =[ A(x)]
A={ (x1, 0.2), (x2, 0.3)} Then A2 = {(x1,0.22), (x2, 0.32)
Concentration of the Fuzzy Set: The concentration of fuzzy set over the universe of discourse
is given by CON ( A) (x) =[A (x)]2
Here A2 is called Concentration of A
Note: Concentrating the fuzzy set decreases the fuzzy membership. For example if
mOLD ( Rita ) (x) = 0.8 then mVERYOLD( Rita ) (x) = 0.64
Dilation of Fuzzy Set: The dilation of the fuzzy set over universe of discourse X is given by
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
DIL( A) (x) = ( A) (x)
If A0.5 is called Dilation of A
Dilating the fuzzy set increases the fuzzy membership of the set.
Empty Set: The membership function of A is empty considered empty if for all x, A (x) =0
Equality of Fuzzy sets: The fuzzy sets A and B are equal if the fuzzy set of A is equal to the
fuzzy set B.
A (x) = B (x)
Fuzzy Relations:
1. Cartesian product/Cross Product of two Crisp Sets:
Let X={1,2,3,4} Y={3,4,5}
Then X Y = {(1,3), (1,4), (1,5), (2,3), (2,4), (2,5), (3,3), (3,4), (3,5), (4,3), (4,4), (4,5)}
OR
In matrix form, Row elements of 1st set, Column elements of 2nd set
Then
3 4 5
X Y =
1 (1, 3) (1, 4) (1, 5)
2 (2, 3) (2, 4) (2, 5)
3 (3, 3) (3, 4) (3, 5)
4 (4, 3) (4, 4) (4, 4)
Crisp Relation:
To understand a relation matrix (R) between two sets X and Y
R ( X ,Y ) ={ (x, y) x X , y Y, R(x, y) X Y}
Example: For the above sets X and Y
Find a relation R(x,y), such that R(x,y)={(x,y) y = x + 2}
R(x,y)={(1,3),(2,4),(3,5)}
Hence the relation matrix is
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
3 4 5
X Y =
11 0 0
20 1 0
30 0 1
40 0 0
Fuzzy Relation:
X= {(x1,0.2),(x2,0.3), x3,0.7)}
Y={(y1,0.1), (y2,0.5), (y3,0.4)}
X Y = {(x1,y1), (x1,y2), (x1,y3),(x2,y1), (x2,y2),(x2,y3), (x3,y1), (x3,y2), (x3,y3)}
In matrix form
y1 y2 y3
X Y =
x1 (x1, y1 ) (x1, y2 ) (x1, y3 )
x2 (x2 , y1 ) (x2 , y2 ) (x2 , y3 )
x3 (x3 , y1 ) (x3 , y2 ) (x3 , y3 )
Composite of Relations:
1. Union. R R = Max[R , R ]
1 2 1 2
For example
y1 y2 y1 y2 y1 y2
R1 = R1 = Then R1 R2 =
x1 0.1 0.2 x1 0.1 0.3 x1 0.1 0.3
x2 0.5 0.7 x2 0.7 0.6 x2 0.7 0.7
2. Union. R R = Min[R , R ]
1 2 1 2
y1 y2
R1 R2 =
x1 0.1 0.2
x2 0.5 0.6
y 1 y2
3. Complement. R c = 1− R1 Then R1c =
1 x1 0.9 0.8
x2 0.5 0.3
Compound of Fuzzy Matrix: If R1 is defined as fuzzy relation in x y, R2 is defined as fuzzy
relation in y z, then C=R1o R2 is a compound of fuzzy matrix R1 and R2.
Note: There are 2 ways in which we can calculate composition of relations
1. MAX-MIN Composition
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
2. MAX – PROD composition
To perform the composite operation, the number of columns of first relational matrix R1
must be equal to number rows of the second relational matrix R2.
y1 y2 y3 y1 y2
Max-Prod Composition: R1 = R2 =
x1 0.1 0.3 0.4 x1 0.5 0.2
x2 0.2 0.1 0.5 x2 0.7 0.1
x3 0.2 0.6
y1 y2 y1 y2
Then Compositional matrix C = C=
x1 c11 c12 x1 0.21 0.24
x2 c21 c22 x2 0.10 0.30
C11=Max [(0.1*0.5), (0.3*0.7), (0.4*0.2)] = 0.21
C12=Max [(0.1*0.2), (0.3*0.1), (0.4*0.6)] = 0.24
C21=Max [(0.2*0.5), (0.1*0.7), (0.5*0.2)] = 0.10
C22=Max [(0.2*0.2), (0.1*0.1), (0.5*0.6)] = 0.30
R1oR2 R2oR1
y1 y2 y1 y2
Max-Min Composition: C = R1o R2 = C=
x1 c11 c12 x1 0.3 0.4
x2 c21 c22 x2 0.2 0.5
C11=Max [Min (0.1, 0.5), Min (0.3, 0.7), Min (0.4, 0.2)] = Max [0.1, 0.3, 0.2] =0.3
C12=Max [Min (0.1, 0.2), Min (0.3, 0.1), Min (0.4, 0.6)] = Max [0.1, 0.1, 0.4] =0.4
C21= Max [0.2, 0.1, 0.2] =0.2
C22= Max [0.2, 0.1, 0.5] =0.5
Membership Function: In Fuzzy logic membership function is curve or a set of curves
which converts crisp values (Numeric values) into fuzzy values. Therefore, we can foem
various type of MFs. But there are 6- kind of some standard MFs such as
1. Gaussian MF
2. Triangular MF
3. Trapezoidal MF
4. Bell type MF
The uncertainties of expressions like ‘very nice’, ‘too small’, ‘high value’ are called
fuzziness. The function that characterizes the fuzziness of a fuzzy set is called MF. In other
words, Fuzziness in a fuzzy set is characterized by its membership functions. There is no strict
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
rule for defining a membership function. The “shape” of the membership function is an
important criterion that has to be considered. The choice of membership function is usually
problem-dependent and often determined heuristically and subjectively. Most widely used MFs
in the fuzzy logic literature are triangular, trapezoidal, Gaussian and bell-shaped
functions.
• Fuzzification is the process where the crisp quantities are converted to fuzzy (crisp to
fuzzy). Fuzzy set has to overlap. Overlapping denotes uncertainty. If we do not overlap,
the members do not carry any uncertainty.
• MFs play a key role in fuzzy logic system. Their shape & location determine how well
the system operates.
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
1: Increasing MF:
x
a b
(x − a)
,a x b
The membership function (x) = (b − a)
1, x b
2: Decreasing MF:
x
a b
1, 0 x a
(b − x)
The membership function (x) = ,a x b
(b − a)
0, x b
x
3. Triangular MF:
a b cb
0, x a
(x − a)
,a x b
b−a
Membership function f (x, a, b, c) = (x) =
(c − x)
,b x c
c −b
0, x c
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
4: Trapezoidal MF:
x
a b c
x
,0 x a
a
f(x, a, b, c) = (x) = 1, a x b
(c − x)
,b x c
c−b
5: Gaussian MF:
( x−c)2
f (x, , c) = e 2 2
where is appositive constant
Example: Plot fuzzy membership functions for “age of people.”
The linguistic variables are defined as: (A denoting the age in years)
Very Young(VY): A < 15
Young (Y): 12 < A < 30
Middle aged (MA): 25 < A < 50
Old (O): 45 < A < 65
Very old (VO): 60 < A
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
Fuzzification: The process of converting analog/numerical values (crisp input values) into a
set of fuzzy values is called fuzzification.
Fuzzy Rules: It involves IF.. THEN statement
i.e. If <fuzzy antecedents> Then <fuzzy consequents>
Example: If <x is A1> Then <y is B2>
Let us take a boiler control system where there are 2- inputs & 1- output. The inputs are
Temperature (T) & Pressure (P) and output is Fuel valve position (V)
Rule-1: If the temperature is Low and pressure is Medium then the output valve position is High
Rule-2: If the temperature is Low and pressure is High then the output valve position is
MediumRule-3: If the temperature is Medium and pressure is High then the output valve
position is Low
Fuzzy Inference mechanism:
It contains a set of fuzzy rules using If ...Then statements. The inference mechanism decides
which rules are relevant to a particular set of inputs and accordingly applies action indicated by
these rules
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
Defuzzification: The reverse of fuzzification is called defuzzification. The defuzzifier after
taking the logical sum of all relevant rules converts into crisp values. (Called firing strength)
There are seven methods used for defuzzifying the fuzzy output functions.
STUDY MATERIAL ON NEURAL NETWORK & FUZZY LOGIC BY: Dr. P.K. Panigrahi & Mr. A.K. Sahoo
[Link]