Sunteți pe pagina 1din 191

Fuzzy Logic

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
A computational paradigm that is based on how
humans think.
Fuzzy Logic looks at the world in imprecise terms,
in much the same way that our brain takes in
information (e.g. temperature is hot, speed is
slow), then responds with precise actions.
The human brain can reason with uncertainties,
vagueness, and judgments. Computers can only
manipulate precise valuations. Fuzzy logic is an
attempt to combine the two techniques.
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Fuzzy Logic is a precise problem-solving methodology.
It is able to simultaneously handle numerical data and
linguistic knowledge.
A technique that facilitates the control of a complicated
system without knowledge of its mathematical description.
Fuzzy logic differs from classical logic in that statements are
no longer black or white, true or false, on or off.
In traditional logic an object takes on a value of either zero
or one.
In fuzzy logic, a statement can assume any real value
between 0 and 1, representing the degree to which an
element belongs to a given set.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
History of Fuzzy Logic
In 1965, Lotfi A. Zadeh of the University of
California at Berkeley published "Fuzzy Sets,"
which laid out the mathematics of fuzzy set
theory and, by extension, fuzzy logic.
Zadeh had observed that conventional computer
logic couldn't manipulate data that represented
subjective or vague ideas, so he created fuzzy
logic to allow computers to determine the
distinctions among data with shades of gray,
similar to the process of human reasoning.
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Interest in fuzzy systems was sparked by Seiji
Yasunobu and Soji Miyamoto of Hitachi, who
in 1985 provided simulations that
demonstrated the superiority of fuzzy control
systems for the Sendai railway.
Their ideas were adopted, and fuzzy systems
were used to control accelerating and braking
when the line opened in 1987.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
In 1987, during an international meeting of
fuzzy researchers in Tokyo, Takeshi Yamakawa
demonstrated the use of fuzzy control,
through a set of simple dedicated fuzzy logic
chips, in an "inverted pendulum" experiment.
This is a classic control problem, in which a
vehicle tries to keep a pole mounted on its top
by a hinge upright by moving back and forth.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
In 1990s, Fuzzy Logic was used in low cost
microcontrollers to perform functions
traditionally performed by more powerful
expensive machines enabling lower cost
products to execute advanced features.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Applications
In the city of Sendai in Japan, a 16-station subway
system is controlled by a fuzzy computer (Seiji
Yasunobu and Soji Miyamoto of Hitachi) the
ride is so smooth, riders do not need to hold
straps.
Nissan fuzzy automatic transmission, fuzzy anti-
skid braking system.
Hitachi Hand-writing Recognition; Voice
recognition.
Sony - Hand-printed character recognition
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Tokyos stock market has had at least one
stock-trading portfolio based on Fuzzy Logic
that outperformed the Nikkei exchange
average.
NASA has studied fuzzy control for automated
space docking: simulations show that a fuzzy
control system can greatly reduce fuel
consumption.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Canon developed an auto-focusing camera that uses a
charge-coupled device (CCD) to measure the clarity of
the image in six regions of its field of view and use the
information provided to determine if the image is in
focus. It also tracks the rate of change of lens
movement during focusing, and controls its speed to
prevent overshoot.
The camera's fuzzy control system uses 12 inputs: 6 to
obtain the current clarity data provided by the CCD and
6 to measure the rate of change of lens movement.
The output is the position of the lens. The fuzzy control
system uses 13 rules and requires 1.1 kilobytes of
memory.
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
For washing machines, Fuzzy Logic control is
almost becoming a standard feature.
Fuzzy controllers to load-weight, fabric-mix,
and dirt sensors and automatically set the
wash cycle for the best use of power, water,
and detergent.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Conventional Control vs. Fuzzy Control
Produce a set of desired outputs for a given
set of inputs.
A household thermostat takes a temperature
input and sends a control signal to a furnace.
A car engine controller responds to variables
such as engine position, manifold pressure
and cylinder temperature to regulate fuel flow
and spark timing.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
look-up table: what output to produce for
every input or combination of inputs.
The table might tell the controller, IF
temperature is 85, THEN increase furnace fan
speed to 300 RPM.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Table can get very long, especially in situations
where there are many inputs or outputs.
Require more memory than the controller can
handle, or more than is cost-effective.
Give a bumpy, uneven response, as the
controller jumps from one table-based value
to the next.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Mathematical formula a set of control
equations that express the output as a
function of the input.
Ideally, these equations represent an accurate
model of the system behaviour. For example:

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Very complex
Working them out in real-time may be more
than an affordable controller (or machine) can
manage.
Difficult or impossible to derive a workable
mathematical model in the first place.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy has no unwieldy memory requirements
of look-up tables.
Fuzzy has no heavy number-crunching
demands of formula-based solutions.
It needs no intricate mathematical models,
only a practical understanding of the overall
system behaviour.
Fuzzy Logic mechanisms can result to higher
accuracy and smoother control.
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Fuzzy Logic is multivalued.
Fuzzy deals with degrees of truth and degrees
of membership.
Fuzzy not clear, distinct, or precise; blurred
A form of knowledge representation suitable
for notions that cannot be defined precisely,
but which depend upon their contexts.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Classical Set Theory
Sets are defined by a simple statement describing
whether an element having a certain property belongs
to a particular set.
When set A is contained in an universal space X, then
we can state explicitly whether each element x of
space X "is or is not" an element of A.
Set A is well described by a function called
characteristic function A. This function, defined on the
universal space X, assumes :
value 1 for those elements x that belong to set A, and
value 0 for those elements x that do not belong to set A.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
: [0, 1]
A(x) = 1 , x is a member of A
A(x) = 0 , x is not a member of A
Alternatively, the set A can be represented for all
elements x X by its characteristic function A
(x) defined as
A (x) = {1 if x X; 0 otherwise
Thus, in classical set theory A (x) has only the
values 0 ('false') and 1 ('true''). Such sets are
called crisp sets.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Classify Students for a basketball
team
Tall students qualify and not tall students do
not qualify.
If students 1.8 m tall are to be qualified, then
should we exclude a student who is 1/10"
less? Or should we exclude a student who is 1"
shorter?

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
A student of height 1.79m would belong to both tall and not tall sets with a particular
degree of membership.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy Sets
A fuzzy set is described by a membership
function A (x) of A.
This membership function associates to each
element xs X a number as A (xs ) in the
closed unit interval [0, 1].
The number A (xs ) represents the degree of
membership of xs in A.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
The notation used for membership function
A (x) of a fuzzy set A is : [0, 1].
Each membership function maps elements of
a given universal base set X , which is itself a
crisp set, into real numbers in [0, 1] .

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Membership function of a Crisp set C and Fuzzy
set F

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
In the case of Crisp Sets the members of a set
are :
either out of the set, with membership of degree "
0 ",
or in the set, with membership of degree " 1 ",
Therefore, Crisp Sets Fuzzy Sets

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
A fuzzy set A defined in the universal space
which assumes values in the range [0, 1].
A fuzzy set A is written as a set of pairs {x,
A(x)} as A = {{x , A(x)}} , x in the set X where x
is an element of the universal space X, and
A(x) is the value of the function A for this
element.
The value A(x) is the membership grade of the
element x in a fuzzy set A.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Crisp and fuzzy sets of short, average
and tall men
Degreeof CrispSets
Membership
1.0
0.8 Short Average Tall

0.6
0.4
0.2

0.0
150 160 170 180 190 200 210
Height, cm
Degreeof Fuzzy Sets
Membership
1.0

0.8
0.6 Short Average Tall

0.4
0.2

0.0
150 160 170 180 190 200 210
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Fuzzy Sets with Discrete Universes
Fuzzy set C = desirable city to live in
X = {SF, Boston, LA} (discrete and nonordered)
C = {(SF, 0.9), (Boston, 0.8), (LA, 0.6)}
Fuzzy set A = sensible number of children
X = {0, 1, 2, 3, 4, 5, 6} (discrete universe)
A = {(0, .1), (1, .3), (2, .7), (3, 1), (4, .6), (5, .2), (6, .1)}

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy Sets with Cont. Universes
Fuzzy set B = about 50 years old
X = Set of positive real numbers (continuous)
B = {(x, mB(x)) | x in X}
1
B(x)
x 50
2

1
10

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
A fuzzy set A can be alternatively denoted as
follows:
X is discrete A
x X
A ( xi ) / xi
i

X is continuous A A( x) / x
X

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Typical functions that can be used to
represent a fuzzy set are sigmoid, gaussian
and pi.
However, these functions increase the time of
computation. Therefore, in practice, most
applications use linear fit functions.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Membership functions of one
dimension
A triangular membership function is specified
by three parameters {a, b, c}:
Triangle(x; a, b, c) = 0 if x a;
= (x-a)/(b-a) if a x b;
= (c-b)/(c-b) if b x c;
= 0 if c x.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
A trapezoidal membership function is
specified by four parameters {a, b, c, d} as
follows:
Trapezoid(x; a, b, c, d) = 0 if x a;
= (x-a)/(b-a) if a x b;
= 1 if b x c;
= (d-x)/(d-c) 0 if c x d;
= 0, if d x.
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
A sigmoidal membership function is specified
by two parameters {a, c}:
Sigmoid(x; a, c) = 1/(1 + exp[-a(x-c)]) where a
controls slope at the crossover point x = c.
These membership functions are some of the
commonly used membership functions in the
fuzzy inference systems.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Membership functions of two
dimensions
One dimensional fuzzy set can be extended to
form its cylindrical extension on second
dimension
Fuzzy set A = (x,y) is near (3,4) is
A(x,y) = exp[- ((x-3)/2)2 -(y-4)2 ]
A(x,y) = exp[- ((x-3)/2)2 ] exp -(y-4)2 ]
=gaussian(x;3,2)gaussian(y;4,1)
This is a composite MF since it can be
decomposed into two gaussian MFs

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
MF Formulation
x a c x
Triangular MF: trimf ( x ; a, b , c ) max min , , 0
b a c b

x a d x
Trapezoidal MF: trapmf ( x ; a, b , c , d ) max min , 1, , 0
b a d c

2
1 x c

2
Gaussian MF: gaussmf ( x ; a, b , c ) e

1
Generalized bell MF: gbellmf ( x ; a, b , c ) 2b
x c
1
b

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
MF Formulation
1
Sigmoidal MF: sigmf ( x ; a, b , c )
1 e a( x c )

Extensions:

Abs. difference
of two sig. MF

Product
of two sig. MF

disp_sig.m
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Set SMALL in set X consisting of
natural numbers <= to 12.
Assume: SMALL(1) = 1, SMALL(2) = 1, SMALL(3) =
0.9, SMALL(4) = 0.6, SMALL(5) = 0.4, SMALL(6) =
0.3, SMALL(7) = 0.2, SMALL(8) = 0.1, SMALL(u) = 0
for u >= 9.
Then,
Set SMALL = {{1, 1 }, {2, 1 }, {3, 0.9}, {4, 0.6}, {5,
0.4}, {6, 0.3}, {7, 0.2}, {8, 0.1}, {9, 0 }, {10, 0 }, {11,
0}, {12, 0}}
a fuzzy set defined precisely by associating with
each x , its grade of membership in SMALL.
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Universal Space
The universal space for fuzzy sets and fuzzy
relations is defined with three numbers.
The first two numbers specify the start and
end of the universal space, and the third
argument specifies the increment between
elements.
This gives the user more flexibility in choosing
the universal space.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Example : The fuzzy set of numbers, defined in
the universal space X = { xi } = {1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12} is presented as
SetOption [FuzzySet, UniversalSpace {1, 12,
1}]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Graphic Interpretation of Fuzzy Set
SMALL
FuzzyPlot [ SMALL, AxesLable {"X",
"SMALL"}]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy Set PRIME Numbers
The fuzzy set PRIME numbers, defined in the
universal X = { xi } = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12} is presented SetOption [FuzzySet,
UniversalSpace {1, 12, 1}]
The Set PRIME in set X is :
PRIME = FuzzySet {{1, 0}, {2, 1}, {3, 1}, {4, 0}, {5, 1},
{6, 0}, {7, 1}, {8, 0}, {9, 0}, {10, 0}, {11, 1}, {12, 0}}
Therefore SetPrime is represented as
SetPrime = FuzzySet [{{1,0},{2,1}, {3,1}, {4,0},
{5,1},{6,0}, {7,1}, {8, 0}, {9, 0}, {10, 0}, {11, 1}, {12,
0}} , UniversalSpace {1, 12, 1}]
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Graphic Interpretation of Fuzzy Set
PRIME Numbers
FuzzyPlot [ PRIME, AxesLable {"X",
"PRIME"}]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy Set UNIVERSAL SPACE
In any application of sets or fuzzy sets theory, all
sets are subsets of a fixed set called universal
space or universe of discourse denoted by X.
Universal space X as a fuzzy set is a function
equal to 1 for all elements.
The fuzzy set UNIVERSALSPACE numbers, defined
in the universal space X = { xi } = {1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12} is presented as
SetOption [FuzzySet, UniversalSpace {1, 12, 1}]
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
The Set UNIVERSALSPACE in set X is :
UNIVERSALSPACE = FuzzySet {{1, 1}, {2, 1}, {3, 1},
{4, 1}, {5, 1}, {6, 1}, {7, 1}, {8, 1}, {9, 1}, {10, 1},
{11, 1}, {12, 1}}
Therefore SetUniversal is represented as
SetUniversal = FuzzySet [{{1,1},{2,1}, {3,1}, {4,1},
{5,1},{6,1}, {7,1}, {8, 1}, {9, 1}, {10, 1}, {11, 1},
{12, 1}} , UniversalSpace {1, 12, 1}]
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Graphic Interpretation of Fuzzy Set
UNIVERSAL SPACE
FuzzyPlot [ UNIVERSALSPACE, AxesLable
{"X", " UNIVERSAL SPACE "}]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy Set EMPTY
An empty set is a set that contains only
elements with a grade of membership equal
to 0.
The Empty set is also called the Null set.
The fuzzy set EMPTY , defined in the universal
space X = { xi } = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12} is presented as
SetOption [FuzzySet, UniversalSpace {1, 12,
1}]
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
The Set EMPTY in set X is :
EMPTY = FuzzySet {{1, 0}, {2, 0}, {3, 0}, {4, 0}, {5,
0}, {6, 0}, {7, 0}, {8, 0}, {9, 0}, {10, 0}, {11, 0},
{12, 0}}
Therefore SetEmpty is represented as
SetEmpty = FuzzySet [{{1,0},{2,0}, {3,0}, {4,0},
{5,0},{6,0}, {7,0}, {8, 0}, {9, 0}, {10, 0}, {11, 0},
{12, 0}} , UniversalSpace {1, 12, 1}]
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Graphic Interpretation of Fuzzy Set
EMPTY
FuzzyPlot [ EMPTY, AxesLable {"X", "
UNIVERSAL SPACE "}]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Linguistic variables and hedges
A linguistic variable is a fuzzy variable. For
example, the statement John is tall implies that
the linguistic variable John takes the linguistic
value tall.
The range of possible values of a linguistic
variable represents the universe of discourse of
that variable. For example, the universe of
discourse of the linguistic variable speed might
have the range between 0 and 220 km/h and may
include such fuzzy subsets as very slow, slow,
medium, fast, and very fast.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
A linguistic variable carries with it the concept
of fuzzy set qualifiers, called hedges.
Hedges are terms that modify the shape of
fuzzy sets. They include adverbs such as very,
somewhat, quite, more or less and slightly.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy sets with the hedge very
Degreeof
Membership
1.0
Short Short
Tall
0.8
0.6 Average

0.4
Very Short Very
VeryTall
Tall
Tall
0.2

0.0
150 160 170 180 190 200 210
Height, cm
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Representation of hedges in fuzzy logic
Hedge Mathematical Graphical Representation
Expression

A little [ A( x)] 1.3

Slightly [ A(x)] 1.7

Very [ A (x)] 2

Extremely [ A(x) ] 3
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Mathematical
Hedge Graphical Representation
Expression

Very very [A (x)]4

More or less A (x)

Somewhat A (x)

2 [A (x )]2
if 0 A 0.5
Indeed
1 2 [1 A (x)]2
if 0.5 < 1
Dr DeeptiAGupta CSE, UIET, Panjab
University, Chandigarh
Fuzzy Operations
Fuzzy set operations are the operations on
fuzzy sets.
The fuzzy set operations are generalization of
crisp set operations.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Inclusion
Let A and B be fuzzy sets defined in the same
universal space X.
The fuzzy set A is included in the fuzzy set B if
and only if for every x in the set X we have
A(x) = B(x)

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Example :
The fuzzy set UNIVERSALSPACE numbers,
defined in the universal space X = { xi } = {1, 2,
3, 4, 5, 6, 7, 8, 9, 10, 11, 12} is presented as
SetOption [FuzzySet, UniversalSpace {1, 12,
1}]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
The fuzzy set B SMALL
The Set SMALL in set X is :
SMALL = FuzzySet {{1, 1 }, {2, 1 }, {3, 0.9}, {4, 0.6},
{5, 0.4}, {6, 0.3}, {7, 0.2}, {8, 0.1}, {9, 0 }, {10, 0 },
{11, 0}, {12, 0}}
Therefore SetSmall is represented as
SetSmall = FuzzySet [{{1,1},{2,1}, {3,0.9}, {4,0.6},
{5,0.4},{6,0.3}, {7,0.2}, {8, 0.1}, {9, 0}, {10, 0}, {11,
0}, {12, 0}} , UniversalSpace {1, 12, 1}]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
The fuzzy set A VERYSMALL
The Set VERYSMALL in set X is :
VERYSMALL = FuzzySet {{1, 1 }, {2, 0.8 }, {3, 0.7}, {4,
0.4}, {5, 0.2}, {6, 0.1}, {7, 0 }, {8, 0 }, {9, 0 }, {10, 0
}, {11, 0}, {12, 0}}
Therefore SetVerySmall is represented as
SetVerySmall = FuzzySet [{{1,1},{2,0.8}, {3,0.7},
{4,0.4}, {5,0.2},{6,0.1}, {7,0}, {8, 0}, {9, 0}, {10, 0},
{11, 0}, {12, 0}} , UniversalSpace {1, 12, 1}]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
The Fuzzy Operation : Inclusion
Include [VERYSMALL, SMALL]

Graphic Interpretation of Fuzzy Inclusion


FuzzyPlot [SMALL, VERYSMALL]
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Comparability
Two fuzzy sets A and B are comparable if the
condition A B or B A holds, ie, if one of
the fuzzy sets is a subset of the other set, they
are comparable.
Two fuzzy sets A and B are incomparable if the
condition A B or B A holds.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Equality
Let A and B be fuzzy sets defined in the same
space X. Then A and B are equal, which is
denoted X = Y if and only if for all x in the set
X, A(x) = B(x).

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Example
The fuzzy set B SMALL
SMALL = FuzzySet {{1, 1 }, {2, 1 }, {3, 0.9}, {4, 0.6},
{5, 0.4}, {6, 0.3}, {7, 0.2}, {8, 0.1}, {9, 0 }, {10, 0 },
{11, 0}, {12, 0}}
The fuzzy set A STILLSMALL
STILLSMALL = FuzzySet {{1, 1 }, {2, 1 }, {3, 0.9}, {4,
0.6}, {5, 0.4}, {6, 0.3}, {7, 0.2}, {8, 0.1}, {9, 0 }, {10,
0 }, {11, 0}, {12, 0}}

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
The Fuzzy Operation : Equality
Equality [SMALL, STILLSMALL]

Graphic Interpretation of Fuzzy Equality


FuzzyPlot [SMALL, STILLSMALL]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Complement
Let A be a fuzzy set defined in the space X.
Then the fuzzy set B is a complement of the
fuzzy set A, if and only if, for all x in the set X,
B(x) = 1 - A(x).
The complement of the fuzzy set A is often
denoted by A.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Example 1
The fuzzy set A SMALL
SMALL = FuzzySet {{1, 1 }, {2, 1 }, {3, 0.9}, {4, 0.6},
{5, 0.4}, {6, 0.3}, {7, 0.2}, {8, 0.1}, {9, 0 }, {10, 0 },
{11, 0}, {12, 0}}
The fuzzy set A NOTSMALL
NOTSMALL = FuzzySet {{1, 0 }, {2, 0 }, {3, 0.1}, {4,
0.4}, {5, 0.6}, {6, 0.7}, {7, 0.8}, {8, 0.9}, {9, 1 }, {10,
1 }, {11, 1}, {12, 1}}

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
The Fuzzy Operation : Compliment
NOTSMALL = Compliment [SMALL]

Graphic Interpretation of Fuzzy Compliment


FuzzyPlot [SMALL, NOTSMALL]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Example 2
The empty set and the universal set X, as fuzzy
sets, are complements of one another.
The fuzzy set B EMPTY
Empty = FuzzySet {{1, 0 }, {2, 0 }, {3, 0}, {4, 0}, {5, 0},
{6, 0}, {7, 0}, {8, 0}, {9, 0 }, {10, 0 }, {11, 0}, {12, 0}}
The fuzzy set A UNIVERSAL
Universal = FuzzySet {{1, 1 }, {2, 1 }, {3, 1}, {4, 1}, {5,
1}, {6, 1}, {7, 1}, {8, 1}, {9, 1 }, {10, 1 }, {11, 1}, {12,
1}}

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
The fuzzy operation : Compliment
EMPTY = Compliment [UNIVERSALSPACE]

Graphic Interpretation of Fuzzy Compliment


FuzzyPlot [EMPTY, UNIVERSALSPACE]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Union
Let A and B be fuzzy sets defined in the space
X.
The union is defined as the smallest fuzzy set
that contains both A and B.
The union of A and B is denoted by A B.
The following relation must be satisfied for the
union operation :
for all x in the set X, (A B)(x) = Max (A(x), B(x)).
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Example 1
Union of Fuzzy A and B
A(x) = 0.6 and B(x) = 0.4
(A B)(x) = max [0.6, 0.4] = 0.6

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Example 2
Union of SMALL and MEDIUM
The fuzzy set A SMALL
SMALL = FuzzySet {{1, 1 }, {2, 1 }, {3, 0.9}, {4, 0.6},
{5, 0.4}, {6, 0.3}, {7, 0.2}, {8, 0.1}, {9, 0 }, {10, 0 },
{11, 0}, {12, 0}}
The fuzzy set B MEDIUM
MEDIUM = FuzzySet {{1, 0 }, {2, 0 }, {3, 0}, {4, 0.2},
{5, 0.5}, {6, 0.8}, {7, 1}, {8, 1}, {9, 0.7 }, {10, 0.4 },
{11, 0.1}, {12, 0}}

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
The fuzzy operation : Union
FUZZYUNION = [SMALL MEDIUM]
SetSmallUNIONMedium = FuzzySet
[{{1,1},{2,1}, {3,0.9}, {4,0.6}, {5,0.5}, {6,0.8},
{7,1}, {8, 1}, {9, 0.7}, {10, 0.4}, {11, 0.1}, {12,
0}} , UniversalSpace {1, 12, 1}]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Graphic Interpretation of Fuzzy Union
FuzzyPlot [UNION]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Intersection
Let A and B be fuzzy sets defined in the space
X.
The intersection is defined as the greatest
fuzzy set included both A and B.
The intersection of A and B is denoted by A
B.
The following relation must be satisfied for the
union operation :
for all x in the set X, (A B)(x) = Min (A(x), B(x)).
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Example 1
Intersection of Fuzzy A and B
A(x) = 0.6 and B(x) = 0.4 (A n B)(x) = min [0.6,
0.4] = 0.4

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Example 2
Union of SMALL and MEDIUM
The fuzzy set A SMALL
SMALL = FuzzySet {{1, 1 }, {2, 1 }, {3, 0.9}, {4, 0.6},
{5, 0.4}, {6, 0.3}, {7, 0.2}, {8, 0.1}, {9, 0 }, {10, 0 },
{11, 0}, {12, 0}}
The fuzzy set B MEDIUM
MEDIUM = FuzzySet {{1, 0 }, {2, 0 }, {3, 0}, {4, 0.2},
{5, 0.5}, {6, 0.8}, {7, 1}, {8, 1}, {9, 0.7 }, {10, 0.4 },
{11, 0.1}, {12, 0}}

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
The fuzzy operation : Intersection
FUZZYINTERSECTION = min [SMALL n
MEDIUM]
SetSmallINTERSECTIONMedium = FuzzySet
[{{1,0},{2,0}, {3,0}, {4,0.2}, {5,0.4}, {6,0.3},
{7,0.2}, {8, 0.1}, {9, 0}, {10, 0}, {11, 0}, {12, 0}} ,
UniversalSpace {1, 12, 1}]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Graphic Interpretation of Fuzzy Intersection
FuzzyPlot [INTERSECTION]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Cardinality
Cardinality of a non-fuzzy set, Z, is the number of elements in Z.
BUT the cardinality of a fuzzy set A
is expressed as a SUM of the values of the membership function of
A, A(x):
cardA = A(x1) + A(x2) + A(xn) = A(xi), for i=1..n

Consider X = {1, 2, 3} and sets A and B

A = 0.3/1 + 0.5/2 + 1/3;


B = 0.5/1 + 0.55/2 + 1/3

cardA = 1.8
cardB = 2.05

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Ele- Infant Adult Young Old
ments

5 0 0 1 0

10 0 0 1 0

20 0 .8 .8 .1

30 0 1 .5 .2

40 0 1 .2 .4

50 0 1 .1 .6

60 0 1 0 .8

70 0 1 0 1

80 0 1 0 1

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Empty Fuzzy Set
A fuzzy set A is empty, IF AND ONLY IF:
A(x) = 0, xX

Consider X = {1, 2, 3} and set A

A = 0/1 + 0/2 + 0/3

then A is empty
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Alpha-cut/Strong Alpha-cut
An -cut or -level set of a fuzzy set A X is an ORDINARY SET A X, such that:
A={A(x), xX}.
A Strong -cut or -level set of a fuzzy set A X is an ORDINARY SET A+ X, such
that:
A+={A(x)>, xX}.

Consider X = {1, 2, 3} and set A

A = 0.3/1 + 0.5/2 + 1/3

then A0.5 = {2, 3},


A0.1 = {1, 2, 3},
A1 = {3}
A0.5+ = {2, 3},
A0.1+ = {1, 2, 3},
A1+ = { }

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy Set Normality
A fuzzy subset of X is called normal if there exists at least
one element xX such that A(x) = 1.

A fuzzy subset that is not normal is called subnormal.

All crisp subsets except for the null set are normal. In fuzzy
set theory, the concept of nullness essentially generalises
to subnormality.

The height of a fuzzy subset A is the large membership


grade of an element in A
height(A) = maxx(A(x))

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy Sets Core and Support
Assume A is a fuzzy subset of X:

the support of A is the crisp subset of X consisting


of all elements with membership grade:
supp(A) = {x A(x) 0 and xX}

the core of A is the crisp subset of X consisting of


all elements with membership grade:
core(A) = {x A(x) = 1 and xX}
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Fuzzy Set Math Operations
aA = {aA(x), xX}
Let a =0.5, and
A = {0.5/a, 0.3/b, 0.2/c, 1/d}
then
Aa = {0.25/a, 0.15/b, 0.1/c, 0.5/d}

Aa = {A(x)a, xX}
Let a =2, and
A = {0.5/a, 0.3/b, 0.2/c, 1/d}
then
Aa = {0.25/a, 0.09/b, 0.04/c, 1/d}

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy Sets Examples
Consider two fuzzy subsets of the set X,
X = {a, b, c, d, e }

referred to as A and B

A = {1/a, 0.3/b, 0.2/c 0.8/d, 0/e}


and
B = {0.6/a, 0.9/b, 0.1/c, 0.3/d, 0.2/e}
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Support:
supp(A) = {a, b, c, d }
supp(B) = {a, b, c, d, e }

Core:
core(A) = {a}
core(B) = {o}

Cardinality:
card(A) = 1+0.3+0.2+0.8+0 = 2.3
card(B) = 0.6+0.9+0.1+0.3+0.2 = 2.1

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Complement:
A = {1/a, 0.3/b, 0.2/c 0.8/d, 0/e}
A = {0/a, 0.7/b, 0.8/c 0.2/d, 1/e}

Union:
A B = {1/a, 0.9/b, 0.2/c, 0.8/d, 0.2/e}

Intersection:
A B = {0.6/a, 0.3/b, 0.1/c, 0.3/d, 0/e}

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
aA:
for a=0.5
aA = {0.5/a, 0.15/b, 0.1/c, 0.4/d, 0/e}

Aa:
for a=2
Aa = {1/a, 0.09/b, 0.04/c, 0.64/d, 0/e}

a-cut:
A0.2 = {a, b, c, d}
A0.3 = {a, b, d}
A0.8 = {a, d}
A1 = {a}

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Properties of Standard Fuzzy
Operators
Suppose U is the universe of discourse and
F, and G are fuzzy sets defined on U.
1) Involution : (Fc)c = F
2) Commutative : F G = G F
FG=GF
3) Associativity : F (G H) = (F G) H
F (G H) = (F G) H
4) Distributivity : F (G H) = (F G) (F H)
F (G H) = (F G) (F H)
5) Idempotency : F F = F
FF=F
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
6) Absorption :
F (F G) = F F (F G ) = F
7) Absorption by and U :
F = , F U = U
8) Identity :
F =F F U=F
9) DeMorgans Law:
(F G) C= FC GC (F G) C= FC GC
10) Equivalence :
(FC G) (F GC) = (FC GC) (F G)
11) Symmetrical difference:
(FC G) (F GC) = (FC GC) (F G)
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Note: The two conventional identity do not
satisfy in standard operation;
Law of contradiction : F FC =
Law of excluded middle : F FC = U

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Interval-valued fuzzy sets: a fuzzy set whose
membership functions does not assign to each
element of the universal set one real number,
but a closed interval of real numbers
between the identified lower and upper
bounds.
A : X ([0,1]),
Power set

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Fuzzy sets of type 2:

