Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302...

111
1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof. Ilya Pollak

Transcript of Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302...

Page 1: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

1.SampleSpaceandProbabilityPartI

ECE302Fall2009TR3‐4:15pmPurdueUniversity,SchoolofECE

Prof.IlyaPollak

Page 2: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

ProbabilisJcModel

•  SamplespaceΩ=thesetofallpossibleoutcomesofanexperiment– E.g.,{+$1,‐$1}foraone‐monthstockmovementintheopJonexample;{$102,$100,$98}forthestockvalueaUertwomonths;{Obama,McCain,neither}foravoter’spreference,etc.

•  ProbabilitylawwhichassignstoasetAofpossibleoutcomes(alsocalledanevent)anumberP(A),calledtheprobabilityofA.

Page 3: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Sets:basictermsandnotaJon,1

A countably infinite (or countable) set is a set with infinitelymany elements which can be enumerated in a list, e.g.,the set of all integers 0,−1,1,−2,2,…{ }An example of an uncountable set is the set of all real numbersbetween 0 and 1, denoted [0,1]

Page 4: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Sets:basictermsandnotaJon,2

The set of all x that have a certain property P is denoted byx | x satisfies P{ },

e.g., the interval [0,1] can alternatively be written as x | 0 ≤ x ≤1{ }.

Page 5: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

SetoperaJons:complement

Page 6: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

SetoperaJons:union

More generally,

Snn=1

= S1∪ S2 ∪… = x | x ∈ Sn for some n{ }

Page 7: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

SetoperaJons:intersecJon

More generally,

Snn=1

= S1∩ S2 ∩… = x | x ∈ Sn for all n{ }

Page 8: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Disjointsets

Page 9: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

ParJJon

Page 10: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

CollecJvelyexhausJvesets

Page 11: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:threecointosses

H

H

H

T T

T

H

T

H

H

T

H

T

T

HHH

HHT

HTH

HTT

THH

THT

TTH

TTT

Sample space Ω = HHH,HHT,HTH,HTT,THH,THT,TTH,TTT{ }Event "heads on the first and second toss" is the set HHH,HHT{ }

Page 12: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:threecointosses

Page 13: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:threecointosses

Page 14: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:threecointosses

Page 15: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:threecointosses

Page 16: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:threecointosses

Page 17: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:threecointosses

Page 18: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:presidenJalelecJon% for Obama

% for McCain

100%

100%

Page 19: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:presidenJalelecJon% for Obama

% for McCain

100%

100%

Note: Even though the sample space is discrete in reality (the quantum is 1 voter out of 130M, or 0.00000077%), it is more conveniently modeled as continuous.

Page 20: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:presidenJalelecJon% for Obama

% for McCain

100%

100%

Is this sample space enough for answering these questions: (1) Will Obama win the popular vote? (2) Will Obama win the election?

Page 21: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:presidenJalelecJon% for Obama

% for McCain

100%

100%

Is this sample space enough for answering these questions: (1) Will Obama win the popular vote? (2) Will Obama win the election? (1) No: need to include 3rd-party candidates (2) No: need both 3rd-party candidates and electoral

(not popular) vote

Page 22: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:presidenJalelecJon% for Obama

% for McCain

100%

100%

Page 23: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:presidenJalelecJon% for Obama

% for McCain

100%

100%

Page 24: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

ProbabilisJcModel

•  SamplespaceΩ•  Probabilitylaw:assignstoaneventAanumberP(A)saJsfyingthefollowingprobabilityaxioms:

1. P(A) ≥ 02. If A∩ B =∅, then P(A∪ B) = P(A) + P(B)

If A1,A2,… are disjoint, then P Ann=1

= P(An )

n=1

3. P(Ω) =1

Page 25: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

RelaJonshipbetweenprobabilityandrelaJvefrequencyofoccurrence

Page 26: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:threecointosses

Suppose all outcomes are equally likelyP(Ω) =1 by axiom 3P HHH{ }( ) + P HHT{ }( ) +…+ P TTT{ }( ) = P(Ω) by axiom 2

P HHH{ }( ) = P HHT{ }( ) =… = P TTT{ }( ) =1/8

P(S4 ) = P("two tails in a row") = P HTT,TTH,TTT{ }( ) = 3/8 by axiom 2

Discrete uniform probability law : if Ω consists of N equally likelyoutcomes, then, for any event A,

P(A) =number of elements in A

N

Page 27: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:presidenJalelecJon% for Obama

% for McCain

100%

100%

Page 28: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:presidenJalelecJon% for Obama

% for McCain

100%

100%

Page 29: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:someproperJesofprobabilitylaws

Page 30: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:someproperJesofprobabilitylaws

Page 31: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:someproperJesofprobabilitylaws

Page 32: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:someproperJesofprobabilitylaws

Page 33: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:someproperJesofprobabilitylaws

Page 34: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:someproperJesofprobabilitylaws

(a) If A ⊂ B then P(A) ≤ P(B)Proof : Let C = Ac ∩ BThen B = A∪Cand C∩ A =∅ (since C ⊂ Ac ).Therefore,

