powerpoint presentationarielpro/15251f15/slides/lec18.pdf · the birthday paradox 23 pr ... t63 •...

28
CMU 15-251 Probability I Teachers: Anil Ada Ariel Procaccia (this time)

Upload: others

Post on 31-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

CMU 15-251

Probability I

Teachers:

Anil Ada

Ariel Procaccia (this time)

Page 2: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Course overview

2

Page 3: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Gambling 101

3

7

71

7

7

1

5

55

5

5

5

3

33

9

9

3

8

28

2

2

8

Page 4: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Gambling 101

• 1 −5

6

4= 0.518

4

Page 5: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Gambling 101

• 1 −35

36

24= 0.491

5

Page 6: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Gambling 101

6

Page 7: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Pennies and gold

1. 1/6

2. 1/3

3. 2/3

4. 1

7

Page 8: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Language of probability

8

Page 9: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Language of probability

𝑆

𝑝

𝑥∈𝑆

𝑝 𝑥 = 1

9

0.10.5

𝑆

0.2 00.2

Page 10: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Language of probability

𝐸 ⊆ 𝑆

• Pr 𝐸 = 𝑥∈𝐸 𝑝(𝑥)

• 𝑥 ∈ 𝑆

Pr 𝐸 =

𝑥∈𝐸

𝑝 𝑥 =|𝐸|

|𝑆|

10

0.1

0.2

0.5

00.2

𝑆

Pr 𝐸 = 0.6

Page 11: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Language of probability

• 𝑆 = { 1,1 , 1,2 , 1,3 , 1,4 , 1,5 , 1,6 ,2,1 , 2,2 , 2,3 , 2,4 , 2,5 , 2,6 ,3,1 , 3,2 , 3,3 , 3,4 , 3,5 , 3,6 ,4,1 , 4,2 , 4,3 , 4,4 , 4,5 , 4,6 ,5,1 , 5,2 , 5,3 , 5,4 , 5,5 , 5,6 ,6,1 , 6,2 , 6,3 , 6,4 , 6,5 , (6,6)}

1. 1/9

2. 2/9

3. 3/9

4. 4/9

11

Page 12: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Conditional probability

𝐴 𝐵

Pr 𝐴 𝐵 = Pr[𝐴∩𝐵]Pr[𝐵]

𝐴 ∩ 𝐵𝐵

12

0.1

0.2

0.5

0

0.2

𝑆

𝐴

𝐵

𝐴 ∩ 𝐵

Page 13: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Pennies and gold, revisited

• 𝐺𝑖 𝑖 ∈ {1,2}

• Pr 𝐺1 =1

2, Pr 𝐺1 ∩ 𝐺2 =

1

3

• Pr 𝐺2 𝐺1 =1/3

1/2=2

3

13

Page 14: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Conditional probability

• Pr 𝐴 ∩ 𝐵 = Pr 𝐵 × Pr[𝐴|𝐵]

• 𝐴 𝐵 𝐵𝐴 𝐵

• Applying iteratively:Pr 𝐴1 ∩⋯∩ 𝐴𝑛 = Pr 𝐴1 × Pr 𝐴2 𝐴1 ×⋯Pr[𝐴𝑛|𝐴1, ⋯ , 𝐴𝑛−1]

14

Page 15: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

bayes’ rule

• Pr B × Pr A B = Pr 𝐴 ∩ 𝐵 = Pr 𝐴 × Pr[𝐵|𝐴]

15

Pr 𝐴 𝐵 =Pr 𝐴 Pr[𝐵|𝐴]

Pr[𝐵]

Page 16: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Monty Hall problem

16

Page 17: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Monty Hall problem

17

Page 18: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Monty Hall problem

• Pr 𝑃3 𝑂2 =Pr[𝑃3] Pr[𝑂2|𝑃3]

Pr[𝑂2]

• Pr[𝑃3] =1

3, Pr 𝑂2 𝑃3 = 1,

Pr[𝑂2] = 1/2

• Pr 𝑃3 𝑂2 = 2/3

1. 3/15

2. 4/15

3. 5/15

4. 6/15

18

Pr 𝐴 𝐵 =Pr 𝐴 Pr[𝐵|𝐴]

Pr[𝐵]

Page 19: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Independence

• 𝐴 𝐵Pr 𝐴 𝐵 = Pr[𝐴]

19

Page 20: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

The birthday paradox

• 𝑚

• 𝑆 = 1,… , 365 𝑚, s 𝑥 = (𝑥1, … 𝑥𝑚)

• 𝐸 = 𝑥 ∈ 𝑆 ∃𝑖, 𝑗, s.t. 𝑥𝑖 = 𝑥𝑗}

20

Page 21: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

The birthday paradox

• 𝐸

• 𝐸

• 𝐴𝑖 𝑖1,… , 𝑖 − 1

• 𝐸 = 𝐴1 ∩⋯∩ 𝐴𝑛•

Pr 𝐸 = Pr 𝐴1 × Pr 𝐴2 𝐴1 ×⋯Pr[𝐴𝑛|𝐴1, ⋯ , 𝐴𝑛−1]

21

Pr 𝐴𝑖 𝐴1, … , 𝐴𝑖−1 ?

Page 22: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

The birthday paradox

• 𝐴1 ∩⋯∩ 𝐴𝑖−1 𝑖 − 1

• 𝑖 − 1 𝑖

• Pr 𝐴𝑖 𝐴1, … , 𝐴𝑖−1 =365−(𝑖−1)

365= 1 −

𝑖−1

365

• Pr 𝐸 = 1 × 1 −1

365×⋯× 1 −

𝑚−1

365

• Pr 𝐸 = 1 − Pr[ 𝐸]

22

Page 23: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

The birthday paradox

23

Pr 𝐸 :

Pr 𝐸 :

Page 24: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

The birthday paradox

1. 1/2

2. 0.75

3. 0.99999999999997

4. 1

24

Page 25: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Birthday attack *

𝑆 𝑘 𝑓(𝑆)

𝑆1, 𝑆2 𝑓 𝑆1 = 𝑓 𝑆2•

o 𝑚

o 𝑓(𝑚)

o

𝑚𝑚′ 𝑓 𝑚 = 𝑓(𝑚′)

25

Page 26: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Birthday attack *

1,… , 2160

• 2160 = 280

26

Page 27: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Birthday attack *

263

27

Page 28: PowerPoint Presentationarielpro/15251f15/slides/lec18.pdf · The birthday paradox 23 Pr ... t63 • 27. Summary • o o o • o o 28. Title: PowerPoint Presentation Author: Monica

Summary

o

o

o

o

o

28