Intersections and Unions of Events CS 70, Summer 2019 Lecture 17, - - PowerPoint PPT Presentation

intersections and unions of events
SMART_READER_LITE
LIVE PREVIEW

Intersections and Unions of Events CS 70, Summer 2019 Lecture 17, - - PowerPoint PPT Presentation

Intersections and Unions of Events CS 70, Summer 2019 Lecture 17, 7/23/19 1 / 25 Last Time: Conditional Probability I P [ A | B ] : restricting the sample space to B P [ A B ] = P [ A | B ] P [ B ] = P [ B | A ] P [ A ] I Total


slide-1
SLIDE 1

Intersections and Unions of Events

CS 70, Summer 2019 Lecture 17, 7/23/19

1 / 25

slide-2
SLIDE 2

Last Time: Conditional Probability

I P[A|B]:restricting the sample space to B

P[A ∩ B] = P[A|B] P[B] = P[B|A] P[A]

I “Total probability rule:” probability by disjoint cases I “Bayes’ Rule”: definition of conditional probability +

total probability rule

I Lets you “flip” the conditioning 2 / 25

slide-3
SLIDE 3

Computing Intersections

For any events A, B: P[A ∩ B] = What about any (three) events, A, B, C? P[A ∩ B ∩ C] =

3 / 25

PLA IB ]

. PCB] =

PCBIA ]

. PCA]

(

)

Plan B/C ]

Pfc ]

=
  • IPCAIB , C ]
. IPCBK ] . IPCC]

PCCIANB )

.pfAhB①←'

3970k!

  • usually
.

=

BIBI PCBLA

]

.

PIA

]

slide-4
SLIDE 4

Computing Intersections: Chaining

For any events A1, A2, . . . , An: P " n \

i=1

Ai # = P[A1] · P[A2|A1] · P[A3|A1 ∩ A2] · . . . Proof: Details are in the notes. General Idea: Key Insight: Treat (A1 ∩ A2 ∩ . . . ∩ An−1) as one event, treat An alone as another. Very similar to...

4 / 25

If

DEAN

ANANA

,]

  • Tintoretto

'nofAi

As , given Hultz

Induction

! ! !

  • PHAM
. . .

NAN

  • e)

MAN

]

' Uwsenditiond .

MTI

,

induction

  • question
.
slide-5
SLIDE 5

Drawing Cards I

I draw 4 cards sequentially from a standard deck, without

  • replacement. What is the probability that all 4 are clubs?

Ci = P[C1 ∩ C2 ∩ C3 ∩ C4] =

5 / 25

ith

card

is a

club

.

counting

' '

i'

= " and "

Rft

clubs ]

"

"

f

=

#

hands W/

49

.

Ipcc , ]

.

[ Calc , ]elP[ Csl oh Cz ]

it-and

=¥÷

,

= =

1312-11-40527

5251.5049

¥48 !

slide-6
SLIDE 6

Drawing Cards II

(Modified from notes.) I am dealt 5 cards. What is the probability that all five cards are the same suit, and none of them are face cards? C1 = For 2 ≤ i ≤ 5: Ci = P[C1 ∩ C2 ∩ C3 ∩ C4 ∩ C5] =

6 / 25

1st card

is

not face

.

ith

card

is

not

face

AND

same

suit

as

first

=
  • i

II.

IT

' Ea ' Eis
  • Notes
: "

count

"

by

ceases

cases

:

by suit

.

4

. IPC 5

hearts

I

slide-7
SLIDE 7

Cj

=

ith

card

is

A

non

  • face

spade

.

'Fi 's

Ii

Ea

. Es .

X 4

all

suits

slide-8
SLIDE 8

Independent Events

For any events A, B: P[A \ B] = P[A|B] · P[B] = P[B|A] · P[A] Two events A, B are independent if and only if: P[A \ B] = which is equivalent to both: P[A|B] = P[B|A] =

7 / 25

doe

skit

hate to be

independent

.

PEA] PCB]

PEAT

PCB]

slide-9
SLIDE 9