P(B) = P(A∪C) =Axiom 2

P(A) + P(C) ≥Axiom 1 applied to P (C )

P(A)

Page 35: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:someproperJesofprobabilitylaws

Page 36: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:someproperJesofprobabilitylaws

Page 37: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:someproperJesofprobabilitylaws

Page 38: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:someproperJesofprobabilitylaws

Page 39: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:someproperJesofprobabilitylaws

Page 40: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:someproperJesofprobabilitylaws

Page 41: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:someproperJesofprobabilitylaws

(c) P(A∪ B) ≤ P(A) + P(B)Proof :Use property (b) : P(A∪ B) = P(A) + P(B) − P(A∩ B)

≥0, by Axiom 1

≤ P(A) + P(B)

Page 42: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:someproperJesofprobabilitylaws

(d) P(A∪ B∪C) = P(A) + P(Ac ∩ B) + P(Ac ∩ Bc ∩C)Proof :Since A, Ac ∩ B, Ac ∩ Bc ∩C form a partition for A∪ B∪C,the statement follows from Axiom 2.

Page 43: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

CondiJonalProbability•  NotaJon:P(A|B)•  ProbabilityofeventA,giventhateventBoccurred•  DefiniJon:assumingP(B)≠0,

•  CondiJonalprobabiliJesspecifyaprobabilitylawonthenewuniverseB(exercise)

Page 44: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:ProblemofPoints•  Besttwooutofthreefaircoinflips•  HelenbetsonH,TombetsonT

(a) What’stheprobabilitythatHelenwins1stround?

(b) What’stheprobabilitythatHelenwinsoverall?(c)  ThegameisinterruptedaUerHelenwins1stround.

What’sthecondiJonalprobabilitythatshewouldhavewonoverall?

•  SoluJon(a)  ½‐‐followsdirectlyfromthefactthatthecoinisfair.

Page 45: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

ProblemofPoints,SoluJon

H

H

H

T T

T

H

T

H

H

T

H

T

T

HHH

HHT

HTH

HTT

THH

THT

TTH

TTT

H wins 1st round

H wins overall

P(H wins 1st round) = 1/2 P(H wins 1st round and H wins overall) = 3/8

P(H wins overall | H wins 1st round) = P(H wins 1st round and H wins overall)/ P(H wins 1st round) = (3/8)/(1/2) = 3/4

Page 46: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

AlternaJvely,…

HHH

HHT

HTH

HTT

H wins 1st round

H wins overall View the blue set as the new sample space. Three out of four equally likely outcomes result in H’s overall win. Therefore, P(H wins overall | H wins 1st round) = 3/4.

Page 47: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example1.9:IntrusionDetecJonEvent A: intrusion Event B: alarm

Suppose that, from past experiences, we know that P(A) = 0.02, P(B|Ac) = 0.05, P(Bc|A) = 0.01

Find P(B), P(A|B), the missed detection probability P(Bc and A) , the false alarm probability P(B and Ac)

Page 48: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:IntrusionDetecJon

A Bc∩A

Event A: intrusion Event B: alarm

Suppose that, from past experiences, we know that P(A) = 0.02, P(B|Ac) = 0.05, P(Bc|A) = 0.01

Find P(B), P(A|B), the missed detection probability P(Bc and A) , the false alarm probability P(B and Ac)

Ac

B∩A

B∩Ac

Bc∩Ac

Page 49: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:IntrusionDetecJon

P(A) = 0.02 A

Bc∩A = missed detection

P(B|Ac)=0.05

Event A: intrusion Event B: alarm

Suppose that, from past experiences, we know that P(A) = 0.02, P(B|Ac) = 0.05, P(Bc|A) = 0.01

Find P(B), P(A|B), the missed detection probability P(Bc and A) , the false alarm probability P(B and Ac)

Ac

B∩A

B∩Ac = false alarm

Bc∩Ac

P(Bc|A)=0.01

Page 50: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:IntrusionDetecJon

P(A) = 0.02 A

Bc∩A = missed detection

P(B|Ac)=0.05

Event A: intrusion Event B: alarm

Suppose that, from past experiences, we know that P(A) = 0.02, P(B|Ac) = 0.05, P(Bc|A) = 0.01

Find P(B), P(A|B), the missed detection probability P(Bc and A) , the false alarm probability P(B and Ac)

Ac

B∩A

B∩Ac = false alarm

Bc∩Ac

P(Bc|A)=0.01

P(Bc∩A) = P(A)P(Bc|A) = 0.02·0.01 = 0.0002

Page 51: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:IntrusionDetecJon

P(A) = 0.02 A

Bc∩A = missed detection

P(B|Ac)=0.05

Event A: intrusion Event B: alarm

Suppose that, from past experiences, we know that P(A) = 0.02, P(B|Ac) = 0.05, P(Bc|A) = 0.01

Find P(B), P(A|B), the missed detection probability P(Bc and A) , the false alarm probability P(B and Ac)

P(Ac) = 0.98 Ac

B∩A

B∩Ac = false alarm

Bc∩Ac

P(Bc|A)=0.01