: the set of all ordinary fuzzy sets that can be defined with the
universal set [0,1].
: is also called a fuzzy power set of [0,1].

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Level 2 fuzzy sets:

: the fuzzy power set of X.


Level 2 fuzzy sets allow us to deal with situations in which
elements of the universal set cannot be specified precisely,
but only approximately.
For example:
Assuming that the proposition x is close to r is represented by an
ordinary fuzzy set B, the membership grade of a value of x that is
known to be close to r in the level 2 fuzzy sets A is given by A(B).

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy sets of type 2 and level 2:

: the fuzzy power set of X.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
CARTESIAN PRODUCT
A = {0, 1}
B = {a, b, c}

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
CRISP RELATIONS
A subset of the Cartesian product A1 A2
Ar is called an r-aray relation over
A1,A2, . . . ,Ar.
The Cartesian product of two universes X and
Y is determined as

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Operations on Crisp Relations

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Composition
maxmin composition

maxproduct composition

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Example

maxmin composition:

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
FUZZY RELATIONS
The strength of the relation between
ordered pairs of the two universes is not
measured with the characteristic function, but
rather with a membership function expressing
various degrees of strength of the relation
on the unit interval.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Operations On Fuzzy relations

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy Cartesian Product and
Composition

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy Composition Example
Let the two relations R and S be, respectively:

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
MAX-MIN Composition

