SLIDE 1 ì ¡
Probability ¡and ¡Statistics ¡ for ¡Computer ¡Science ¡ ¡
On ¡Condi(onal ¡Probability ¡ and ¡independence, ¡Prof. ¡ Forsyth ¡men(oned ¡in ¡the ¡ textbook ¡“These ¡topics ¡ mislead ¡intui1on ¡so ¡regularly ¡ that ¡some ¡errors ¡have ¡ names.” ¡
Hongye ¡Liu, ¡Teaching ¡Assistant ¡Prof, ¡CS361, ¡UIUC, ¡2.6.2020 ¡ Credit: ¡wikipedia ¡
SLIDE 2
Announcement ¡
SLIDE 3 Announcement ¡
✺ HW3 ¡is ¡out ¡today ¡and ¡is ¡due ¡on ¡2/13 ¡Thurs. ¡
Please ¡start ¡early ¡for ¡this ¡homework ¡is ¡ rela(vely ¡harder. ¡
✺ Please ¡check ¡the ¡slides ¡I ¡have ¡for ¡coun(ng ¡in ¡
last ¡lecture ¡ ¡
SLIDE 4
Last ¡time ¡
✺ Probability ¡ ¡
✺ Coun(ng ¡ ¡ ✺ Review ¡of ¡basics ¡of ¡probability ¡ ✺ Condi(onal ¡Probability ¡
¡
SLIDE 5
Content ¡
✺ Condi(onal ¡Probability ¡ ¡
✺ Review ¡the ¡main ¡concepts ¡ ✺ Examples ¡and ¡Misconcep8ons ¡of ¡
Condi(onal ¡Probability ¡ ¡
✺ Independence ¡ ✺ Condi(onal ¡Independence ¡
¡
SLIDE 6 Conditional ¡Probability ¡
✺ The ¡probability ¡of ¡A ¡given ¡B ¡
¡
P(A|B) = P(A ∩ B) P(B)
P(B) = 0
The ¡line-‑crossed ¡area ¡is ¡the ¡ new ¡sample ¡space ¡for ¡ condi(onal ¡P(A| ¡B) ¡
SLIDE 7
Content ¡
✺ Condi(onal ¡Probability ¡ ¡
✺ Review ¡the ¡main ¡concept ¡ ✺ Examples ¡and ¡Misconcep2ons ¡of ¡
Condi1onal ¡Probability ¡ ¡
✺ Independence ¡ ✺ Condi(onal ¡Independence ¡
¡
SLIDE 8 Conditional ¡Probability: ¡die ¡ example ¡ ¡
2 ¡ 3 ¡ 4 ¡ 5 ¡ 2 ¡ 3 ¡ 5 ¡ 4 ¡ 1 ¡ 1 ¡
Throw ¡5-‑sided ¡fair ¡ die ¡twice. ¡ ¡ ¡
X ¡ Y ¡
P(A|B) =?
P(A) =?
A : max(X, Y ) = 4 B : min(X, Y ) = 2
SLIDE 9 Conditional ¡Probability: ¡die ¡example ¡ ¡
2 ¡ 3 ¡ 4 ¡ 5 ¡ 2 ¡ 3 ¡ 5 ¡ 4 ¡ 1 ¡ 1 ¡
Throw ¡5-‑sided ¡fair ¡ die ¡twice. ¡ ¡ ¡
X ¡ Y ¡
A : max(X, Y ) = 4 B : min(X, Y ) = 2
P(A) = 7 25
SLIDE 10 Conditional ¡Probability: ¡die ¡example ¡ ¡
2 ¡ 3 ¡ 4 ¡ 5 ¡ 2 ¡ 3 ¡ 5 ¡ 4 ¡ 1 ¡ 1 ¡
Throw ¡5-‑sided ¡die ¡ twice, ¡ ¡ ¡
X ¡ Y ¡
P(A|B) = 2 7 A : max(X, Y ) = 4 B : min(X, Y ) = 2
SLIDE 11
Frequency ¡Approach ¡onto ¡Bayesian ¡
✺ In ¡the ¡5-‑die ¡problem, ¡we ¡counted ¡the ¡
frequencies ¡to ¡compute ¡the ¡ condi(onal ¡probability. ¡
✺ Using ¡the ¡symmetry ¡of ¡joint ¡
probability, ¡we ¡can ¡derive ¡other ¡ formulas ¡for ¡condi(onal ¡probability ¡
SLIDE 12 Bayes ¡rule ¡
✺ Given ¡the ¡defini(on ¡of ¡condi(onal ¡
probability ¡and ¡the ¡symmetry ¡of ¡joint ¡ probability, ¡we ¡have: ¡ ¡ ¡ ¡ ¡ ¡ ¡And ¡it ¡leads ¡to ¡the ¡famous ¡Bayes ¡rule: ¡
P(A|B)P(B) = P(A ∩ B) = P(B ∩ A) = P(B|A)P(A)
P(A|B) = P(B|A)P(A) P(B)
SLIDE 13
Total ¡probability ¡using ¡conditional ¡ probability ¡
¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡
SLIDE 14
Total ¡probability ¡general ¡form ¡
¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡
SLIDE 15
Bayes ¡rule: ¡Prosecutor’s ¡Fallacy ¡
A: ¡Guilty ¡ B: ¡There ¡is ¡evidence ¡against ¡this ¡person ¡
SLIDE 16 Bayes ¡rule: ¡Prosecutor’s ¡Fallacy ¡
A: ¡Guilty ¡ B: ¡There ¡is ¡evidence ¡against ¡this ¡person ¡
P(A) ¡= ¡0.05 ¡ P(Ac) ¡= ¡0.95 ¡ P(B|A) ¡= ¡0.99 ¡ P(Bc|A) ¡= ¡0.01 ¡ P(B|Ac) ¡= ¡0.10 ¡ P(Bc|Ac) ¡= ¡0.90 ¡
Innocent ¡
P(There is evidence | Innocent) = P(B|Ac) = 0.10
SLIDE 17 Bayes ¡rule: ¡Prosecutor’s ¡Fallacy ¡
P(A) ¡= ¡0.05 ¡ P(Ac) ¡= ¡0.95 ¡ P(B|A) ¡= ¡0.99 ¡ P(Bc|A) ¡= ¡0.01 ¡ P(B|Ac) ¡= ¡0.10 ¡ P(Bc|Ac) ¡= ¡0.90 ¡
Innocent ¡
✺ What ¡Probability ¡should ¡be ¡used? ¡
P(There is evidence | Innocent) = P(B|Ac) = 0.10
Guilty ¡
SLIDE 18
Important ¡facts ¡
✺ Bayes ¡rule ¡ ✺ Total ¡probability ¡
P(A|B) = P(B|A)P(A) P(B)
SLIDE 19 Important ¡facts ¡
✺ Bayes ¡rule ¡ ✺ Total ¡probability ¡
P(A|B) = P(B|A)P(A) P(B)
P(A) = P(A|B)P(B) + P(A|Bc)P(Bc)
P(A) =
(P(A|Bj)P(Bj))
if Bi ∩ Bj = Ø for all i = j
SLIDE 20
Content ¡
✺ Condi(onal ¡Probability ¡ ¡
✺ Review ¡the ¡main ¡concepts ¡ ✺ Examples ¡and ¡Misconcep8ons ¡of ¡
Condi(onal ¡Probability ¡ ¡
✺ Independence ¡ ✺ Condi(onal ¡Independence ¡
¡
SLIDE 21
Independence ¡
✺ One ¡defini(on: ¡
¡That ¡is: ¡whether ¡B ¡happened ¡ ¡doesn’t ¡change ¡the ¡probability ¡of ¡A ¡ ¡and ¡vice ¡versa ¡
P(A|B) = P(A) or P(B|A) = P(B)
P(A) = 0 & P(B) = 0
While ¡
SLIDE 22
Independence ¡
✺ Alterna(ve ¡defini(on ¡deriva(on ¡ ¡
SLIDE 23 Independence ¡
✺ Alterna(ve ¡defini(on ¡deriva(on ¡ ¡
P(A|B) = P(A) ⇒ P(A ∩ B) P(B) = P(A)
⇒ P(A ∩ B) = P(A)P(B)
LHS ¡by ¡defini(on ¡
SLIDE 24 Independence ¡
✺ Alterna(ve ¡defini(on: ¡ ¡ P(A ∩ B) = P(A)P(B)
Two ¡events ¡are ¡independent ¡if ¡and ¡
- nly ¡if ¡the ¡joint ¡event’s ¡probability ¡is ¡
the ¡product ¡of ¡each ¡individual ¡ probability; ¡this ¡is ¡true ¡also ¡for ¡P(A) ¡= ¡0 ¡
SLIDE 25
Testing ¡Independence: ¡
✺ Suppose ¡you ¡draw ¡one ¡card ¡from ¡a ¡
standard ¡deck ¡of ¡cards. ¡E1 ¡is ¡the ¡event ¡ that ¡the ¡card ¡is ¡a ¡King, ¡Queen ¡or ¡Jack. ¡E2 ¡ is ¡the ¡event ¡the ¡card ¡is ¡a ¡Heart. ¡Are ¡E1 ¡ and ¡E2 ¡independent? ¡
SLIDE 26
Probability ¡using ¡the ¡property ¡of ¡ Independence: ¡Airline ¡overbooking ¡(1) ¡
✺ An ¡airline ¡has ¡a ¡flight ¡with ¡6 ¡seats. ¡They ¡
always ¡sell ¡7 ¡(ckets ¡for ¡this ¡flight. ¡If ¡(cket ¡ holders ¡show ¡up ¡independently ¡with ¡ probability ¡p, ¡what ¡is ¡the ¡probability ¡that ¡ the ¡flight ¡is ¡overbooked ¡? ¡
SLIDE 27
Probability ¡using ¡the ¡property ¡of ¡ Independence: ¡Airline ¡overbooking ¡(1) ¡
✺ An ¡airline ¡has ¡a ¡flight ¡with ¡6 ¡seats. ¡They ¡
always ¡sell ¡7 ¡(ckets ¡for ¡this ¡flight. ¡If ¡(cket ¡ holders ¡show ¡up ¡independently ¡with ¡ probability ¡p, ¡what ¡is ¡the ¡probability ¡that ¡ the ¡flight ¡is ¡overbooked ¡? ¡
P( ¡7 ¡passengers ¡showed ¡up) ¡
SLIDE 28
Probability ¡using ¡the ¡property ¡of ¡ Independence: ¡Airline ¡overbooking ¡(2) ¡
✺ An ¡airline ¡has ¡a ¡flight ¡with ¡6 ¡seats. ¡They ¡
always ¡sell ¡8 ¡(ckets ¡for ¡this ¡flight. ¡If ¡(cket ¡ holders ¡show ¡up ¡independently ¡with ¡ probability ¡p, ¡what ¡is ¡the ¡probability ¡that ¡ exactly ¡6 ¡people ¡showed ¡up? ¡
P(6 ¡people ¡showed ¡up) ¡= ¡ ¡
SLIDE 29
Probability ¡using ¡the ¡property ¡of ¡ Independence: ¡Airline ¡overbooking ¡(3) ¡
✺ An ¡airline ¡has ¡a ¡flight ¡with ¡6 ¡seats. ¡They ¡
always ¡sell ¡8 ¡(ckets ¡for ¡this ¡flight. ¡If ¡(cket ¡ holders ¡show ¡up ¡independently ¡with ¡ probability ¡p, ¡what ¡is ¡the ¡probability ¡that ¡ the ¡flight ¡is ¡overbooked ¡? ¡
P( ¡overbooked) ¡= ¡
SLIDE 30
Probability ¡using ¡the ¡property ¡of ¡ Independence: ¡Airline ¡overbooking ¡(4) ¡
✺ An ¡airline ¡has ¡a ¡flight ¡with ¡s ¡seats. ¡They ¡
always ¡sell ¡t ¡(t>s) ¡(ckets ¡for ¡this ¡flight. ¡If ¡ (cket ¡holders ¡show ¡up ¡independently ¡ with ¡probability ¡p, ¡what ¡is ¡the ¡probability ¡ that ¡exactly ¡u ¡people ¡showed ¡up? ¡
P( ¡exactly ¡u ¡people ¡showed ¡up) ¡ ¡
SLIDE 31
Probability ¡using ¡the ¡property ¡of ¡ Independence: ¡Airline ¡overbooking ¡(5) ¡
✺ An ¡airline ¡has ¡a ¡flight ¡with ¡s ¡seats. ¡They ¡
always ¡sell ¡t ¡(t>s) ¡(ckets ¡for ¡this ¡flight. ¡If ¡ (cket ¡holders ¡show ¡up ¡independently ¡ with ¡probability ¡p, ¡what ¡is ¡the ¡probability ¡ that ¡the ¡flight ¡is ¡overbooked ¡? ¡
P( ¡overbooked) ¡ ¡
SLIDE 32 Independence ¡in ¡Airline ¡
✺ In ¡this ¡example, ¡we ¡made ¡use ¡of ¡the ¡
informa(on ¡the ¡(cket ¡holders ¡show ¡up ¡ independently ¡with ¡probability ¡p. ¡We ¡were ¡ actually ¡assuming ¡a ¡stronger ¡independence ¡ than ¡pairwise ¡independence. ¡
SLIDE 33 Independence ¡in ¡Airline ¡
✺ For ¡this ¡series ¡of ¡problems, ¡we ¡made ¡use ¡of ¡
the ¡informa(on ¡the ¡(cket ¡holders ¡show ¡up ¡ independently ¡with ¡probability ¡p. ¡We ¡were ¡ actually ¡assuming ¡a ¡stronger ¡independence ¡ than ¡pairwise ¡independence. ¡ For ¡example ¡in ¡overbooking ¡problem ¡(1), ¡we ¡ assume ¡E{a ¡7th ¡person ¡shows ¡up} ¡is ¡ independent ¡to ¡E{6 ¡people ¡showed ¡up}, ¡etc. ¡
SLIDE 34 Pairwise ¡independence ¡is ¡not ¡mutual ¡ independence ¡in ¡larger ¡context ¡
A1 ¡ A2 ¡ A4 ¡ A3 ¡
P(A1) ¡= ¡P(A2) ¡= ¡P(A3) ¡= ¡P(A4) ¡= ¡1/4 ¡ ¡ A = A1 ∪ A2; P(A) = 1 2 B = A1 ∪ A3; P(B) = 1 2 C = A1 ∪ A4; P(C) = 1 2
P(ABC) is the shorthand for P(A ∩ B ∩ C)
* ¡
SLIDE 35 Mutual ¡independence ¡
✺ Mutual ¡independence ¡of ¡a ¡collec(on ¡
- f ¡events ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡is ¡: ¡
✺ It’s ¡very ¡strong ¡independence! ¡
j, k, ...p = i A1, A2, A3...An
P(Ai|AjAk...Ap) = P(Ai)
SLIDE 36
Independence ¡vs ¡Disjoint ¡
✺ Q. ¡Two ¡disjoint ¡events ¡that ¡have ¡
probability> ¡0 ¡are ¡certainly ¡ dependent ¡to ¡each ¡other. ¡
¡ ¡A. ¡True ¡ ¡ ¡ ¡ ¡ ¡B. ¡False ¡
SLIDE 37
Independence ¡of ¡empty ¡event ¡
✺ Q. ¡Any ¡event ¡is ¡independent ¡of ¡
empty ¡event ¡B. ¡
¡ ¡A. ¡True ¡ ¡ ¡ ¡ ¡ ¡B. ¡False ¡
SLIDE 38
Content ¡
✺ Condi(onal ¡Probability ¡ ¡
✺ Review ¡the ¡main ¡concepts ¡ ✺ Examples ¡and ¡Misconcep8ons ¡of ¡
Condi(onal ¡Probability ¡ ¡
✺ Independence ¡ ✺ Condi1onal ¡Independence ¡
¡
SLIDE 39 Condition ¡may ¡affect ¡ Independence ¡
✺ Assume ¡event ¡A ¡and ¡B ¡are ¡pairwise ¡
independent ¡ A ¡ B ¡ C ¡ Given ¡C, ¡A ¡and ¡B ¡are ¡ not ¡independent ¡ any ¡more ¡because ¡ they ¡become ¡ disjoint ¡
SLIDE 40 Conditional ¡Independence ¡
✺ Event ¡A ¡and ¡B ¡are ¡condi(onal ¡
independent ¡given ¡event ¡C ¡if ¡the ¡ following ¡is ¡true. ¡
P(A ∩ B|C) = P(A|C)P(B|C)
See ¡an ¡example ¡in ¡Degroot ¡et ¡al. ¡Example ¡2.2.10 ¡
SLIDE 41 Assignments ¡
✺ HW3 ¡ ✺ Finish ¡Chapter ¡3 ¡of ¡the ¡textbook ¡ ✺ Next ¡(me: ¡Random ¡variable ¡
¡
SLIDE 42
Additional ¡References ¡
✺ Charles ¡M. ¡Grinstead ¡and ¡J. ¡Laurie ¡Snell ¡
"Introduc(on ¡to ¡Probability” ¡ ¡
✺ Morris ¡H. ¡Degroot ¡and ¡Mark ¡J. ¡Schervish ¡
"Probability ¡and ¡Sta(s(cs” ¡
SLIDE 43 Another ¡counting ¡problem ¡
✺ There ¡are ¡several ¡(>10) ¡freshmen, ¡
sophomores, ¡juniors ¡and ¡seniors ¡in ¡a ¡
- dormitory. ¡In ¡how ¡many ¡ways ¡can ¡a ¡team ¡of ¡10 ¡
students ¡be ¡chosen ¡to ¡represent ¡the ¡dorm? ¡ There ¡are ¡no ¡dis(nc(on ¡to ¡make ¡between ¡each ¡ individual ¡student ¡other ¡than ¡their ¡year ¡in ¡
SLIDE 44 Laws ¡of ¡Sets ¡ ¡
Commuta(ve ¡Laws ¡ ¡ A ¡∩ ¡B ¡= ¡B ¡∩ ¡A ¡ A ¡∪ ¡B ¡= ¡B ¡∪ ¡A ¡ ¡ Associa(ve ¡Laws ¡ ¡ (A ¡∩ ¡B) ¡∩ ¡C ¡= ¡A ¡∩ ¡(B ¡∩ ¡C) ¡ (A ¡∪ ¡B) ¡∪ ¡C ¡= ¡A ¡∪ ¡(B ¡∪ ¡C) ¡ ¡ Distribu(ve ¡Laws ¡ ¡ A ¡∩ ¡(B ¡∪ ¡C) ¡= ¡(A ¡∩ ¡B) ¡∪ ¡(A ¡∩ ¡C) ¡ A ¡∪ ¡(B ¡∩ ¡C) ¡= ¡(A ¡∪ ¡B) ¡∩ ¡(A ¡∪ ¡C) ¡ ¡
SLIDE 45 Laws ¡of ¡Set ¡
Idempotent ¡Laws ¡ ¡ A ¡∩ ¡A ¡= ¡A ¡ A ¡∪ ¡A ¡= ¡A ¡ ¡ Iden(ty ¡Laws ¡ ¡ A ¡∪ ¡ø ¡= ¡A ¡ A ¡∩ ¡U ¡= ¡A ¡ A ¡∪ ¡U ¡= ¡U ¡ A ¡∩ ¡ø ¡= ¡ø ¡ ¡ Involu(on ¡Law ¡(A ¡c) ¡c ¡= ¡A ¡ ¡ ¡ Complement ¡Laws ¡ ¡ A ¡∪ ¡Ac ¡= ¡U ¡ A ¡∩ ¡Ac ¡= ¡ø ¡ U ¡c ¡= ¡ø ¡ ø ¡c ¡= ¡U ¡ ¡ De ¡Morgan’s ¡Laws ¡ ¡ (A ¡∩ ¡B) ¡c ¡= ¡A ¡c ¡∪ ¡B ¡c ¡ (A ¡∪ ¡B) ¡c ¡= ¡A ¡c ¡∩ ¡B ¡c ¡ U ¡is ¡the ¡complete ¡set ¡
SLIDE 46
See ¡you ¡next ¡time ¡
See You!