P(Bc∩A) = P(A)P(Bc|A) = 0.02·0.01 = 0.0002

Page 52: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:IntrusionDetecJon

P(A) = 0.02 A

Bc∩A = missed detection

P(B|Ac)=0.05

Event A: intrusion Event B: alarm

Suppose that, from past experiences, we know that P(A) = 0.02, P(B|Ac) = 0.05, P(Bc|A) = 0.01

Find P(B), P(A|B), the missed detection probability P(Bc and A) , the false alarm probability P(B and Ac)

P(Ac) = 0.98 Ac

B∩A

B∩Ac = false alarm

Bc∩Ac P(Bc|Ac)=0.95

P(Bc|A)=0.01

P(B|A)=0.99

P(Bc∩A) = P(A)P(Bc|A) = 0.02·0.01 = 0.0002

Page 53: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:IntrusionDetecJon

P(A) = 0.02 A

Bc∩A = missed detection

P(B|Ac)=0.05

Event A: intrusion Event B: alarm

Suppose that, from past experiences, we know that P(A) = 0.02, P(B|Ac) = 0.05, P(Bc|A) = 0.01

Find P(B), P(A|B), the missed detection probability P(Bc and A) , the false alarm probability P(B and Ac)

P(Ac) = 0.98 Ac

B∩A

B∩Ac = false alarm

Bc∩Ac P(Bc|Ac)=0.95

P(Bc|A)=0.01

P(B|A)=0.99

P(B∩A) = P(A)P(B|A) = 0.02·0.99 = 0.0198 P(Bc∩A) = P(A)P(Bc|A) = 0.02·0.01 = 0.0002

Page 54: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:IntrusionDetecJon

P(A) = 0.02 A

Bc∩A = missed detection

P(B|Ac)=0.05

Event A: intrusion Event B: alarm

Suppose that, from past experiences, we know that P(A) = 0.02, P(B|Ac) = 0.05, P(Bc|A) = 0.01

Find P(B), P(A|B), the missed detection probability P(Bc and A) , the false alarm probability P(B and Ac)

P(Ac) = 0.98 Ac

B∩A

B∩Ac = false alarm

Bc∩Ac P(Bc|Ac)=0.95

P(Bc|A)=0.01

P(B|A)=0.99

P(B∩Ac) = P(Ac)P(B|Ac) = 0.98·0.05 = 0.049 P(B∩A) = P(A)P(B|A) = 0.02·0.99 = 0.0198 P(Bc∩A) = P(A)P(Bc|A) = 0.02·0.01 = 0.0002

Page 55: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:IntrusionDetecJon

P(A) = 0.02 A

Bc∩A = missed detection

P(B|Ac)=0.05

Event A: intrusion Event B: alarm

Suppose that, from past experiences, we know that P(A) = 0.02, P(B|Ac) = 0.05, P(Bc|A) = 0.01

Find P(B), P(A|B), the missed detection probability P(Bc and A) , the false alarm probability P(B and Ac)

P(Ac) = 0.98 Ac

B∩A

B∩Ac = false alarm

Bc∩Ac P(Bc|Ac)=0.95

P(Bc|A)=0.01

P(B|A)=0.99 Event B

P(B∩Ac) = P(Ac)P(B|Ac) = 0.98·0.05 = 0.049 P(B∩A) = P(A)P(B|A) = 0.02·0.99 = 0.0198 P(Bc∩A) = P(A)P(Bc|A) = 0.02·0.01 = 0.0002

Page 56: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:IntrusionDetecJon

P(A) = 0.02 A

Bc∩A = missed detection

P(B|Ac)=0.05

Event A: intrusion Event B: alarm

Suppose that, from past experiences, we know that P(A) = 0.02, P(B|Ac) = 0.05, P(Bc|A) = 0.01

Find P(B), P(A|B), the missed detection probability P(Bc and A) , the false alarm probability P(B and Ac)

P(Ac) = 0.98 Ac

B∩A

B∩Ac = false alarm

Bc∩Ac P(Bc|Ac)=0.95

P(Bc|A)=0.01

P(B|A)=0.99 Event B

P(B∩Ac) = P(Ac)P(B|Ac) = 0.98·0.05 = 0.049 P(B∩A) = P(A)P(B|A) = 0.02·0.99 = 0.0198

P(B) = P(B∩A) + P(B∩Ac) = 0.0198 + 0.049 = 0.0688

P(Bc∩A) = P(A)P(Bc|A) = 0.02·0.01 = 0.0002

Page 57: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:IntrusionDetecJon

P(A) = 0.02 A

Bc∩A = missed detection

P(B|Ac)=0.05

Event A: intrusion Event B: alarm

Suppose that, from past experiences, we know that P(A) = 0.02, P(B|Ac) = 0.05, P(Bc|A) = 0.01

Find P(B), P(A|B), the missed detection probability P(Bc and A) , the false alarm probability P(B and Ac)

P(Ac) = 0.98 Ac

B∩A

B∩Ac = false alarm

Bc∩Ac P(Bc|Ac)=0.95

P(Bc|A)=0.01

P(B|A)=0.99 Event B