max{min(0.4,0.5), min(0.6, 0.1), min(0, 0)}


= max{ 0.4, 0.1, 0} = 0.4
max{min(0.4,0.8), min(0.6, 1), min(0, 0.6)}
= max{ 0.4, 0.6, 0} = 0.6
max{min(0.9,0.5), min(1, 0.1), min(0.1, 0)}
= max{ 0.5, 0.1, 0} = 0.5
max{min(0.9,0.8), min(1, 1), min(0.1, 0.6)}
= max{ 0.8, 1, 0.1} = 1

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
MAX-PRODUCT Composition

max{0.40.5, 0.60.1, 00} = max{0.2,0.06,0} = 0.2


max{0.40.8, 0.61, 00.6} = max{0.32, 0.6, 0} = 0.6
max{0.90.5, 10.1, 0.10} = max{0.45, 0.1, 0} = 0.45
max{0.90.8, 11, 0.10.6} = max{0.72, 1, 0.06} = 1

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Example

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
fuzzy maxmin composition

fuzzy maxproduct composition

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Crisp Equivalence Relation

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Crisp Tolerance Relation

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy tolerance and equivalence
relations

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Other forms of the composition
operation

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy Rules
In 1973, Lotfi Zadeh published his second most influential paper.
This paper outlined a new approach to analysis of complex systems,
in which Zadeh suggested capturing human knowledge in fuzzy
rules.

