Title: Comp329: Week 9
1Comp329 Week 9
Reasoning Under Uncertainty -- I
Abhaya Nayak
2Outline
Why Probability -- Uncertainty Probability
basics Learning from Experience -- Bayesian
Updating
3Uncertainty
- Let action At leave for airport t minutes
before flight - Will At get me there on time?
- Problems
- partial observability (road state, other drivers'
plans, etc.) - noisy sensors (traffic reports on radio)
- uncertainty in action outcomes (flat tire, etc.)
- immense complexity of modelling and predicting
traffic - A25 will get me there on time? -- risks
falsehood - A25 will get me there on time if there's no
accident on the bridge and it doesn't rain and my
tires remain intact etc etc.? --too weak to
support decision making. - What about A1440? --I'd have to stay overnight
in the airport
4Methods for handling Uncertainty
Default or nonmonotonic logic Assume my car
does not have a flat tire Assume A25 works
unless contradicted by evidence Issues What
assumptions are reasonable? How to handle
contradiction? Rules with fudge factors A25
?0.3 get_there_on_time Sprinkler ?0.99 WetGrass,
WetGrass ?0.7 Rain Issues Problems with
combination, e.g., Sprinkler causes
Rain?? Probability Given the available
evidence, A25 will get me there on time with
probability 0.04
5Probability
- Probabilistic assertions summarize effects of
- laziness failure to enumerate exceptions,
qualifications, etc. - ignorance lack of relevant facts, initial
conditions, etc. - Subjective or Bayesian probability
- Probabilities relate propositions to one's own
state of knowledge - e.g., P(A25 no reported accidents) 0.06
- -- not claims of some probabilistic tendency in
the current situation - (but might be learned from past experience of
similar situations) - Probabilities of propositions change with new
evidence - e.g., P(A25 no reported accidents,5 a.m.)
0.15 - (Analogous to logical entailment status KB ?,
not truth.)
6Making decisions under uncertainty
Suppose I believe the following P(A25 gets me
there on time ) 0.04 P(A90 gets me there on
time ) 0.70 P(A120 gets me there on time
) 0.95 P(A1440 gets me there on time )
0.9999 Which action to choose? Depends on my
preferences for missing flight vs. airport
cuisine, etc. Utility theory is used to
represent and infer preferences Decision theory
utility theory probability theory
7Monte Hall Problem
0
Door 1
Door 2
Door 3
- There are 2 rabbits and a car behind these doors.
Pick One. You will win whatever is behind the
door you choose.
- Now that you know what is behind door 1, you may
want to change your mind. Would you?
8De Mérés Problems
0
- What are the chances of getting at least one six
in 4 throws of a die?
Chance of not getting any six in 4 throws of a
die is (5/6)4 . So the chance of getting at least
one six is 1- (5/6)4 which is 671 in 1296
(slightly more than 1/2).
- Of getting at least one double-six in 24 throws
of two dice?
Chance of getting at least one double-six in 24
throws of a die is 1- (35/36)24 which is 0.4913.
9Gender Problem
- I have two children. The first child is a boy.
What is the chance that the second child is a
girl?
The event space is BB,BG,GB,GG. Since the first
child is a boy, it shrinks to BB,BG. The chance
of the second child being a girl is, thus, 1/2.
- At least one of my two children is a boy. What is
the chance that the other child is a girl?
In this case, the event space shrinks to
BB,BG,GB. Hence the chance that the other child
is a girl is 2/3.
10St. Petersburg Paradox
- You are to toss a coin until it falls head-up
(and the game terminates here). If the game lasts
n-tosses of a coin, you get 2n dollars. What is
the fair value of this game?
The chance of the game terminating at nth toss is
1/2n, for n 1,2,3,. So the value of the game
is 211/21 221/22 11 ?. How much
would you pay to play this game?
- As above but the assets of the house is 1
million dollars (so if you win more than a
million, you get only one million dollars). How
much would you pay to play this game?
You pay 19, you win a bit. You pay 20, you lose
a bit.
11Birthday Problem
- There are four persons in a room. What is the
chance that at least two of them share the same
birth day (Monday, Tuesday)?
- What should be the minimum size of a party such
that the chance of there being at least two
people with the same date of birth (date, month)
is at least 50?
Left as a Tutorial Task-)
12Introduction to Probability
- Probability from First Principles
- Probabilistic Independence
13Sample Space Events
Flip a coin three times.What are the possible
outcomes?
TTT TTH THT THH HTT HTH HHT HHH
The Sample Space S is
the set of all outcomes S TTT, TTH, THT, THH,
HTT, HTH, HHT, HHH
Any subset of the sample space is an event.
Any singleton subset of the sample space is a
simple event.
14An Example
TTT
HTT
THT
THH
TTH
HHT
HTH
HHH
15A Quiz
event_1
TTT
HTT
S
THT
THH
TTH
event_2
HTH
HHT
HHH
How would you describe event_1?
How would you describe Event_2?
How would you represent the event of getting
exactly one head?
16Probability Mass
THT
TTT
THH
S
TTH
HHT
HTH
HTT
HHH
Assign non-zero probabilities to the outcomes
such that the total probability mass 1.
17Probability of an Event
S
THT
TTT
THH
0.1
0.05
0.25
TTH
0.1
HHT
HTH
0.15
0.15
HTT
HHH
0.1
0.1
Probability of an event is the sum of the
probability-mass of outcomes in that event.
Probability of event H, denoted P(H) 0.1 0.25
0.15 0.5.
Probability of the complement of H, P(?H)
1-P(H) 0.5
18Another Quiz!
THT
TTT
S
THH
0.1
0.05
0.25
TTH
0.1
HHT
HTH
0.15
0.15
HTT
HHH
0.1
0.1
- What is the probability of getting two
consecutive heads?
- What is the probability of getting at least one
head?
- What is the probability of getting more heads
than tails?
19Probability of Disjunctive Events
TTT
THT
0.05
THH
0.1
P(E) 0.6
0.25
TTH
HHT
HHH
0.15
0.15
0.1
HTH
0.1
P(E) 0.45
HTT
0.1
- What is the probability of getting a head either
in the first throw or in the second throw? Sum of
the prob. mass of simple events that are either
in E or in E 0.8 P(E) P(E) - P(E?E).
- In general, P(X?Y) P(X) P(Y) - P(X ?Y).
- If events X and Y are disjoint, P(X?Y) P(X)
P(Y).
20Probability Function
- Verify that
- For every event X, 0 ? P(X) ? 1
- If events X and Y are disjoint, P(X?Y) P(X)
P(Y).
Any function f from events to real numbers
between 0 and 1 satisfying the above three
properties is a probability function.
21Conditional Probability
TTT
THT
0.05
THH
0.1
0.25
TTH
HHT
HHH
0.15
0.15
0.1
HTH
0.1
HTT
0.1
- Suppose that we know the first throw was a head.
- Then the outcomes outside E are no longer
entertainable.
- The total prob. mass of 1 must be distributed
among outcomes in E. It is done according to the
proportion of their prior probability mass.
22Normalisation
TTT
THH
HHT
0.0
0.0
HTH
0.15/0.45 3/9
0.1/0.45 2/9
THT
0.0
TTH
HHH
0.0
HTT
0.1/0.45 2/9
0.1/0.45 2/9
E
- Prob. mass of outcomes in E are now blown-up to
reflect that new probability of E 1.0
- Outcomes outside E can now be safely neglected.
- The new probability function is denoted by P(.E)
23Probability of Events after Normalisation
TTT
THH
0.0
0.0
HHT
HTH
0.15/0.45 3/9
0.1/0.45 2/9
THT
0.0
TTH
HHH
0.0
HTT
0.1/0.45 2/9
0.1/0.45 2/9
E
- Probability of getting exactly two heads, given
that the first throw is head, denoted P(HE) is
2/9 3/9 5/9.
- Old probability of getting exactly two heads
(before we knew that the first throw is head)
namely P(H), was 0.5
24Defining P(?E) via P(?)
TTT
THT
0.05
THH
0.1
0.25
TTH
HHT
0.15
HTH
0.15
0.1
E 0.45
HHH
HTT
0.1
0.1
- In order to obtain P(.E), mass of outcomes in E
were proportionally blown up (via division by
0.45)
25Bayes Rule
26Application of Bayes Rule
Consider the reliability of substance abuse test
as follows
Drug Users non drug-users test
positive 90 1 test negative 10 99
Suppose that 0.1 of Sydney population use drug.
Suppose that a randomly chosen person from Sydney
tested positive in the drug test.
What is the probability that this person in
question is actually a drug user?
27- So the chance that this randomly chosen person
who tests positive in the drug test actually uses
drug is only about 8.3!
28Partitioning a Sample Space
H1
H2
THT
TTT
S
THH
0.1
0.05
0.25
TTH
0.1
HHT
HTH
0.15
0.15
HTT
HHH
0.1
0.1
H3
- S is partitioned into three cells H1, H2 and H3.
- A partition of S is a collection of subsets of S
that are mutually exclusive and jointly
exhaustive.
29Bayes Rule - again
H1
H2
THT
TTT
S
THH
0.1
0.05
0.25
TTH
0.1
HHT
HTH
0.15
0.15
E
HTT
HHH
0.1
0.1
H3
30Generalised Bayes Rule
- You know that P(H?E) P(HE)?P(E).
- What would be P(H ? E1?E2), assuming that P(H ?
E1?E2) ? 0? - What would be P(H ? E1?... ? En), assuming that
P(H ? E1?... ? En) ? 0?
31Applying Generalised Bayes Rule
Quality-label from a box of 100 flash-bulbs is
missing. Apriori, chances of its being rated
low, medium and high are 0.25, 0.25 and 0.50. Two
bulbs were randomly chosen and tested they fired
satisfactorily. Prior estimates of results (from
boxes of known quality) given two bulbs were
tested is as follows Number of
defectives Quality of box x Low Medium High
0 .49 .64 .81 1 .42 .32 .18 2 .09 .04
.01 What is the chance that this box is a High
Quality box?
32(No Transcript)
33Independent Events
iff P(XY) P(X)
iff P(YX) P(Y).
Occurrence or non-occurrence of event X
(respectively Y) does not affect the probability
of event Y taking place.
34Example Independent Events
Getting at least one head and getting tail on the
first throw are dependent events.
Getting head on the first throw and getting head
on the second throw are two independent events.
35Next week