P(B∩Ac) = P(Ac)P(B|Ac) = 0.98·0.05 = 0.049

P(A|B) = P(A∩B)/P(B) =0.0198/0.0688 ≈ 0.288

P(B∩A) = P(A)P(B|A) = 0.02·0.99 = 0.0198

P(B) = P(B∩A) + P(B∩Ac) = 0.0198 + 0.049 = 0.0688

P(Bc∩A) = P(A)P(Bc|A) = 0.02·0.01 = 0.0002

Page 58: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example1.18:False‐PosiJvePuzzle

•  Acrimecommikedonanisland,populaJon5000

•  Apriori,allareequallylikelytohavecommikedit•  Basedonaforensictest,asuspectisarrested•  Apartfromthetest,nootherevidence

•  Accuracyofthetestis99.9%,i.e.,P(testisposiJve|suspectisguilty)=0.999andP(testisnegaJve|suspectisinnocent)=0.999

•  Youareonthejury.Doyouhave“reasonabledoubt”?

Page 59: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

False‐PosiJvePuzzle:SoluJon

•  Proceedsimilartotheintruderexample

•  P(+)=P(+andguilty)+P(+andinnocent)=P(+|guilty)P(guilty)+P(+|innocent)P(innocent)=0.999∙0.0002+0.001∙0.9998=0.0011996

•  P(guilty|+)=P(+andguilty)/P(+)=0.999∙0.0002/0.0011996≈0.167!!!

•  Theseeminglyreliabletestisnotveryreliableatall!

Page 60: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

•  Supposethisisrepeatedon1000islands•  Supposewetestall5,000,000peopleon1000islands

False‐PosiJvePuzzle:SomeIntuiJon

Page 61: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

•  Supposethisisrepeatedon1000islands•  Supposewetestall5,000,000peopleon1000islands•  Onaverage,weexpectroughlythefollowingtestresults:

False‐PosiJvePuzzle:SomeIntuiJon

5,000,000 people

1000 guilty

4,999,000 innocent

~1 tests -

~999 test +

Page 62: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

•  Supposethisisrepeatedon1000islands•  Supposewetestall5,000,000peopleon1000islands•  Onaverage,weexpectroughlythefollowingtestresults:

False‐PosiJvePuzzle:SomeIntuiJon

5,000,000 people

1000 guilty

4,999,000 innocent

~1 tests -

~999 test +

~4999 test +

~4,994,001 test -

Page 63: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

•  Supposethisisrepeatedon1000islands•  Supposewetestall5,000,000peopleon1000islands•  Onaverage,weexpectroughlythefollowingtestresults:

False‐PosiJvePuzzle:SomeIntuiJon

5,000,000 people

1000 guilty

4,999,000 innocent

~1 tests -

~999 test +

~4999 test +

~4,994,001 test -

~999 criminals out of ~5998 who tested + i.e., roughly 1/6

Page 64: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

•  Supposethisisrepeatedon1000islands•  Supposewetestall5,000,000peopleon1000islands•  Onaverage,weexpectroughlythefollowingtestresults:

•  I.e.,therearesofewcriminalsthatthebulkofpeoplewhotestposiJveareinnocent!

False‐PosiJvePuzzle:SomeIntuiJon

5,000,000 people

1000 guilty

4,999,000 innocent

~1 tests -

~999 test +

~4999 test +

~4,994,001 test -

~999 criminals out of ~5998 who tested + i.e., roughly 1/6

Page 65: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TotalProbabilityTheorem

A1

A2 A3B

Page 66: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TotalProbabilityTheorem

•  OnewayofcompuJngP(B):P(B)=P(B∩A1)+P(B∩A2)+P(B∩A3)

=P(B|A1)P(A1)+P(B|A2)P(A2)+P(B|A3)P(A3)

A1

A2 A3B

Page 67: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TotalProbabilityTheorem

•  OnewayofcompuJngP(B):P(B)=P(B∩A1)+P(B∩A2)+P(B∩A3)

=P(B|A1)P(A1)+P(B|A2)P(A2)+P(B|A3)P(A3)

•  Moregenerally,

P(B)=ΣiP(B|Ai)P(Ai)ifAi’saremutuallyexclusiveandBisasubsetoftheunionofAi’s

A1

A2 A3B

Page 68: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Bayes’Rule•  Priormodel:probabiliJesP(Ai)

Page 69: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Bayes’Rule•  Priormodel:probabiliJesP(Ai)•  Measurementmodel:P(B|Ai)

– condiJonalprobabilitytoobservedataBgiventhatthetruthisAi

Page 70: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Bayes’Rule•  Priormodel:probabiliJesP(Ai)•  Measurementmodel:P(B|Ai)

– condiJonalprobabilitytoobservedataBgiventhatthetruthisAi

•  WanttocomputeposteriorprobabiliBesP(Ai|B)– CondiJonalprobabilitythatthetruthisAigiventhatweobserveddataB

Page 71: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Bayes’Rule•  Priormodel:probabiliJesP(Ai)•  Measurementmodel:P(B|Ai)

– condiJonalprobabilitytoobservedataBgiventhatthetruthisAi

