Chapter 9
Chapter 9
Chapter 9
Outline
Probability
Bayesian networks
Fuzzy logic
2
Probability
Laziness: too much to list the complete set of rules, too hard to
use the enormous rules that result
3
Probability
4
Probability
P(Dice = 2) = 1/6
5
Probability
6
Probability
Example:
S = stiff neck
M = meningitis
P(S | M) = 0.5
P(M) = 1/50000
P(S) = 1/20
7
Probability
8
Probability
Axioms:
0 P(A) 1
P(true) = 1 and P(false) = 0
P(A B) = P(A) + P(B) - P(A B)
9
Probability
Derived properties:
P(A) = 1 - P(A)
P(U) = P(A1) + P(A2) + ... + P(An)
U = A1 A2 ... An collectively exhaustive
Ai Aj = false mutually exclusive
10
Probability
Bayes theorem:
11
Probability
12
Probability
Independence:
P(A B) = P(A).P(B)
P(A) = P(A | B)
Conditional independence:
P(A B | E) = P(A | E).P(B | E)
P(A | E) = P(A | E B)
Example:
P(Toothache | Cavity Catch) = P(Toothache | Cavity)
P(Catch | Cavity Toothache) = P(Catch | Cavity)
13
Probability
"In John's and Mary's house, an alarm is installed to
sound in case of burglary or earthquake. When the alarm
sounds, John and Mary may make a call for help or
rescue."
14
Probability
"In John's and Mary's house, an alarm is installed to
sound in case of burglary or earthquake. When the alarm
sounds, John and Mary may make a call for help or
rescue."
Q1: If earthquake happens, how likely will John make a
call?
15
Probability
"In John's and Mary's house, an alarm is installed to
sound in case of burglary or earthquake. When the alarm
sounds, John and Mary may make a call for help or
rescue."
Q1: If earthquake happens, how likely will John make a
call?
16
Bayesian Networks
Pearl, J. (1982). Reverend Bayes on Inference Engines:A
Distributed HierarchicalApproach,
presented at the Second National Conference onArtificial Intelligence
(AAAI-82), Pittsburgh, Pennsylvania
17
Bayesian Networks
P(B) P(E)
Burglary .001 Earthquake .002
B E P(A)
Alarm T T .95
T F .94
F T .29
F F .001
A P(J) A P(M)
JohnCalls T .90 MaryCalls T .70
F .05 F .01
18
Bayesian Networks
Syntax:
Aset of random variables makes up the nodes
Aset of directed links connects pairs of nodes
Each node has a conditional probability table that quantifies the
effects of its parent nodes
The graph has no directed cycles
A A
yes B B no
C C
D D
19
Bayesian Networks
Semantics:
An ordering on the nodes: Xi is a predecessor of X j i < j
P(X1, X2, , Xn)
= P(Xn | Xn-1, , X1).P(Xn-1 | Xn-2, , X1). .P(X2 | X1).P(X1)
= iP(Xi | Xi-1, , X1) = iP(Xi | Parents(Xi))
20
Bayesian Networks
Example:
P(J M A B E)
= P(J |A).P(M |A).P(A| B E).P(B).P(E)
= 0.00062
B E
J M
21
Bayesian Networks
22
Uncertain QuestionAnswering
P(Query | Evidence) = ?
J M
23
Uncertain QuestionAnswering
24
Uncertain QuestionAnswering
Q1: If earthquake happens, how likely will John make a call?
Q3: If the alarm sounds, how likely both John and Mary make
calls?
25
Uncertain QuestionAnswering
P(B |A)
= P(B A)/P(A)
= aP(B A)
P(B |A)
= aP(B A)
26
General Conditional Independence
27
General Conditional Independence
U1 Um
Z1j Znj
Y1 Yn
U1 Um
Z1j Znj
Y1 Yn
X E Y
Z
30
General Conditional Independence
Example:
Battery
Starts
Moves
31
General Conditional Independence
Example:
Battery
Words like smart, tall, and fat are vague since in most contexts of
use there is no bright line separating them from not smart, not tall,
and not fat respectively
33
V
a gueness
Imprecision vs. Uncertainty:
vs.
34
Fuzzy Sets
Zadeh, L.A. (1965). Fuzzy Sets
Journal of Information and Control
35
Fuzzy Sets
36
Fuzzy Sets
37
Fuzzy Set Definition
mA: U [0, 1]
1
mAA
young
0.5
0
25 30 40 Age
38
Fuzzy Set Representation
Discrete domain:
high-dice score: {1:0, 2:0, 3:0.2, 4:0.5, 5:0.9, 6:1}
Continuous domain:
0
25 30 40 Age
39
Fuzzy Set Representation
a-cuts:
Aa = {u |A(u) a}
Aa+ = {u |A(u) > a} strong a-cut
0
25 30 40 Age
40
Fuzzy Set Representation
a-cuts:
Aa = {u |A(u) a}
Aa+ = {u |A(u) > a} strong a-cut
A(u) = sup {a | u Aa}
0
25 30 40 Age
41
Fuzzy Set Representation
Support:
supp(A) = {u |A(u) > 0} = A0+
Core:
core(A) = {u |A(u) = 1} = A1
Height:
h(A) = supUA(u)
42
Fuzzy Set Representation
43
Membership Degrees
Subjective definition
44
Membership Degrees
Subjective definition
Voting model:
Each voter has a subset of U as his/her own crisp definition of the
concept thatArepresents.
45
Membership Degrees
Voting model:
P1 P2 P3 P4 P5 P6 P7 P8 P9 P10
1
3 x x
4 x x x x x
5 x x x x x x x x x
6 x x x x x x x x x x
46
Fuzzy Subset Relations
X isA entails X is B
47
Fuzzy Set Operations
Standard definitions:
48
Fuzzy Set Operations
Example:
old = young
49
Fuzzy Relations
Crisp relation:
R(U 1, ..., U n) U 1 ... U n
50
Fuzzy Relations
Crisp relation:
R(U 1, ..., U n) U 1 ... U n
51
Fuzzy Relations
Fuzzy relation:
U1 = {New Y
ork, Paris}, U 2 = {Beijing, New Y
ork, London}
R = very far
NY Paris
Beijing 1 .9
NY 0 .7
London .6 .3
R = {(NY
, Beijing): 1, ...}
52
Fuzzy Numbers
53
Basic Types of Fuzzy Numbers
1 1
0 0
1 1
0 0
54
Basic Types of Fuzzy Numbers
1 1
0 0
55
Operations of Fuzzy Numbers
Interval-based operations:
(A B)a =Aa Ba
56
Operations of Fuzzy Numbers
57
Operations of Fuzzy Numbers
[a, b] + [d, e] = [a + d, b + e]
[a, b] - [d, e] = [a - e, b - d]
[a, b]*[d, e] = [min(ad, ae, bd, be), max(ad, ae, bd, be)]
58
Operations of Fuzzy Numbers
about 2 about 3
1
about 2 + about 3 = ?
about 2 about 3 = ?
0
2 3 +
59
Operations of Fuzzy Numbers
Discrete domains:
A B = ?
60
Operations of Fuzzy Numbers
Extension principle:
f: U1 U2 V
induces
~ ~ ~
g: U 1 U 2 V
61
Operations of Fuzzy Numbers
Discrete domains:
62
Fuzzy Logic
if x isAthen y is B
x isA*
------------------------
y is B*
63
Fuzzy Logic
64
Fuzzy Controller
65
Fuzzy Controller
66
Fuzzy Controller
FUZZY
actions Defuzzification CONTROLLER
model
Fuzzification
conditions model
67
Fuzzification
0
x0
68
Defuzzification
Center of Area:
x = (A(z).z)/A(z)
69
Defuzzification
Center of Maxima:
M = {z | A(z) = h(A)}
70
Defuzzification
Mean of Maxima:
M = {z | A(z) = h(A)}
x = z/|M|
71
Exercises
72