Unlock access to all the studying documents.
View Full Document

1
BMCS2003 Artificial
Intelligence
Dealing with Uncertainty: Fuzzy
Expert System

2
Three ways to deal with uncertainty:
√ Probability Theory
√ Certainty Factors
Fuzzy sets

3
Objectives:
! Fuzzy set theory /
Fuzzy logic
(Lofti Zadeh, 1965)
! Fuzzy expert system

4
Fuzzy Logic???
! 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 a set of mathematical
principles for knowledge representation
based on degrees of membership.

5
Fuzzy Logic
! The digital computing world is built on a
structure of Boolean logic applied to
binary values
“ one or zero, yes or no, in or out, 0 or 1.
! But this powerful structure is a gross
oversimplification of the real world, where
many shades of gray exist between black
and white
Boolean logic
0 1 Multi-valued logic 0 1

6
Boolean Logic
“ Boolean logic uses sharp distinctions. It forces
us to draw lines between members of a class
and non- members.
“ For instance,
Tom’s height is 181 cm. Is he tall?
“ If we draw a line at 180 cm to differentiate
between a tall man and a short man,
David’s height is 179 cm. Is he tall?

7
Example
! E.g, the possibility that a man 179 cm tall
is tall might be set to a value of 0.86.
“ Conclusion: It is likely that the man is tall
[in Boolean logic, 179cm is considered short]

8
Degree of membership of ‘tall men”

9
Fuzzy Sets?
! The concept of set
! E.g.
“ Group indicates a set of students.
“ If an element is within a Boolean set # 1 (true),
otherwise 0 (false)
! Fuzzy set?
“ A set with fuzzy boundaries
“ Elements belongs to a fuzzy set with a certain degree of
membership
“ The degree is taken in the interval [0,1]
“ 0 represents absolute falseness and 1 represents
absolute truth. [And others are in between 0 and 1]

10
Fuzzy set v.s. Boolean set
Fuzzy logic Boolean
X-axis
represents
the universe
of discourse

11
Context of Universe of Discourse
! Example:
“Russell’s height is 172 cm, is he
short or tall”?
! The context of universe (the range
of all possible values) may vary
“ e.g. men’s heights vs. women’s height

12
Probability v.s. Fuzzy
! Question:
“ since both ranged from 0 to 1, can
“ Probability = fuzzy logic?
! Consider the statement
“ “Jack is tall” {truth value 0.24}.

13
In Probability
So can Jack still be considered
tall???
There is a 24% chance
that Jack is tall

In Fuzzy Terminology
! if we take all the (fuzzy set of) tall people and
line them up, Jack is positioned 24 of the way to
the tallest.
“ Is Jack tall?
! In fuzzy logic,
“ we state this as µTALL(Jack) = 0.24, where µTALL
is the membership function.
14
Jack’s degree of membership in
the set of tall people is 0.24

15
! clearly fuzzy logic ≠ probability
! In fuzzy logic:
“ We know Jack is somewhat tall, and
“ We may know Jack’s height exactly (the assertion
‘Jack is tall (0.24)’ measures how well Jack’s
height matches the sense of the word ‘tall’).
! In probability:
“ We may still not know whether Jack is tall, and
“ We don’t actually know Jack’s height.
Fuzzy Logic and Probability

16
Membership function in crisp set
“ Let X be the universe of discourse and its
elements be denoted as x.
“ In the classical set theory, crisp set A of X
is defined as function fA(x) called the
characteristic function of A
!
“
#
∉
∈
=Ax
Ax
xfAif0,
if1,
)(

17
Membership function in Fuzzy Set
“ In the fuzzy theory, fuzzy set A of
universe X is defined by function µA(x)
called the membership function of set A
µ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) x is partly in A.

18
Example (People and Tallness)
Question: To what degree is person x tall?
The easiest way to do this is with a
membership function based on the person’s
height. And fix a strict changeover point
tall(x) =
{ 0, if height(x)
(height(x)-5ft.)/2ft., if 5 ft.
1, if height(x) > 7 ft. }

19
Graph Based on Membership Function
5 7
5 7
Degree of tallness
height(x)/ft

20
Fuzzy Sets
Person Height degree of tallness
————————————————————
Billy 3′ 2” 0.00
Yoke 5′ 5″ 0.21
Drew 5′ 9″ 0.38
Erik 5′ 10” 0.42
Mark 6′ 1″ 0.54
Kareem 7′ 2″ 1.00
! Expressions like “A is X” can be interpreted as degrees of
truth, e.g., “Drew is TALL” = 0.38.

22
Fuzzy Logic – Creating fuzzy set
! In the context of a rule-based system,
we might imagine asking ‘Is the water
cold?’
Yes / No / very cold / a bit cold
! We might fixing a strict changeover
point.
20 ºC
cold not cold

23
Fuzzy Sets
! For example
The degree of fuzzy sets is usually between 0 to 1.

temperature
24
! Alternatively, we may make such distinctions
‘fuzzy’, essentially by allowing a whole
spectrum of ‘degrees of coldness ’.
cold Definitely
not cold
-10 ºC
Definitely
cold
20 ºC
Creating fuzzy set
1 0
Membership degree

25
Function (Membership function)
! A property like coldness could be
represented by a function. Given a
temperature, the function will return a
number representing the degree of
coldness.
coldness(x) =
{ 0, if temp(x) > 20.,
f(temp(x))
if 0
1, if temp(x)

The fuzzy membership function
26
Degree of
coldness
Temperature
(◦C)

Fuzzy sets
! We can also define more fuzzy sets to
describe different levels of coldness.
27
15
cold not cold
0
very cold a bit cold
30
5 10 ºC

Three different fuzzy sets
very_cold(x) =
{ 0, if temp(x) > 5,
f(temp(x))
if -20
1, if temp(x)
cold(x) =
{ 0, if temp(x) > 15 or temp(x)
f(temp(x))
if 0
1, if temp(x) = 7.5}
a_bit_cold(x) =