CSE 312
Foundations of Computing II
Lecture 7: Conditional Probabilities
Stefano Tessaro
tessaro@cs.washington.edu
1
Foundations of Computing II Lecture 7: Conditional Probabilities - - PowerPoint PPT Presentation
CSE 312 Foundations of Computing II Lecture 7: Conditional Probabilities Stefano Tessaro tessaro@cs.washington.edu 1 Reminder Gradescope enroll code: M8YYEZ Homework due tonight by 11:59pm. 2 Conditional Probabilities Often we want to know
1
2
3
4
“we get heads at least once” “same outcome” ! = {TH, HT, HH} ℬ = {TT, HH} Ω = {TT, TH, HT, HH} ∀+ ∈ Ω: ℙ + = 1 4
1 2
[Verbalized: Probability of ℬ conditioned on !.]
5
! ! ∩ ℬ ℬ ∖ ! ! ∖ ℬ ℬ
6
ℙ red = 1 6 ℙ green = 1 3 Pick a random ball ℙ blue = 1 3 ℙ black = 1 6 “we do not get black” “we get blue” ! = {red, blue, green} ℬ = {blue} ℙ ℬ ! = ℙ blue ∩ red, blue, green ℙ red, blue, green = ℙ blue ℙ red, blue, green = 1/3 5/6 = 2 5
7
All three are possible!
8
“heads at least once” “same outcome” ! = {TH, HT, HH} ℬ = {TT, HH} ℙ ℬ = 1 2 ℙ ℬ|! = 1 3 > “we do not get black” “we get blue” ! = {red, blue, green} ℬ = {blue} ℙ ℬ = 1 3 ℙ ℬ|! = 2 5 <
9
ℙ ! ∩ ℬ = ℙ ! ⋅ ℙ(ℬ). Note: If !, ℬ independent, and ℙ ! ≠ 0, then: ℙ ℬ ! =
ℙ !∩ℬ ℙ !
=
ℙ ! ℙ ℬ ℙ !
= ℙ N Reads as “The probability that ℬ occurs is independent of !.”
10
Assume we toss two fair coins “first coin is heads” “second coin is heads” ! = {HH, HT} ℬ = {HH, TH}
Note here we have defined the probability space assuming independence, so quite unsurprising – but this makes it all precise.
11
Assume we toss 51 fair coins. Assume we have seen 50 coins, and they are all “heads”. What are the odds the 51st coin is also “heads”? ! = first 50 coins are heads N = 51st coin is ”heads”
51st coin is independent of
12
The probability conditioned on ! follows the same properties as (unconditional) probability.
(Ω, ℙ(⋅ |!)) is a probability space
ℙ !∩ℬ ℙ !
13
14
(Proof: Apply above iteratively / formal proof requires induction)
15
16
Rules: In each round
17
Rules: At each step:
Events:
\ = nobody wins in round ]
1)
1) ×ℙ(!V|^ 1)
[The event !V implies ^
1, and this
means that !V ∩ ^
V = !V]
18
Rules: At each step:
Events:
\ = nobody wins in round ]
1 ∩ ^ V ∩ ⋯ ∩ ^ \Q1)
1) ×ℙ(^ V|^ 1)
\Q1
2|^ 1 ∩ ^ V)
\Q1|^ 1 ∩ ^ V ∩ ⋯ ∩ ^ \QV) ×ℙ(!\|^ 1 ∩ ^ V ∩ ⋯ ∩ ^ \Q1)
19
Rules: At each step:
1/3 1/6 1/2
1/3 1/6 1/2
1/3 1/6 1/2
1/3 1/6 1/2
…
20
!\ = Alice wins in round ] → ℙ !\ =
1 V \Q1
2
\cS d
1 2
\
× 1 3 = 1 3 × b
\cS d
1 2
\
= 1 3 ×2 = 2 3
d e\ = 1 1Qg.
21
22
1/2 1/2 1/2 1/2 2/3
Left Right
1/3
(Law of total probability)
23
0.15 0.8 0.5
Flu Ebola
Other
10Qk
0.85 − 10Qk
0.2 1 0.4 0.1
“priors” “conditionals” “observation” Posterior: ℙ Ebola|High fever
24
ℙ ℬ|! = ℙ ℬ ⋅ ℙ(!|ℬ) ℙ !
Proof: ℙ ! ⋅ ℙ ℬ|! = ℙ(! ∩ ℬ)
25
High fever
0.15 0.8 0.5
Flu Ebola
Low fever No fever
Other
10Qk
0.85 − 10Qk
0.2 1 0.4 0.1
ℙ Ebola|High fever = ℙ Ebola ⋅ ℙ(High fever|Ebola) ℙ High fever = 10Qk ⋅ 1 0.15×0.8 + 10Qk×1 + 0.85 − 10Qk ×0.1 ≈ 7.4×10Qk ℙ Flu|High fever ≈ 0.89 ℙ Other|High fever ≈ 0.11 Most-likely a-posteriori
26
27
3/4 1/4
Mixed Not mixed
28
3/4 1/4
Mixed Not mixed
rs
rstq p×1 ≈ 0.13
29
Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a
want to pick door No. 2?" Is it to your advantage to switch your choice?
Your choice
30
1/3 1/3
Door 1 Door 3
Door 2
1/3
Car position
1/2 1/2 1 1
31
Open 2
1/3 1/3
Door 1 Door 3
Open 3
Door 2
1/3 1/2 1/2 1 1
32
Your choice