•  WanttocomputeposteriorprobabiliBesP(Ai|B)– CondiJonalprobabilitythatthetruthisAigiventhatweobserveddataB

P(Ai |B) =P(Ai∩ B)P(B)

=P(B | Ai)P(Ai)

P(B)

=P(B | Ai)P(Ai)P(B | A j )P(A j )

j∑

(by total probability thm)

Page 72: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

MulJplicaJonRule

P Aii=1

n

= P(A1)P(A2 | A1)P(A3 | A1∩ A2) ⋅… ⋅ P An Ai

i=1

n−1

,

provided all the conditioning events have nonzero probability

Page 73: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example1.10•  Threecardsaredrawnfromadeckof52cards,without

replacement.Ateachstep,eachoneoftheremainingcardsisequallylikelytobepicked.What’stheprobabilitythatnoneofthethreecardsisaheart?

•  LetAi={i‐thcardisnotaheart},i=1,2,3

Page 74: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example•  Threecardsaredrawnfromadeckof52cards,without

replacement.Ateachstep,eachoneoftheremainingcardsisequallylikelytobepicked.What’stheprobabilitythatnoneofthethreecardsisaheart?

•  LetAi={i‐thcardisnotaheart},i=1,2,3

P(A1) =3952

P(A1c ) =

1352

A1

A1c

Page 75: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example•  Threecardsaredrawnfromadeckof52cards,without

replacement.Ateachstep,eachoneoftheremainingcardsisequallylikelytobepicked.What’stheprobabilitythatnoneofthethreecardsisaheart?

•  LetAi={i‐thcardisnotaheart},i=1,2,3

P(A1) =3952

P(A1c ) =

1352

A1

A1c

A1∩ A2

A1∩ A2c€

P(A2 | A1) =3851

1351

Page 76: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example•  Threecardsaredrawnfromadeckof52cards,without

replacement.Ateachstep,eachoneoftheremainingcardsisequallylikelytobepicked.What’stheprobabilitythatnoneofthethreecardsisaheart?

•  LetAi={i‐thcardisnotaheart},i=1,2,3

P(A1) =3952

P(A1c ) =

1352

A1

A1c

A1∩ A2

A1∩ A2c

A1∩ A2∩ A3

A1∩ A2∩ A3c

P(A2 | A1) =3851

1351

1350

P(A3 | A1∩ A2) =3750

Page 77: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example•  Threecardsaredrawnfromadeckof52cards,without

replacement.Ateachstep,eachoneoftheremainingcardsisequallylikelytobepicked.What’stheprobabilitythatnoneofthethreecardsisaheart?

•  LetAi={i‐thcardisnotaheart},i=1,2,3

P(A1) =3952

P(A1c ) =

1352

A1

A1c

A1∩ A2

A1∩ A2c

A1∩ A2∩ A3

A1∩ A2∩ A3c

P(A2 | A1) =3851

1351

1350

P(A3 | A1∩ A2) =3750

P(A1∩ A2∩ A3) = P(A1)P(A2 | A1)P(A3 | A1∩ A2) =3952

⋅3851⋅3750

≈ 0.41

Page 78: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Example:Prisoner’sDilemma(p.58)•  Threeprisoners:A,B,andC.•  Onewillbeexecutednextday,tworeleased.•  PrisonerAaskstheguardtotellhimthenameofoneoftheothertwowhowillbereleased.

•  GuardsaysthatBwillbereleased.(Assumethattheguardistellingthetruth.)

•  Aargues:beforemychancestobeexecutedwere1/3,nowtheyare1/2sinceIknowit’seithermeorC.What’swrongwithhisreasoning?

Page 79: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Prisoner’sDilemma:Afewremarks

•  Theprisonersonlyknowthatoneofthemwillbeexecuted,butdonotknowwhichone.Thus,fromtheirpointofview,areasonablemodelisadiscreteuniformprobabilitylawthatassignseachofthemprobability1/3tobeexecuted.

•  Theguardknowswhichoneofthemwillbeexecuted.•  SinceAalreadyknowsthateitherBorCwillbereleased,itdoesnotseemlikeknowingthatBwillbereleasedshouldinfluenceA’schancesinanyway.Infact,A’sprobabilitytobeexecutedissJll1/3(fromA’spointofview),asshowninthenextfewslides.

Page 80: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Prisoner’sDilemma:SoluJon•  Theguard’sresponseneedstobeincludedintheprobabilisJc

model.

•  LetEi={prisoneriwillbeexecuted}fori=A,B,C•  LetGj={guardnamesprisonerj}forj=B,C

Page 81: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Prisoner’sDilemma:SoluJon•  Theguard’sresponseneedstobeincludedintheprobabilisJc

model.

•  LetEi={prisoneriwillbeexecuted}fori=A,B,C•  LetGj={guardnamesprisonerj}forj=B,C

EA

EB

EC

1/3

1/3

1/3

Page 82: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Prisoner’sDilemma:SoluJon•  Theguard’sresponseneedstobeincludedintheprobabilisJc

model.

•  LetEi={prisoneriwillbeexecuted}fori=A,B,C•  LetGj={guardnamesprisonerj}forj=B,C

