Probability and Statistics for Computer Science On - - PowerPoint PPT Presentation

probability and statistics
SMART_READER_LITE
LIVE PREVIEW

Probability and Statistics for Computer Science On - - PowerPoint PPT Presentation

Probability and Statistics for Computer Science On Condi(onal Probability and independence, Prof. Forsyth men(oned in the textbook These topics


slide-1
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
SLIDE 2

Announcement ¡

slide-3
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
SLIDE 4

Last ¡time ¡

✺ Probability ¡ ¡

✺ Coun(ng ¡ ¡ ✺ Review ¡of ¡basics ¡of ¡probability ¡ ✺ Condi(onal ¡Probability ¡

¡

slide-5
SLIDE 5

Content ¡

✺ Condi(onal ¡Probability ¡ ¡

✺ Review ¡the ¡main ¡concepts ¡ ✺ Examples ¡and ¡Misconcep8ons ¡of ¡

Condi(onal ¡Probability ¡ ¡

✺ Independence ¡ ✺ Condi(onal ¡Independence ¡

¡

slide-6
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
SLIDE 7

Content ¡

✺ Condi(onal ¡Probability ¡ ¡

✺ Review ¡the ¡main ¡concept ¡ ✺ Examples ¡and ¡Misconcep2ons ¡of ¡

Condi1onal ¡Probability ¡ ¡

✺ Independence ¡ ✺ Condi(onal ¡Independence ¡

¡

slide-8
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
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
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
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
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
SLIDE 13

Total ¡probability ¡using ¡conditional ¡ probability ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

slide-14
SLIDE 14

Total ¡probability ¡general ¡form ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

slide-15
SLIDE 15

Bayes ¡rule: ¡Prosecutor’s ¡Fallacy ¡

A: ¡Guilty ¡ B: ¡There ¡is ¡evidence ¡against ¡this ¡person ¡

slide-16
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
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? ¡

  • A. P(Bc|A) ¡
  • B. P(A|B) ¡

P(There is evidence | Innocent) = P(B|Ac) = 0.10

Guilty ¡

slide-18
SLIDE 18

Important ¡facts ¡

✺ Bayes ¡rule ¡ ✺ Total ¡probability ¡

P(A|B) = P(B|A)P(A) P(B)

slide-19
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) =

  • j

(P(A|Bj)P(Bj))

if Bi ∩ Bj = Ø for all i = j

slide-20
SLIDE 20

Content ¡

✺ Condi(onal ¡Probability ¡ ¡

✺ Review ¡the ¡main ¡concepts ¡ ✺ Examples ¡and ¡Misconcep8ons ¡of ¡

Condi(onal ¡Probability ¡ ¡

✺ Independence ¡ ✺ Condi(onal ¡Independence ¡

¡

slide-21
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
SLIDE 22

Independence ¡

✺ Alterna(ve ¡defini(on ¡deriva(on ¡ ¡

slide-23
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
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 ¡

  • r ¡P(B) ¡= ¡0 ¡
slide-25
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
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
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
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
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
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
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
SLIDE 32

Independence ¡in ¡Airline ¡

  • verbooking ¡example ¡ ¡

✺ 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
SLIDE 33

Independence ¡in ¡Airline ¡

  • verbooking ¡example ¡ ¡

✺ 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
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
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
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
SLIDE 37

Independence ¡of ¡empty ¡event ¡

✺ Q. ¡Any ¡event ¡is ¡independent ¡of ¡

empty ¡event ¡B. ¡

¡ ¡A. ¡True ¡ ¡ ¡ ¡ ¡ ¡B. ¡False ¡

slide-38
SLIDE 38

Content ¡

✺ Condi(onal ¡Probability ¡ ¡

✺ Review ¡the ¡main ¡concepts ¡ ✺ Examples ¡and ¡Misconcep8ons ¡of ¡

Condi(onal ¡Probability ¡ ¡

✺ Independence ¡ ✺ Condi1onal ¡Independence ¡

¡

slide-39
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
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
SLIDE 41

Assignments ¡

✺ HW3 ¡ ✺ Finish ¡Chapter ¡3 ¡of ¡the ¡textbook ¡ ✺ Next ¡(me: ¡Random ¡variable ¡

¡

slide-42
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
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 ¡

  • school. ¡
slide-44
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
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
SLIDE 46

See ¡you ¡next ¡time ¡

See You!