Intro to Discrete Probability CS 70, Summer 2019 Lecture 15, - - PowerPoint PPT Presentation

intro to discrete probability
SMART_READER_LITE
LIVE PREVIEW

Intro to Discrete Probability CS 70, Summer 2019 Lecture 15, - - PowerPoint PPT Presentation

Intro to Discrete Probability CS 70, Summer 2019 Lecture 15, 7/18/19 1 / 24 Why Learn Probability? I Uncertainty 6 = nothing is known I Many decisions are made under uncertainty I Understanding probability gives a precise , unambiguous ,


slide-1
SLIDE 1

Intro to Discrete Probability

CS 70, Summer 2019 Lecture 15, 7/18/19

1 / 24
slide-2
SLIDE 2

Why Learn Probability?

I Uncertainty 6= “nothing is known” I Many decisions are made under uncertainty

I Understanding probability gives a precise, unambiguous, logical way to reason about uncertainty I Also learn about good yet simple models for many real world situations

I Uncertainty can also be your friend!

I We use artificial uncertainty to design good algorithms

2 / 24
slide-3
SLIDE 3

Flipping Coins

I flip three coins. What is the set of outcomes? Now, I flip n different coins. What is the set of outcomes? How many outcomes are there?

3 / 24

HHHt8

  • utcomes
.

④ springs w/ HM

,

Iengthn

.

2N

Outcomes

.

€t

slide-4
SLIDE 4

Probability Spaces

We formalize “experimental outcomes” or “samples”: A probability space is a sample space Ω, with a probability function P[·] such that: I For each sample ω 2 Ω, we have 0  P(ω)  1 I The sum of probabilities over all ω 2 Ω is 1.

4 / 24

Pr

slide-5
SLIDE 5

Example: Flipping Coins

I flip three fair coins. What is the sample space? What are the probabilities? Now, I flip n different fair coins. What is the sample space? What are the probabilities?

5 / 24
  • lpfittrifg

µy

. 8
  • utcomes
.

← ¥

is'

un

slide-6
SLIDE 6

Example: Flipping Coins

I flip three biased coins, with heads probability p 6= 1

2.

What is the sample space? What are the probabilities? Why were we able to multiply? We’ll see next week...

6 / 24
  • y

PCTHT)

  • ft

Pll

  • p)

=p ( I

  • plz

iii¥ka⇒a⇒

=

( I

  • p>3
slide-7
SLIDE 7

Events

An event A is a subset of outcomes ω 2 Ω. The probability of an event A is P[A] = X

ω∈A

P[ω]

7 / 24

*

er

me

sum

  • f

probabilities

  • f

all

  • utcomes

in

A

.
slide-8
SLIDE 8

Example: Flipping Coins

Let A be the event where I flip at least 2 heads. I flip three fair coins. What is P[A]? I flip three biased coins, with heads probability p. What is P[A]?

8 / 24

A :

HHH THH

IPCAJ

  • gttsttgtttg

HTH

=L

HHT

2

A

:

HHH

P[HHHI=p3

THH

HTH

}

'PCTHHJ
  • Ci
  • p>p2

HHT

PLAT

  • p3t3G-p7p2
slide-9
SLIDE 9

Uniform Probability Spaces

We use “uniform” to describe probability spaces where all

  • utcomes have the same probability.

For all ω 2 Ω, we have: P[ω] = 1 |Ω| As a result, for an event A: P[A] = |A| |Ω| This is helpful for larger probability spaces!

9 / 24

size

  • f

  • utcome

space

.

CAT

  • Eea

"

Yet

,

  • Earth

I

slide-10
SLIDE 10

Rolling Dice

I roll 2 fair dice. What is the probability that both of my rolls are even? What is the probability that both rolls are greater than 2?

10 / 24

unique

.

?s⇒

⇐ i' ⇐ 2--36=154

2,4 , 6

24.6

#

A

IAH

  • 3×-3=9

/¥Y

PIAF

956=4

.

EE

IAI

  • 4×-4

PEAT

  • 1656--4
slide-11
SLIDE 11

Rolling Dice

What is the probability that at least one roll is less than 3? What is the probability that the first roll is strictly greater than the second?

11 / 24

¢

A =

IAI

  • f

#

whey

.se

1) tf

# Y.YFZDiceg-f.gg =

2×6+6×2

  • 2×2
=

12

  • 112-4=20
.

PFA)

  • 23dg
  • Ig
.

£6

Ai

1)

first

>

second >

same

IAH IAI -16=154

2)