Independent or Not?

I Flipping two fair coins:

A = flip 1 is heads, B = flip 2 is tails.

I Rolling one red die, one blue die:

A = sum is 3, B = red die is 1.

8 / 25

"¥93

:{

" Tanis ,

#

¥¥¥

check

:

Fizz

PCA]

= 23-6 .

If

PC

An

BT

  • PER
  • -1,13=2]
=

136

PCB ]

= IT

check

: Is
  • ZEIT

X

slide-10
SLIDE 10

Independent or Not?

I Rolling one red die, one blue die:

A = sum is 7, B = red die is 1.

I Throwing 3 labeled balls into 3 labeled bins:

A = Bin #1 is empty, B = Bin #2 is empty.

9 / 25

IDEA ]

  • 6-
= ft

PCANBT

  • IPCR
'

1,13=6 ]

36

= 136

DEBT

  • T

check

:

To

. to

PEA ]

  • I
. } .z .
  • Ey

pCAhBI=PCbbifnm¥p¥y ]

PCB ]

  • Ey

Ime

=3

. I
  • I
  • IT

Also

by

symmetry

.

X

slide-11
SLIDE 11

Independent or Not?

A, B are generic events. The table shows probabilities of the intersections of the row and column. Event A Event A Event B P[A \ B] = 0.4 P[A \ B] = 0.3 Event B P[A \ B] = 0.2 P[A \ B] = 0.1 What is P[A]? What is P[B]? Are A and B independent?

10 / 25

=

IP [

An B ]

t

PCA ABT

=

0.4-10.2--0.6

=

IPC An

B ]

t

PEE

n B ]

=

0.4-10.3

=

0.7

0.4

I ( O

. 6)L 0.7 )

X

slide-12
SLIDE 12

Mutual Independence

How do we generalize independence from two events A, B, to multiple events A1, A2, . . . , An? Definition (Mutual Independence, Ver. 1) A1, A2, . . . , An are mutually independent if: For every I ✓ {1, 2, . . . , n}, with |I| 2, P "\

i∈I

Ai # = Y

i∈I

P[Ai] Ex: For 3 events:

11 / 25

any

subset

Of

{ I ,

2

, . . . , N }

IPC ?eq

,

, ,

Ai ]

=

PCA it P[ Az ) PCA , ]

.
slide-13
SLIDE 13

Mutual Independence

Definition (Mutual Independence, Ver. 2) A1, A2, . . . , An are mutually independent if: For every choice of Bi 2 {Ai, Ai}: P[B1 \ B2 \ . . . \ Bn] =

n

Y

i=1

P[Bi] Ex: For 3 events:

12 / 25

P [

A

,

n AT n At

, I =

P CA it

P CAIT PEAT

.

P [

AT

n Az

n AI I

=

PC AT I IP E Aid PC AT

slide-14
SLIDE 14

A Weaker Idea: Pairwise Independence

Definition (Pairwise Independence) A1, A2, . . . , An are pairwise independent if: For every i 6= j in {1, 2, . . . , n}: P[Ai \ Aj] = P[Ai] · P[Aj] Q: Does mutual imply pairwise? Q: Does pairwise imply mutual?

13 / 25

" every

possible

subset

"

includes

pairs

NO

.

↳ Discussion

slide-15
SLIDE 15

Using (Mutual) Independence: Coin Flips

What is the probability that after n flips, we have k heads and (n k) tails?

14 / 25

Hair

K

n

  • k
  • H
. . .

H

T

. . . .

T

  • N

ltfknheads

,

biased)

  • (1) P'4h55
"

#

sequences

k

H

,

In

  • k )

#

=

n

!

Winn

.

k¥5

,

=

PCSYemfifin.se?--PCmCaHnestPKmZas-cnesT---PCIItcnes ]

=

@ynyPCspep99c.s.e.9.jsEfiu.p

,

What

if

biased ?

PCH ]

  • up
=

TH

n
  • KT
= pkg
  • pp
  • k
slide-16
SLIDE 16