A fuzzy rule can be defined as a conditional statement in the form:

IF x is A
THEN y is B

where x and y are linguistic variables; and A and B are linguistic


values determined by fuzzy sets on the universe of discourses X and
Y, respectively.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Classical Vs Fuzzy Rules
A classical IF-THEN rule uses binary logic, for example,

Rule: 1
IF speed is > 100
THEN stopping_distance is long
Rule: 2
IF speed is < 40
THEN stopping_distance is short

The variable speed can have any numerical value between 0


and 220 km/h, but the linguistic variable stopping_distance
can take either value long or short. In other words, classical
rules are expressed in the black-and-white language of
Boolean logic.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
We can also represent the stopping distance rules in a fuzzy form:
Rule: 1
IF speed is fast
THEN stopping_distance is long
Rule: 2
IF speed is slow
THEN stopping_distance is short
In fuzzy rules, the linguistic variable speed also has the range (the
universe of discourse) between 0 and 220 km/h, but this range
includes fuzzy sets, such as slow, medium and fast. The universe of
discourse of the linguistic variable stopping_distance can be
between 0 and 300 m and may include such fuzzy sets as short,
medium and long. Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Fuzzy rules relate fuzzy sets.

In a fuzzy system, all rules fire to some extent,


or in other words they fire partially. If the
antecedent is true to some degree of
membership, then the consequent is also true
to that same degree.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Firing Fuzzy Rules
These fuzzy sets provide the basis for a weight estimation model. The
model is based on a relationship between a mans height and his weight:
IF height is tall
THEN weight is heavy