EA

EB

EC

1/3

1/3

1/3

1/2

1/2

EA∩GB

EA∩GC

Page 83: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Prisoner’sDilemma:SoluJon•  Theguard’sresponseneedstobeincludedintheprobabilisJc

model.

•  LetEi={prisoneriwillbeexecuted}fori=A,B,C•  LetGj={guardnamesprisonerj}forj=B,C

EA

EB

EC

1/3

1/3

1/3

1/2

1/2

0

1

EA∩GB

EA∩GC EB∩GB

EB∩GC

Page 84: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Prisoner’sDilemma:SoluJon•  Theguard’sresponseneedstobeincludedintheprobabilisJc

model.

•  LetEi={prisoneriwillbeexecuted}fori=A,B,C•  LetGj={guardnamesprisonerj}forj=B,C

EA

EB

EC

1/3

1/3

1/3

1/2

1/2

0

1

10

EA∩GB

EA∩GC EB∩GB

EB∩GC

EC∩GB

EC∩GC

Page 85: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Prisoner’sDilemma:SoluJon•  Theguard’sresponseneedstobeincludedintheprobabilisJc

model.

•  LetEi={prisoneriwillbeexecuted}fori=A,B,C•  LetGj={guardnamesprisonerj}forj=B,C

EA

EB

EC

1/3

1/3

1/3

1/2

1/2

0

1

10

EA∩GB

EA∩GC EB∩GB

EB∩GC

EC∩GB

EC∩GC

1/6

1/6

0

1/3

1/3

0

Page 86: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Prisoner’sDilemma:SoluJon•  Theguard’sresponseneedstobeincludedintheprobabilisJc

model.

•  LetEi={prisoneriwillbeexecuted}fori=A,B,C•  LetGj={guardnamesprisonerj}forj=B,C

EA

EB

EC

1/3

1/3

1/3

1/2

1/2

0

1

10

EA∩GB

EA∩GC EB∩GB

EB∩GC

EC∩GB

EC∩GC

1/6

1/6

0

1/3

1/3

0

P(EA|GB) = P(EA∩GB)/P(GB) = (1/6)/(1/6 + 0 + 1/3) = 1/3

Page 87: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TheMontyHallPuzzle(Ex.1.12)

•  Prizebehindoneofthreedoors.•  Contestantpicksadoor.•  Host(whoknowswheretheprizeis)opensoneoftheremainingtwodoorswhichdoesnothavetheprize.

•  Contestantisofferedanopportunitytostaywithhisdoor,ortoswitchtoanotherdoor.

•  Stayorswitch?

Page 88: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TheMontyHallPuzzle:SoluJon

•  Ifstay,P(win)=1/3

Page 89: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TheMontyHallPuzzle:SoluJon

•  Ifstay,P(win)=1/3•  Ifswitch,theonlywaytoloseisifiniJallypointedtothedoorwithprize:P(lose)=1/3andsoP(win)=2/3

Page 90: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TheMontyHallPuzzle:SoluJon

•  Ifstay,P(win)=1/3•  Ifswitch,theonlywaytoloseisifiniJallypointedtothedoorwithprize:P(lose)=1/3andsoP(win)=2/3

•  Conclusion:mustswitch!

•  Switchingisadvantageousbecausethehost’sacJontellsyousomething.IfyouiniJallypickedadoorwithnoprize,heisforcedtoopentheotherdoorwithnoprize.

Page 91: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TheMontyHallPuzzle:Discussion

•  Crucialpartsoftheproblemstatement:–  thehostknowswheretheprizeis– hemustopenthedoorwithnoprize

Page 92: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TheMontyHallPuzzle:Discussion

•  Crucialpartsoftheproblemstatement:–  thehostknowswheretheprizeis– hemustopenthedoorwithnoprize

•  Thus,ifyouhavechosenadoorwithnoprize,youareforcinghimtoopentheonlyotherdoorwithnoprizeandthusshowyouwheretheprizeis.

Page 93: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TheMontyHallPuzzle:AnotherSoluJon

•  UsethetotalprobabilitytheoremtoevaluatetheprobabiliJesofwinningunderthetwostrategies.

Page 94: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TheMontyHallPuzzle:AnotherSoluJon

•  UsethetotalprobabilitytheoremtoevaluatetheprobabiliJesofwinningunderthetwostrategies.

•  LetW=“win”andN=“originallypointtoadoorwithnoprize”.

Page 95: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TheMontyHallPuzzle:AnotherSoluJon

•  UsethetotalprobabilitytheoremtoevaluatetheprobabiliJesofwinningunderthetwostrategies.

•  LetW=“win”andN=“originallypointtoadoorwithnoprize”.•  P(N)=2/3;P(Nc)=1/3.

Page 96: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TheMontyHallPuzzle:AnotherSoluJon

•  UsethetotalprobabilitytheoremtoevaluatetheprobabiliJesofwinningunderthetwostrategies.

•  LetW=“win”andN=“originallypointtoadoorwithnoprize”.•  P(N)=2/3;P(Nc)=1/3.