second

>

first

size

  • IAI
  • _

15

3)

first

  • second
.

6

WAYS

PCA]=}Iy=5Tz

slide-12
SLIDE 12

Drawing Marbles I

I have an urn with 100 marbles. Exactly 50 of them are blue and 50 of them are red. If I draw 8 marbles from the urn without replacement, what is the probability I get 6 red and 2 blue?

12 / 24

Drawing

all at
  • nce

info

=ioo÷

IAI

  • 1587158 )

RRR.EE?aYgInmenis:ofz,=C8 )

Ed Yue

.

IAH II )

¥49

play

=l58K

=i8tI%÷*s÷

I

1189

slide-13
SLIDE 13

Drawing Marbles I

If I draw 8 marbles from the urn with replacement, what is the probability I get 6 red and 2 blue?

13 / 24

Go

sequentially

  • i

Irl

  • l0¥0×

1008

sequentially

  • rder

8mA

Hers :e¥EBntrrbrthRR

and

( Sf)

RRRRRRBB

Fixt

:
  • 50×-50×-50×50=-50×-50--508

TE

IA 1=1861508

REAL 1¥

,

= 1815081008
slide-14
SLIDE 14

Drawing Marbles II

I have an urn with 100 marbles. 50 of them are blue, 50 of them are red, and 50 of them are yellow. If I draw 8 marbles from the urn without replacement, what is the probability I get 3 red, 3 blue, and 2 yellow?

14 / 24

Exercise

.
slide-15
SLIDE 15

Drawing Marbles II

If I draw 8 marbles from the urn with replacement, what is the probability I get 3 red, 3 blue, and 2 yellow? Why didn’t we use stars and bars? Discuss.

15 / 24
slide-16
SLIDE 16

Why No Stars and Bars?

If we are running an experiment where we sample a set of objects, the outcomes counted by stars-and-bars is a non-uniform probability space.

16 / 24

One

  • utcome

slide-17
SLIDE 17

The Birthday Problem

If there are n people in a room, what is the probability that at least two people share the same birthday? First (naive) attempt:

17 / 24

2

people

same

:

"

me

same

:

}Y%m

!
slide-18
SLIDE 18

The Birthday Problem

Second attempt:

18 / 24

complement

:

count ways

no
  • ne

has same

birthday

.

Ir

)

=

3-65×-365×-365

. .
  • +3-56
=

365N

.

complement

y

n

I AT

=

356×3-64×-363

. . 365-+4=3651
  • 1365
  • h) !

n

IA I

=

Irl

  • 3651

( 365

  • n) !

PEA ]

=

I

  • 736655¥36ST
slide-19
SLIDE 19

The Birthday Problem: Some Stats

For n = 10, the probability is 0.11. For n = 23, the probability is 0.5. For n = 70, the probability is 0.999.

19 / 24
slide-20
SLIDE 20

The Monty Hall Problem

You’re on a game show. There are 3 doors you can choose from. Two of the doors lead to GOATS! One of them has a PRIZE! You pick a door. The host then opens a different door that leads to a goat. He now gives you the option of switching to the other unopened door. Poll: Should you switch?

20 / 24
slide-21
SLIDE 21

Monty Hall: Sample Space

Each game, there are three implicit choices (C1, C2, C3):

  • 1. Which door leads to the prize?
  • 2. Which door do you pick?
  • 3. Which door does the host reveal to you?

Tree of Outcomes:

21 / 24

C ,

\

Rattans

.

I

2 3

c.

113%47

,

Isbt

's !! ! ! 'm

slide-22
SLIDE 22

Monty Hall: Probabilities

Two cases: (1) You initially choose the prize door (2) You initially choose a goat (1) (2)

22 / 24

prob

.
  • f

a

yellow

leaf

:

sum

to

2 ?

⇐HIKE)

  • its

bits ) -16ft)

prob

  • f

blue

leaf

It

}

=L

t.sk?XH= 'T

a-

Cl

I 2 3 c .

113%47

,

Is ! !

's

http

slide-23
SLIDE 23

Monty Hall: Events

Let W1 = the contestant switches doors and wins. Let W2 = the contestant stays and wins.

23 / 24

43

43

IN

C l

l z 3 c .

113.93

Ad,

Cs

L's !

L

's % ! ! t.az
slide-24
SLIDE 24

Summary

I Proceed methodically.

I What are the possible outcomes? I What is the probability for each outcome? I Is the sample space uniform or non-uniform?

I For uniform probability spaces, boils down to counting!

24 / 24