Degree of Degree of
Membership Membership
1.0 1.0
Tall men Heavy men
0.8 0.8

0.6 0.6

0.4 0.4
0.2 0.2

0.0 0.0
160 180 190 200 70 80 100 120
Dr Deepti
Height, cmGupta CSE, UIET, Panjab Weight, kg
University, Chandigarh
The value of the output or a truth membership grade of the rule
consequent can be estimated directly from a corresponding truth
membership grade in the antecedent. This form of fuzzy inference uses a
method called monotonic selection.

Degree of Degree of
Membership Membership
1.0 1.0
Tall men
0.8 0.8 Heavy men
0.6 0.6

0.4 0.4

0.2 0.2

0.0 0.0
160 180 190 200 70 80 100 120
Height, cm Weight, kg
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
A fuzzy rule can have multiple antecedents, for example:
IF project_duration is long
AND project_staffing is large
AND project_funding is inadequate
THEN risk is high
IF service is excellent
OR food is delicious
THEN tip is generous

The consequent of a fuzzy rule can also include multiple parts,


for instance:
IF temperature is hot
THEN hot_water is reduced;
cold_water is increased

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Air-conditioning Example
Air-conditioning involves the delivery of air which can be warmed
or cooled and have its humidity raised or lowered.

An air-conditioner is an apparatus for controlling, especially


