Probability p3
Probability p3
Probability p3
B
A
A∩B
2. What is P(B|A)?
(a) 1/16 (b) 1/8 (c) 1/4 (d) 1/5
answer: 1. (b) 1/8. 2. (d) 1/5.
Counting we find |A| = 5, |B| = 8 and |A ∩ B| = 1. Since all sequences
are equally likely
P(A ∩ B) |A ∩ B| |B ∩ A|
P(A|B) = = = 1/8. P(B|A) = = 1/5.
P(B) |B| |A|
Table Question
Discussion: Most people say that it is more likely that Steve is a librarian
than a farmer. Almost all people fail to consider that for every male
librarian in the United States, there are more than fifty male farmers.
When this is explained, most people who chose librarian switch their
solution to farmer.
This illustrates how people often substitute representativeness for
likelihood. The fact that a librarian may be likely to have the above
personality traits does not mean that someone with these traits is likely to
be a librarian.
Multiplication Rule, Law of Total Probability
Multiplication rule: P(A ∩ B) = P(A|B) · P(B).
Ω
B1
A ∩ B1
A ∩ B2 A ∩ B3
B2 B3
Trees
Organize computations
Compute total probability
Compute Bayes’ formula
Example. : Game: 5 red and 2 green balls in an urn. A random ball
is selected and replaced by a ball of the other color; then a second
ball is drawn.
1. What is the probability the second ball is red?
2. What is the probability the first ball was red given the second ball
was red?
5/7 2/7
First draw R1 G1
4/7 3/7 6/7 1/7
Second draw
R2 G2 R2 G2
Solution
5 4 2 6 32
1. The law of total probability gives P(R2 ) = · + · =
7 7 7 7 49
P(R1 ∩ R2 ) 20/49 20
2. Bayes’ rule gives P(R1 |R2 ) = = =
P(R2 ) 32/49 32
Concept Question: Trees 1
x
A1 y A2
B1 z B2 B1 B2
C1 C2 C1 C2 C1 C2 C1 C2
(a) P(A1 )
(b) P(A1 |B2 )
(c) P(B2 |A1 )
(d) P(C1 |B2 ∩ A1 ).
answer: (a) P(A1 ).
Concept Question: Trees 2
x
A1 y A2
B1 z B2 B1 B2
C1 C2 C1 C2 C1 C2 C1 C2
(a) P(B2 )
(b) P(A1 |B2 )
(c) P(B2 |A1 )
(d) P(C1 |B2 ∩ A1 ).
answer: (c) P(B2 |A1 ).
Concept Question: Trees 3
x
A1 y A2
B1 z B2 B1 B2
C1 C2 C1 C2 C1 C2 C1 C2
(a) P(C1 )
(b) P(B2 |C1 )
(c) P(C1 |B2 )
(d) P(C1 |B2 ∩ A1 ).
answer: (d) P(C1 |B2 ∩ A1 ).
Concept Question: Trees 4
x
A1 y A2
B1 z B2 B1 B2
C1 C2 C1 C2 C1 C2 C1 C2
(a) C1
(b) B2 ∩ C1
(c) A1 ∩ B2 ∩ C1
(d) C1 |B2 ∩ A1 .
answer: (c) A1 ∩ B2 ∩ C1 .
Let’s Make a Deal with Monty Hall
One door hides a car, two hide goats.
The contestant chooses any door.
Monty always opens a different door with a goat. (He
can do this because he knows where the car is.)
The contestant is then allowed to switch doors if she
wants.
What is the best strategy for winning a car?
(a) Switch (b) Don’t switch (c) It doesn’t matter
Board question: Monty Hall
Organize the Monty Hall problem into a tree and compute
the probability of winning if you always switch.
Hint first break the game into a sequence of actions.
answer: Switch. P(C |switch) = 2/3
It’s easiest to show this with a tree representing the switching strategy:
First the contestant chooses a door, (then Monty shows a goat), then the
contestant switches doors.
Probability Switching Wins the Car
1/3 2/3
Chooses
C G
0 1 1 0
Switches
C G C G
1 2
The (total) probability of C is P(C |switch) = 3 ·0+ 3 · 1 = 23 .
Independence
Events A and B are independent if the probability that
one occurred is not affected by knowledge that the other
occurred.
⇔ P(A ∩ B) = P(A)P(B)
Table/Concept Question: Independence
(Work with your tablemates, then everyone click in the answer.)
Notice that knowing B, removes 6 as a possibility for the first die and
makes A more probable. So, knowing B occurred changes the probability
of A.
But, knowing C does not change the probabilities for the possible values of
the first roll; they are still 1/6 for each value. In particular, knowing C
occured does not change the probability of A.
P(B|A) · P(A)
P(A|B) =
P(B)
Often compute the denominator P(B) using the law of
total probability.
Board Question: Evil Squirrels
P(alarm | evil)P(evil)
P(evil | alarm) =
P(alarm)
P(alarm | evil)P(evil)
=
P(alarm | evil)P(evil) + P(alarm | nice)P(nice)
(0.99)(0.0001)
=
(0.99)(0.0001) + (0.01)(0.9999)
≈ 0.01
Squirrels continued
Summary:
Probability a random test is correct = 0.99
answer: (a) This is the same solution as in the slides above, but in a more
compact notation. Let E be the event that a squirrel is evil. Let A be the
event that the alarm goes off. By Bayes’ Theorem, we have:
P(A | E )P(E )
P(E | A) =
P(A | E )P(E ) + P(A | E c )P(E c )
100
.99 1000000
= 100 999900
.99 1000000 + .01 1000000
≈ .01.
(b) No. The alarm would be more trouble than its worth, since for every
true positive there are about 99 false positives.
Washington Post, hot off the press
http://www.washingtonpost.com/national/health-science/
annual-physical-exam-is-probably-unnecessary-if-youre-general
2013/02/08/2c1e326a-5f2b-11e2-a389-ee565c81c565_story.html
Table Question: Dice Game
1 The Randomizer holds the 6-sided die in one fist and
the 8-sided die in the other.
2 The Roller selects one of the Randomizer’s fists and
covertly takes the die.
3 The Roller rolls the die in secret and reports the result
to the table.
P(roll 4|6-sided)P(6-sided)
P(6-sided|roll 4) =
P(4)
(1/6)(1/2)
= = 4/7.
(1/6)(1/2) + (1/8)(1/2)