•  Ifyoudonotswitch,P(W|N)=0andP(W|Nc)=1.

Page 97: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TheMontyHallPuzzle:AnotherSoluJon

•  UsethetotalprobabilitytheoremtoevaluatetheprobabiliJesofwinningunderthetwostrategies.

•  LetW=“win”andN=“originallypointtoadoorwithnoprize”.•  P(N)=2/3;P(Nc)=1/3.

•  Ifyoudonotswitch,P(W|N)=0andP(W|Nc)=1.•  So,ifyoudonotswitch,P(W)=P(W|N)P(N)+P(W|Nc)P(Nc)=1/3.

Page 98: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TheMontyHallPuzzle:AnotherSoluJon

•  UsethetotalprobabilitytheoremtoevaluatetheprobabiliJesofwinningunderthetwostrategies.

•  LetW=“win”andN=“originallypointtoadoorwithnoprize”.•  P(N)=2/3;P(Nc)=1/3.

•  Ifyoudonotswitch,P(W|N)=0andP(W|Nc)=1.•  So,ifyoudonotswitch,P(W)=P(W|N)P(N)+P(W|Nc)P(Nc)=1/3.

•  Ifyouswitch,P(W|N)=1becauseifyouoriginallychooseadoorwithnoprizethehostisforcedtoopentheonlyotherdoorwithnoprize.

Page 99: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TheMontyHallPuzzle:AnotherSoluJon

•  UsethetotalprobabilitytheoremtoevaluatetheprobabiliJesofwinningunderthetwostrategies.

•  LetW=“win”andN=“originallypointtoadoorwithnoprize”.•  P(N)=2/3;P(Nc)=1/3.

•  Ifyoudonotswitch,P(W|N)=0andP(W|Nc)=1.•  So,ifyoudonotswitch,P(W)=P(W|N)P(N)+P(W|Nc)P(Nc)=1/3.

•  Ifyouswitch,P(W|N)=1becauseifyouoriginallychooseadoorwithnoprizethehostisforcedtoopentheonlyotherdoorwithnoprize.

•  Ifyouswitch,P(W|Nc)=0becauseifyouoriginallychoosethedoorwiththeprize,youwillswitchoutofitandlose.

Page 100: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

TheMontyHallPuzzle:AnotherSoluJon

•  UsethetotalprobabilitytheoremtoevaluatetheprobabiliJesofwinningunderthetwostrategies.

•  LetW=“win”andN=“originallypointtoadoorwithnoprize”.•  P(N)=2/3;P(Nc)=1/3.

•  Ifyoudonotswitch,P(W|N)=0andP(W|Nc)=1.•  So,ifyoudonotswitch,P(W)=P(W|N)P(N)+P(W|Nc)P(Nc)=1/3.

•  Ifyouswitch,P(W|N)=1becauseifyouoriginallychooseadoorwithnoprizethehostisforcedtoopentheonlyotherdoorwithnoprize.

•  Ifyouswitch,P(W|Nc)=0becauseifyouoriginallychoosethedoorwiththeprize,youwillswitchoutofitandlose.

•  So,ifyouswitch,P(W)=P(W|N)P(N)+P(W|Nc)P(Nc)=2/3.

Page 101: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Two‐EnvelopesPuzzle(p.58)

•  Youarehandedtwoenvelopes,eachcontaininganintegernumberofdollars,unknowntoyou.

•  Thetwoamountsaredifferent.

•  Youselectatrandomoneenvelopeandlookinside.

•  YoucaneithersJckwiththisenvelopeortaketheotherenvelope.YourobjecJveistogetthelargeramount.

•  Doesitmakerwhatyoudo?

Page 102: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Two‐EnvelopesPuzzle:SoluJon•  MakeindependentflipsofafaircoinunJlheadscomeupforthe

firstJme.LetX=1/2+numberoftossestogetfirstH.

•  Strategy:–  Iftheamountinyourenvelope>X,stay

–  Iftheamountinyourenvelope<X,switch

Page 103: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Two‐EnvelopesPuzzle:SoluJon•  MakeindependentflipsofafaircoinunJlheadscomeupforthe

firstJme.LetX=1/2+numberoftossestogetfirstH.

•  Strategy:–  Iftheamountinyourenvelope>X,stay

–  Iftheamountinyourenvelope<X,switch

•  DenotethetwoamountsdandD,d<D

Page 104: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Two‐EnvelopesPuzzle:SoluJon•  MakeindependentflipsofafaircoinunJlheadscomeupforthe

firstJme.LetX=1/2+numberoftossestogetfirstH.

•  Strategy:–  Iftheamountinyourenvelope>X,stay

–  Iftheamountinyourenvelope<X,switch

•  DenotethetwoamountsdandD,d<D•  Case1:X<d‐‐‐alwaysstay‐‐‐winwithprobability1/2

Page 105: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Two‐EnvelopesPuzzle:SoluJon•  MakeindependentflipsofafaircoinunJlheadscomeupforthe

firstJme.LetX=1/2+numberoftossestogetfirstH.

•  Strategy:–  Iftheamountinyourenvelope>X,stay