lowering, the temperature and humidity of an enclosed space. An
air-conditioner typically has a fan which blows/cools/circulates
fresh air and has cooler and the cooler is under thermostatic
control. Generally, the amount of air being compressed is
proportional to the ambient temperature.

Consider Johnnys air-conditioner which has five control switches:


COLD, COOL, PLEASANT, WARM and HOT. The corresponding
speeds of the motor controlling the fan on the air-conditioner has
the graduations: MINIMAL, SLOW, MEDIUM, FAST and BLAST.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
The rules governing the air-conditioner are as follows:
RULE 1:
IF TEMP is COLD THEN SPEED is MINIMAL

RULE 2:
IF TEMP is COOL THEN SPEED is SLOW

RULE 3:
IF TEMP is PLEASANT THEN SPEED is MEDIUM

RULE 4:
IF TEMP is WARM THEN SPEED is FAST

RULE 5:
IF TEMP is HOT THEN SPEED is BLAST

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
The temperature graduations are Temp COLD COOL PLEASANT WARM HOT
related to Johnnys perception of (0C).

ambient temperatures. 0 Y* N N N N

5 Y Y N N N

where: 10 N Y N N N

Y : temp value belongs to the set 12.5 N Y* N N N


(0<A(x)<1) 15 N Y N N N

17.5 N N Y* N N
Y* : temp value is the ideal 20 N N N Y N
member to the set (A(x)=1)
22.5 N N N Y* N

25 N N N Y N
N : temp value is not a member
of the set (A(x)=0)
27.5 N N N N Y

30 N N N N Y*
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Johnnys perception of the speed Rev/sec MINIMAL SLOW MEDIUM FAST BLAST
of the motor is as follows: (RPM)
0 Y* N N N N

10 Y N N N N
where: 20 Y Y N N N
Y : temp value belongs to the set 30 N Y* N N N
(0<A(x)<1) 40 N Y N N N

50 N N Y* N N
Y* : temp value is the ideal 60 N N N Y N
member to the set (A(x)=1) 70 N N N Y* N

80 N N N Y Y

N : temp value is not a member 90 N N N N Y

of the set (A(x)=0) 100 N N N N Y*

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
The analytically expressed membership for the reference fuzzy subsets for
the temperature are:

COLD:
for 0 t 10 COLD(t) = t / 10 + 1

COOL:
for 0 t 12.5 COOL(t) = t / 12.5
for 12.5 t 17.5 COOL(t) = t / 5 + 3.5

etc all based on the linear equation:


y = ax + b

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Temperature Fuzzy Sets
1
0.9
0.8 Cold
Truth Value

0.7
0.6 Cool
0.5 Pleasent
0.4
0.3 Warm
0.2 Hot
0.1
0
0 5 10 15 20 25 30

Temperature Degrees C

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
The analytically expressed membership for the reference fuzzy subsets for
the temperature are:

MINIMAL:
for 0 v 30 MINIMAL(v) = v / 30 + 1

SLOW:
for 10 v 30 SLOW(v) = v / 20 0.5
for 30 v 50 SLOW(v) = v / 20 + 2.5

etc all based on the linear equation:


y = ax + b

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Speed Fuzzy Sets

1
0.8 MINIMAL
Truth Value

0.6 SLOW
MEDIUM
0.4
FAST
0.2 BLAST
0
0 10 20 30 40 50 60 70 80 90 100
Speed

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
To implement fuzzy logic technique to a real
application requires the following three steps:
Fuzzification convert classical data or crisp data into
fuzzy data or Membership Functions (MFs)
Fuzzy Inference Process combine membership
functions with the control rules to derive the fuzzy
output
Defuzzification use different methods to calculate
each associated output and put them into a table: the
lookup table. Pick up the output from the lookup table
based on the current input during an application
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Fuzzification
derive the membership functions for input
and output variables
represent them with linguistic variables

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
air conditioner
example
Assume that we have an air conditioner
control system that is under the control of
only a heater.
If the temperature is high, the heater control
motor should be turned off, and
if the temperature is low, that heater motor
should be turned on, which are common
sense.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Regularly, the normal temperature range is
from 200 F to 900 F. This range can be further
divided into three sub-range or subset, which
are
Low temperature: 200 F ~ 400 F, 300 F is center
Medium temperature: 300 F ~ 800 F, 550 F is
center
High temperature: 600 F ~ 900 F, 750 F is
center
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Next those three ranges need to be converted
to linguistic variables: LOW, MEDIUM and
HIGH, which correspond to the three
temperature ranges.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Fuzzy Control Rules
Fuzzy control rule can be considered as the knowledge
of an expert in any related field of application.
The fuzzy rule is represented by a sequence of the form
IF- THEN, leading to algorithms describing what action
or output should be taken in terms of the currently
observed information, which includes both input and
feedback if a closed-loop control system is applied.
The law to design or build a set of fuzzy rules is based
on a human beings knowledge or experience, which is
dependent on each different actual application.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
A fuzzy IF-THEN rule associates a condition
described using linguistic variables and fuzzy sets
to an output or a conclusion.
The IF part is mainly used to capture knowledge
by using the elastic conditions, and the THEN part
can be utilized to give the conclusion or output in
linguistic variable form.
This IF-THEN rule is widely used by the fuzzy
inference system to compute the degree to which
the input data matches the condition of a rule.
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
M(T, LOW) = Support min(T(x), LOW(x))
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Fuzzy Sets = { Negative, Zero, Positive }

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Crisp Input: x = 0.25
Fzero(0.25)=?
Fpositive(0.25)=?
Fnegative(0.25)=?

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy Mapping Rules
provide a functional mapping between the input and
the output using linguistic variables.
The foundation of a fuzzy mapping rule is a fuzzy
graph, which describes the relationship between the
fuzzy input and the fuzzy output.
Sometimes, in real applications, it is very hard to derive
a certain relationship between the input and the
output, or the relationship between those inputs and
outputs are very complicated even when that
relationship is developed.
Fuzzy mapping rules are a good solution for those
situations.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy mapping rules work in a similar way to
human intuition or insight, and each fuzzy
mapping rule only approximates a limited
number of elements of the function, so the
entire function should be approximated by a
set of fuzzy mapping rules.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
IF the temperature is LOW, THEN the heater motor
should be rotated FAST.
For other input temperatures, different rules should be
developed.
For most actual applications, the input variables are
commonly more than one dimension.
For example, in air conditioner system, the inputs
include both current temperature and the change rate
of the temperature.
The fuzzy control rules should also be extended to
allow multiple inputs to be considered to derive the
output.
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Fuzzy Implication Rules
A fuzzy implication rule describes a generalized logic
implication relationship between inputs and outputs.
Fuzzy implication rules are related to classical two-
valued logic and multiple valued logic.
The implication is:
IF the temperature is LOW, THEN the heater motor
should be FAST.
Based on this implication and a fact: the temperature is
HIGH. The result that the heater motor should slow
down or the SLOW can be inferred.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Defuzzification and the Lookup Table
The conclusion or control output derived from
the combination of input, output membership
functions and fuzzy rules is still a vague or fuzzy
element, and this process in called fuzzy
inference.
To make that conclusion or fuzzy output available
to real applications, a defuzzification process is
needed.
The defuzzification process is meant to convert
the fuzzy output back to the crisp or classical
output to the control objective.
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Defuzzification techniques
Mean of Maximum method (MoM)
Center of Gravity method (CoG)
Height method (HM)

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Mean of Maximum (MOM) Method
It computes the average of those fuzzy conclusions or
outputs that have the highest degrees.
For example, the fuzzy conclusion is: the heater motor x
is rotated FAST.
By using the MOM method, this defuzzification can be
expressed as

