Professional Documents
Culture Documents
Fuzzy Logic & Fuzzy Sets: Siti Zaiton Mohd Hashim, PHD
Fuzzy Logic & Fuzzy Sets: Siti Zaiton Mohd Hashim, PHD
2
What is fuzzy thinking?
Experts rely on common sense when they solve
problems.
How can we represent expert knowledge that
uses vague and ambiguous terms in a computer?
Fuzzy logic is not logic that is fuzzy, but logic that
is used to describe fuzziness. Fuzzy logic is the
theory of fuzzy sets, sets that calibrate vagueness.
Fuzzy logic is based on the idea that all things
admit of degrees. Temperature, height, speed,
distance, beauty all come on a sliding scale. The
motor is running really hot.
hot. Tom is a very tall guy.
3
Boolean logic uses sharp distinctions. It forces us
to draw lines between members of a class and non-
non-
members. For instance, we may say, Tom is tall
because his height is 181 cm. If we drew a line at
180 cm, we would find that David, who is 179 cm,
is short. Is David really a short man or we have
just drawn an arbitrary line in the sand?
Fuzzy logic reflects how people think. It attempts
to model our sense of words, our decision making
and our common sense. As a result, it is leading to
new, more human, intelligent systems.
4
In 1965 Lotfi Zadeh
Zadeh,, published his famous paper
“Fuzzy sets”.
Zadeh extended the work on possibility theory into
a formal system of mathematical logic, and
introduced a new concept for applying natural
language terms.
This new logic for representing and manipulating
fuzzy terms was called fuzzy logic,
logic, and Zadeh
became the Master/Father of fuzzy logic.
logic.
5
Why fuzzy?
As Zadeh said, the term is concrete, immediate and
descriptive. However, many people in the West
were repelled by the word fuzzy
fuzzy,, because it is
usually used in a negative sense.
Why logic?
Fuzziness rests on fuzzy set theory, and fuzzy logic
is just a small part of that theory. Zadeh used the
term fuzzy logic in a broader sense.
6
What is fuzzy logic?
Unlike two-
two-valued Boolean logic, fuzzy logic is
multi--valued
multi valued.. It deals with degrees of
membership and degrees of truth.
truth.
7
Range of logical values in
Boolean and fuzzy logic
10
D e gre e o f M e m b e rs h ip
N ame H e ig h t, c m
C r is p F u zzy
C hr is 208 1 1 .0 0
M a rk 205 1 1 .0 0
Jo h n 198 1 0 .9 8
To m 181 1 0 .8 2
D a v id 179 0 0 .7 8
M ik e 172 0 0 .2 4
Bob 167 0 0 .1 5
S te v e n 158 0 0 .0 6
B ill 155 0 0 .0 1
P e te r 152 0 0 .0 0
Crisp set asks the question: Is the man tall?
Tall men are above 180, and not tall men are below 180.
Fuzzy set asks the question: How tall is the man?
The tall is partial membership in the fuzzy set, Tom is 0.82
tall.
11
Crisp and fuzzy sets of “tall
“tall men”
men”
Degree of
Crisp Sets
Membership
1.0
0.8
Tall Men
0.6
0.4
0.2
0.0
150 160 170 180 190 200 210
Height, cm
Degree of
Fuzzy Sets
Membership
1.0
0.8
0.6
0.4
0.2
0.0
150 160 170 180 190 200 210
Height, cm
12
Fuzzy sets of “tall
“tall men”
men”
14
Fuzzy set definition
15
A(x): X [0, 1], where A(x) = 1 if x is totally in A;
A(x) = 0 if x is not in A;
0 < A(x) < 1 if x is partly in A.
17
Crisp and fuzzy sets of short, average
and tall men
Degree of Crisp Sets
Membership
1.0
0.4
0.2
0.0
150 160 170 180 190 200 210
Height, cm
Degree of Fuzzy Sets
Membership
1.0
0.8
0.4
0.2 Tall
0.0
150 160 170 180 190 200 210
18
Representation of crisp and
fuzzy subsets
(x)
X Fuzzy S ubset A
1
0
Crisp S ubset A Fuzziness Fuzziness x
20
Linguistic variables
At the root of fuzzy set theory lies the idea of
linguistic variables.
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
tall..
21
Linguistic variables
In fuzzy expert systems, linguistic variables are used
in fuzzy rules. For example:
IF wind is strong
THEN sailing is good
IF project_duration is long
THEN completion_risk is high
IF speed is slow
THEN stopping_distance is short
22
Linguistic variables
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, slow
slow,, medium
medium,, fast
fast,, and
very fast.
fast.
23
Hedges in Fuzzy Logic
A linguistic variable carries with it the concept of
fuzzy set qualifiers, called hedges
hedges..
Hedges are terms that modify the shape of fuzzy
sets. They include adverbs such as very very,,
somewhat,, quite
somewhat quite,, more or less and slightly
slightly..
24
Fuzzy sets with the hedge very
Degree of
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
25
Representation of hedges in
fuzzy logic
Hedge Mathematical Graphical Representation
Expression
26
Representation of hedges in
fuzzy logic (continued)
Hedge Mathematical Graphical Representation
Expression
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 < A 1
27
Operations of fuzzy sets
The classical set theory developed in the late 19th
century by Georg Cantor describes how crisp sets can
interact. These interactions are called operations
operations..
Cantor’s sets
Not A
B
A AA
Complement Containment
A B AA B
Intersection Union
29
Complement
Crisp Sets
Sets:: Who does not belong to the set?
Fuzzy Sets
Sets:: How much do elements not belong to the set?
• The complement of a set is an opposite of this set.
• For example, if we have the set of tall men,
men, its complement
is the set of NOT tall men.
men. When we remove the tall men
set from the universe of discourse, we obtain the
complement.
• If A is the fuzzy set, its complement A can be found as
follows:
A(x) = 1 A(x)
• Question:
Question: If the fuzzy set of tall men is as follows, what is its
complement?
tall men = (0/180
180,, 0.25
25//182
182..5, 0.5/185
185,, 0.75
75//187
187..5, 1/190
190))
30
Containment
Crisp Sets
Sets:: Which sets belong to which other sets?
Fuzzy Sets
Sets:: Which sets belong to other sets?
• A set can contain other sets. The smaller set is called the
subset..
subset
• For example, the set of tall men contains all tall men; very
tall men is a subset of tall men.
men. However, the tall men set is
just a subset of the set of men
men..
• In crisp sets, all elements of a subset entirely belong to a larger
set.
• In fuzzy sets, however, each element can belong less to the
subset than to the larger set. Elements of the fuzzy subset have
smaller memberships in it than in the larger set.
• Question
Question:: If the set of tall men is as follows, which sets
belong to very tall men ?
tall men = (0/180
180,, 0.25
25//182
182..5, 0.5/185
185,, 0.75
75//187
187..5, 1/190
31
Intersection
Crisp Sets
Sets:: Which element belongs to both sets?
Fuzzy Sets
Sets:: How much of the element is in both sets?
• In classical set theory, an intersection between two sets
contains the elements shared by these sets.
• For example, the intersection of the set of tall men and the
set of fat men is the area where these sets overlap.
• In fuzzy sets, an element may partly belong to both sets with
different memberships. A fuzzy intersection is the lower
membership in both sets of each element.
• The fuzzy intersection of two fuzzy sets A and B on
universe of discourse X:
AB(x) = min [A(x), B(x)] = A(x) B(x),
where xX
32
Intersection
• Question:
Question: Consider, the set of tall and average man are as
follows, what is the intersection of these two sets?
sets
tall men = (0/165, 0/175, 0/180, 0.25/182.5, 0.5/185, 1/190)
Average men = (0/165, 1/175, 0.5/180, 0.25/182.5, 0/185,
0/190))
0/190
33
Union
Crisp Sets
Sets:: Which element belongs to either set?
Fuzzy Sets:
Sets: How much of the element is in either set?
• The union of two crisp sets consists of every element that falls
into either set.
• For example, the union of tall men and fat men contains all
men who are tall OR fat.
• In fuzzy sets, the union is the reverse of the intersection. That is,
the union is the largest membership value of the element in
either set.
• The fuzzy operation for forming the union of two fuzzy sets
A and B on universe X can be given as:
AB(x) = max [A(x), B(x)] = A(x) B(x),
where xX
34
Union
• Question:
Question: Consider, the set of tall and average man are as
follows, what is the union of these two sets?
sets
tall men = (0/165, 0/175, 0/180, 0.25/182.5, 0.5/185, 1/190)
Average men = (0/165, 1/175, 0.5/180, 0.25/182.5, 0/185,
0/190))
0/190
35
Fuzzy Logical Operations
36
Fuzzy Logical Operations
37
Fuzzy Logical Operations
38
Fuzzy sets and
Logical Operations
39
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.
40
What is a fuzzy rule?
A fuzzy rule can be defined as a conditional
statement in the form:
IF x is A
THEN y is B
41
What is the difference between
classical and fuzzy rules?
A classical IF-
IF-THEN rule uses binary logic, for
example,
Rule: 1 Rule: 2
IF speed is > 100 IF speed is < 40
THEN stopping_distance is long THEN stopping_distance is short
44
Fuzzy sets of tall and heavy men
Degree of Degree of
Mem bership Mem bership
1.0 1.0
Ta ll me n Hea vy me n
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
Height, cm Weight, k g
0.2 0.2
0.0 0.0
160 180 190 200 70 80 100 120
Height, cm Weight, kg
46
Multiple antecedents of
Fuzzy rules
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
47
Multiple consequents of
Fuzzy rules
The consequent of a fuzzy rule can also include
multiple parts, for instance:
IF temperature is hot
THEN hot_water is reduced;
reduced;
cold_water is increased
48