–  Iftheamountinyourenvelope<X,switch

•  DenotethetwoamountsdandD,d<D•  Case1:X<d‐‐‐alwaysstay‐‐‐winwithprobability1/2•  Case2:X>D‐‐‐alwaysswitch‐‐‐winwithprobability1/2

Page 106: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Two‐EnvelopesPuzzle:SoluJon•  MakeindependentflipsofafaircoinunJlheadscomeupforthe

firstJme.LetX=1/2+numberoftossestogetfirstH.

•  Strategy:–  Iftheamountinyourenvelope>X,stay

–  Iftheamountinyourenvelope<X,switch

•  DenotethetwoamountsdandD,d<D•  Case1:X<d‐‐‐alwaysstay‐‐‐winwithprobability1/2•  Case2:X>D‐‐‐alwaysswitch‐‐‐winwithprobability1/2•  Case3:d<X<D‐‐‐stayifpickD,switchifpickd‐‐‐win!

Page 107: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Two‐EnvelopesPuzzle:SoluJon•  MakeindependentflipsofafaircoinunJlheadscomeupforthe

firstJme.LetX=1/2+numberoftossestogetfirstH.

•  Strategy:–  Iftheamountinyourenvelope>X,stay

–  Iftheamountinyourenvelope<X,switch

•  DenotethetwoamountsdandD,d<D•  Case1:X<d‐‐‐alwaysstay‐‐‐winwithprobability1/2•  Case2:X>D‐‐‐alwaysswitch‐‐‐winwithprobability1/2•  Case3:d<X<D‐‐‐stayifpickD,switchifpickd‐‐‐win!•  P(win)=P(win|X<d)P(X<d)+P(win|X>D)P(X>D)+P(win|d<X<D)P(d<X<D)(bytotalprobabilitytheorem)

Page 108: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Two‐EnvelopesPuzzle:SoluJon•  MakeindependentflipsofafaircoinunJlheadscomeupforthe

firstJme.LetX=1/2+numberoftossestogetfirstH.

•  Strategy:–  Iftheamountinyourenvelope>X,stay

–  Iftheamountinyourenvelope<X,switch

•  DenotethetwoamountsdandD,d<D•  Case1:X<d‐‐‐alwaysstay‐‐‐winwithprobability1/2•  Case2:X>D‐‐‐alwaysswitch‐‐‐winwithprobability1/2•  Case3:d<X<D‐‐‐stayifpickD,switchifpickd‐‐‐win!•  P(win)=P(win|X<d)P(X<d)+P(win|X>D)P(X>D)+P(win|d<X<D)P(d<X<D)=1/2P(X<d)+1/2P(X>D)+P(d<X<D)

Page 109: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Two‐EnvelopesPuzzle:SoluJon•  MakeindependentflipsofafaircoinunJlheadscomeupforthe

firstJme.LetX=1/2+numberoftossestogetfirstH.

•  Strategy:–  Iftheamountinyourenvelope>X,stay

–  Iftheamountinyourenvelope<X,switch

•  DenotethetwoamountsdandD,d<D•  Case1:X<d‐‐‐alwaysstay‐‐‐winwithprobability1/2•  Case2:X>D‐‐‐alwaysswitch‐‐‐winwithprobability1/2•  Case3:d<X<D‐‐‐stayifpickD,switchifpickd‐‐‐win!•  P(win)=P(win|X<d)P(X<d)+P(win|X>D)P(X>D)+P(win|d<X<D)P(d<X<D)=1/2P(X<d)+1/2P(X>D)+P(d<X<D)

=1/2(P(X<d)+P(X>D)+P(d<X<D))+1/2P(d<X<D) =1

Page 110: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Two‐EnvelopesPuzzle:SoluJon•  MakeindependentflipsofafaircoinunJlheadscomeupforthe

firstJme.LetX=1/2+numberoftossestogetfirstH.

•  Strategy:–  Iftheamountinyourenvelope>X,stay

–  Iftheamountinyourenvelope<X,switch

•  DenotethetwoamountsdandD,d<D•  Case1:X<d‐‐‐alwaysstay‐‐‐winwithprobability1/2•  Case2:X>D‐‐‐alwaysswitch‐‐‐winwithprobability1/2•  Case3:d<X<D‐‐‐stayifpickD,switchifpickd‐‐‐win!•  P(win)=P(win|X<d)P(X<d)+P(win|X>D)P(X>D)+P(win|d<X<D)P(d<X<D)=1/2P(X<d)+1/2P(X>D)+P(d<X<D)

=1/2(P(X<d)+P(X>D)+P(d<X<D))+1/2P(d<X<D)=1/2(1+P(d<X<D))>1/2

Page 111: Sample space and probability - Purdue Engineering · 1. Sample Space and Probability Part I ECE 302 Fall 2009 TR 3‐4:15pm Purdue University, School of ECE Prof.

Two‐EnvelopesPuzzle:Comment

•  NotethatXcanbeanyrandomvariablehavingnon‐zerovaluesat3/2,5/2,7/2(or,infact,atanypoint(s)on]1,2[,atanypoint(s)on]2,3[,etc.)