where T is the set of output x that has the highest


degrees in the set FAST.
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Drawback of MoM method
It does not consider the entire shape of the
output membership function, and it only takes
care of the points that have the highest
degrees in that function.
For those membership functions that have
different shapes but the same highest
degrees, this method will produce the same
result.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Center of Gravity (COG) Method
The Center of Gravity method (COG) is the most
popular defuzzification technique and is widely
utilized in actual applications.
This method is similar to the formula for
calculating the center of gravity in physics.
The weighted average of the membership
function or the center of the gravity of the area
bounded by the membership function curve is
computed to be the most crisp value of the fuzzy
quantity.
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
For example, for the conclusion: the heater
motor x is rotated FAST. The COG output can
be represented as

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
If x is a continuous variable, this
defuzzification result is

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
The Height Method (HM)
This defuzzification method is valid only for
the case where the output membership
function is an aggregated union result of
symmetrical functions.
This method can be divided into two steps.
First, the consequent membership function Fi
can be converted into a crisp consequent x = fi
where fi is the center of gravity of Fi.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Then the COG method is applied to the rules with crisp
consequents, which can be expressed as

where wi is the degree to which the ith rule matches the input
data.
The advantage of this method is its simplicity.
Many neuro-fuzzy models use this defuzzification method to
reduce the complex of calculations.
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
1. Fuzzification
Rule: 1 IF x is A3 OR y is B1 THEN z is C1
Rule: 2 IF x is A2 AND y is B2 THEN z is C2
Rule: 3 IF x is A1 THEN z is C3
Take the crisp inputs, x1 and y1 and determine the degree to which these inputs
belong to each of the appropriate fuzzy sets.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
2. Rule Evaluation
Take the fuzzified inputs, (x=A1) = 0.5,
(x=A2) = 0.2, (y=B1) = 0.1 and (y=B2) = 0.7,
and apply them to the antecedents of the
fuzzy rules.
If a given fuzzy rule has multiple antecedents,
the fuzzy operator (AND or OR) is used to
obtain a single number that represents the
result of the antecedent evaluation.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
The result of the antecedent evaluation can be applied to the membership
function of the consequent.
Clipping
Scaling

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Clipping: Cut the consequent membership function at the
level of the antecedent truth.
The clipped fuzzy set loses some information.
However, clipping involves less complex and faster
mathematics, and generates an aggregated output surface
that is easier to defuzzify.
Scaling: Preserves the original shape of the fuzzy set.
The original membership function of the rule consequent is
adjusted by multiplying all its membership degrees by the
truth value of the rule antecedent.
Generally loses less information and can be very useful in
fuzzy expert systems.
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
3. Aggregation of the rule outputs
Aggregation is the process of unification of the
outputs of all rules.
We take the membership functions of all rule
consequents previously clipped or scaled and
combine them into a single fuzzy set.
The input of the aggregation process is the list
of clipped or scaled consequent membership
functions, and the output is one fuzzy set for
each output variable.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
4. Defuzzification
Fuzziness helps us to evaluate the rules, but
the final output of a fuzzy system has to be a
crisp number.
The input for the defuzzification process is the
aggregate output fuzzy set and the output is a
single number.

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
air conditioner system
assume that the membership function of the
change rate of the temperature can be
described as

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
only four rules are applied to this air conditioner system, which
are
IF the temperature is LOW, and the change rate of the
temperature is LOW, THEN the heater motor speed should be
FAST
IF the temperature is MEDIUM, and the change rate of the
temperature is MEDIUM, THEN the heater motor speed should
be SLOW
IF the temperature is LOW, and the change rate of the
temperature is MEDIUM, THEN the heater motor speed should
be FAST
IF the temperature is MEDIUM, and the change rate of the
temperature is LOW, DrTHEN the heater motor speed should be
Deepti Gupta CSE, UIET, Panjab
MEDIUM University, Chandigarh
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Off-line Defuzzification
All input and output membership functions, fuzzy rules and the
lookup table are developed based on the estimations of the real
application prior to the implementation of the fuzzy logic
technique to the actual application.
This means that all input and output membership functions are
developed based on the actual experience or the input and
output parameter ranges of a specified application, and the
lookup table is calculated in terms of those definitions of input
and output membership functions.
Advantage: most fuzzy inference related calculations are
performed prior to the real implementation and therefore the
fuzzy process is less time consuming.
Disadvantage: the fuzzy output is only based on the estimation
of input and output parameters, so the control accuracy is not
Dr Deepti Gupta CSE, UIET, Panjab
high. University, Chandigarh
On-line Defuzzification
Both input and output membership functions are
developed during the real-time processing of an actual
application.
The lookup table elements are calculated in real-time
based on the current actual inputs and outputs.
Only fuzzy rules are developed prior to the real
applications.
Advantage: higher control accuracy can be obtained
for a process and the fuzzy output can be computed in
real-time.
Disadvantage: a longer processing time is needed and
it is a somewhat time-consuming process.
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Fuzzy Decision Making
A set of steps taken to choose a suitable
alternative from those that are needed for
realizing a certain goal.
Determine the set of alternatives
Evaluate alternatives
Compare alternatives

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Set of possible actions
Set of goals
Set of constraints

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Example
An organization is seeking a candidate for a particular job. It
desires to evaluate the candidates with respect to various
factors, namely, qualification, communication skills,
experience, IQ, etc.
Requirements Values
Qualification MSc or equivalent
Communication skills More than average
IQ Average
Problem-solving approach Should be very good
Alertness Should be high
Age Young
Experience Must have enough
Appearance Good
Dr Deepti Gupta CSE, looking
UIET, Panjab
University, Chandigarh
The candidates with the following
qualifications are eligible to apply for the job:
1. BSc,
2. BSc and PGDCA,
3. MSc,
4. MSc and PGDCA,
5. MPhil,
6. PhD

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
For communication skills, IQ and problem-
solving approach, linguistic terms used are:
1. Excellent (E)
2. Very good (VG)
3. Good (G)
4. Average (AV)
5. Fair (F)
6. Bad (B)

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
For alertness and experience, fuzzy terms
considered are:
1. Very high
2. High
3. Medium
4. Low
5. Very low
6. Nil

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
For age, linguistic terms For appearance,
used are: linguistic terms used
1. Very, very young are:
2. Very young 1. Excellent
3. Young 2. Good looking
4. Old 3. Smart
5. Very old 4. Average
6. Very, very old 5. Fair
6. Not good
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh
Fuzzy set for the basic requirement
Qualification: 0.2/1+0.4/2+0.8/3+1/4+0.6/5+0.2/6
Communication skills: 1.0/1+1.0/2+1.0/3+1.0/4+0.8/5+0.2/6
IQ: 1.0/1+1.0/2+1.0/3+1.0/4+0.8/5+0.2/6
Problem-solving approach:
1.0/1+1.0/2+0.9/3+0.7/4+0.4/5+0.0/6
Alertness: 1.0/1+1.0/2+0.8/3+0.6/4+0.4/5+0.0/6
Experience: 0.4/1+0.8/2+1.0/3+0.6/4+0.4/5+0.2/6
Age: 0.6/1+1.0/2+1.0/3+0.8/4+0.4/5+0.2/6
Appearance: 1.0/1+1.0/2+0.8/3+0.5/4+0.3/5+0.1/6

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy set for the deciding factors
Qualification:
1. BSc: 1.0/1+0.8/2+0.6/3+0.2/4+0.2/5+0.2/6
2. BSc and PGDCA: 0.8/1+1.0/2+0.6/3+0.4/4+0.2/5+0.2/6
3. MSc: 0.2/1+0.4/2+1.0/3+0.6/4+0.4/5+0.2/6
4. MSc and PGDCA: 0.2/1+0.6/2+0.8/3+1.0/4+0.4/5+0.2/6
5. Mphil: 0.0/1+0.2/2+0.4/3+0.6/4+1.0/5+0.4/6
6. PhD: 0.0/1+0.0/2+0.2/3+0.4/4+0.8/5+1.0/6

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Communication skills, IQ and problem-solving
approach:
1. Excellent: 1.0/1+0.8/2+0.6/3+0.4/4+0.2/5+0.0/6
2. Very good: 0.8/1+1.0/2+0.6/3+0.4/4+0.2/5+0.0/6
3. Good: 0.6/1+0.8/2+1.0/3+0.6/4+0.4/5+0.2/6
4. Average:0.4/1+0.6/2+0.8/3+1.0/4+0.6/5+0.2/6
5. Fair: 0.2/1+0.4/2+0.6/3+0.8/4+1.0/5+0.4/6
6. Bad:0.0/1+0.2/2+0.4/3+0.6/4+0.8/5+1.0/6

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Alertness and experience:
1. Very high: 1.0/1+0.8/2+0.4/3+0.2/4+0.6/5+0.0/6
2. High: 0.8/1+1.0/2+0.6/3+0.4/4+0.2/5+0.0/6
3. Medium: 0.4/1+0.6/2+1.0/3+0.4/4+0.2/5+0.0/6
4. Low: 0.0/1+0.2/2+0.6/3+1.0/4+0.8/5+0.2/6
5. Very low: 0.0/1+0.0/2+0.4/3+0.8/4+1.0/5+0.4/6
6. Nil: 0.0/1+0.0/2+0.0/3+0.2/4+0.4/5+1.0/6

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Age:
1. Very, very young: 1.0/1+0.8/2+0.4/3+0.2/4+0.0/5+0.0/6
2. Very young: 0.8/1+1.0/2+0.6/3+0.2/4+0.0/5+0.0/6
3. Young: 0.2/1+0.6/2+1.0/3+0.4/4+0.2/5+0.0/6
4. Old: 0.2/1+0.4/2+0.6/3+1.0/4+0.2/5+0.0/6
5. Very old: 0.0/1+0.0/2+0.2/3+0.4/4+1.0/5+0.4/6
6. Very, very old: 0.0/1+0.0/2+0.0/3+0.4/4+0.8/5+1.0/6

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Appearance:
1. Excellent: 1.0/1+0.8/2+0.6/3+0.4/4+0.2/5+0.0/6
2. Good looking: 0.8/1+1.0/2+0.8/3+0.6/4+0.4/5+0.2/6
3. Smart: 0.4/1+0.6/2+1.0/3+0.6/4+0.4/5+0.2/6
4. Average: 0.4/1+0.4/2+0.6/3+1.0/4+0.6/5+0.2/6
5. Fair: 0.0/1+0.2/2+0.2/3+0.6/4+1.0/5+0.4/6
6. Not good: 0.0/1+0.2/2+0.4/3+0.6/4+0.8/5+1.0/6

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy opinion matrix