Using (Mutual) Independence: Dice Rolls

We roll n red dice and n blue dice. What is the probability that all the red dice are even, and all the blue dice are 5?

15 / 25

Exercise

.
slide-17
SLIDE 17

Break

Back by popular demand... Would you rather only use spoons (no forks) or only use forks (no spoons) for the rest of your life? A joke... Why was 6 afraid of 7? Because seven ate nine. Now, why was 7 afraid of 8?

16 / 25

slide-18
SLIDE 18

Unions of Events

Same exact story as in counting... P[A [ B] =

17 / 25

r

A

B

IP f AT

t PCB]

  • plan B ]
slide-19
SLIDE 19

Unions of Events

Same exact story as in counting... P[A [ B [ C] =

18 / 25

r

.

A

n

Bnc

B

C

p [ AT

+ PCB] t IPCC ]
  • PCA

n BT

  • PCA n CT
  • PCB

n C ] t

IPCA A B n C ]

slide-20
SLIDE 20

Unions Example: Rolling 3 Die

I roll a red die, a blue die, and a green die. What is the probability that at least one of these happen? A) The red die’s number is 3, or 4 B) The blue die’s number is 5. C) The green die’s number is 1 or 6. P[A] = P[B] = P[C] =

19 / 25

Inion

! !

I

  • ¥

f-

=

I

  • E

63

slide-21
SLIDE 21

Example: Rolling 3 Die

Continued... P[A \ B] = P[A \ C] = P[B \ C] = P[A \ B \ C] = P[A [ B [ C] =

20 / 25

÷÷÷

then

= E- is

I I KE )

  • FG
= ¥ }

subtract

!

I TX E)

=

E

  • ¥,

I ¥ ) (toX Z )

= If

add

7

2 t 3 b t

72

  • I 2
  • 24
  • I 2

t 4

=

zL¥

slide-22
SLIDE 22

Principle of Inclusion and Exclusion

Same exact story as in counting... For probability: Let A1, A2, . . . , An be events in our probability space. Denote {1, 2, . . . , n} by [n]. Then:

P " n [

i=1

Ai # = X

{i}✓[n]

P[Ai] X

{i,j}✓[n]

P[Ai \ Aj] + X

{i,j,k}✓[n]

P[Ai \ Aj \ Ak] . . . . . . + (1)n+1 P[A1 \ A2 \ . . . \ An]

21 / 25

.

u

.:*

.

"

"

" "

three

  • way

#

intersections

slide-23
SLIDE 23

The Union Bound

Q: What is the maximum possible value of the following? P[A1 [ A2 [ . . . [ An] A: P[A1 [ A2 [ . . . [ An] is always upper bounded by

22 / 25

At Az

pfa ,uAzUA3 )

=pfADtPCAI

t PEAS ]

As

  • SPCA
, ]t . . .tlPCAn7=§

,

Pati ]

slide-24
SLIDE 24

Union Bound Example: Rolling 3 Die

I roll a red die, a blue die, and a green die. What is an easy upper bound on the probability that at least one of these happen? A) The red die’s number is 3 or 4. B) The blue die’s number is 5. C) The green die’s number is 1 or 6.

23 / 25

EIPCATTPCBTHPKJ

puffed

'

=Z+ttE'

  • I

'

Feer

slide-25
SLIDE 25

Summary

I Computing event intersections = chaining conditional

probabilities

I Independent events = directly multiply probabilities I Mutual independence 6= pairwise independence

I Computing event unions = same exact strategy from

counting!

I Draw the Venn diagram for 2 events, 3 events I Principle of Inclusion-Exclusion for multiple events

I Union bound = worst case, the events are disjoint!

24 / 25

slide-26
SLIDE 26

Tips for Counting and Probability

I Don’t overthink it! Consider one thing at a time. I Label your events!! Be cognizant of whether or not

you are conditioning.

I If you have time, try a different strategy and see if it

gets you the same answer (e.g. cases vs. complement)

I Try small examples to sanity-check your strategy! I Practice, practice, practice!

25 / 25