c1 c2 c3 c4 c5 c6
e1 E G F VG B G
e2 VG AV B VG AV VG
e3 G AV B VG AV VG
e4 G AV B E B E
e5 G F A G F G
e6 VG VG F G G G

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Estimation of the Fuzzy hamming distance between the
requirement set and the opinion set for each candidate with
respect to each factor.
The overall opinion about each candidate can be obtained by
considering the relevant column for that candidate.
Example: for candidate 1, the overall opinion of the experts with
respect to communication skills is
O=0.6/1+0.8/2+0.6/3+0.4/4+0.2/5+0.0/6
The requirement set for communication skills is
R=1.0/1+1.0/2+1.0/3+1.0/4+0.8/5+0.2/6
The fuzzy hamming distance between the two sets is given as
6
d(O,R)=
| (x )
i 1
o i R (xi ) | 2.4

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy distance set for communication
skills

c1 c2 c3 c4 c5 c6
fCS = [2.4 3.2 3.2 2.4 3.2 2.4 ]

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Fuzzy distance matrix
c1 c2 c3 c4 c5 c6
Qualification 2.4 2.0 2.4 2.0 2.4 2.4
Communication 2.4 3.2 3.2 2.4 3.2 2.4
Skills
IQ 2.4 3.8 3.2 2.4 3.2 3.8
Alertness 2.2 2.6 3.4 1.6 2.4 3.4
Experience 1.8 1.8 2.6 1.2 2.0 3.2
Age 3.6 2.6 3.0 2.6 2.8 2.8
Appearance 1.5 2.1 1.9 2.1 2.7 2.1
Problem-solving 1.4 2.2 3.2 1.4 2.2 1.8
approach

Dr Deepti Gupta CSE, UIET, Panjab


University, Chandigarh
Conclusion/Final decision(fuzzy)
If the fuzzy opinion set is very close to the
requirement set, the hamming distance will be
very less.
A vector that contains the minimum distance
values for each candidate with respect to all
the factors is
c1 c2 c3 c4 c5 c6
V = [1.4 1.8 1.9 1.2 2.0 1.8]
Dr Deepti Gupta CSE, UIET, Panjab
University, Chandigarh

S-ar putea să vă placă și