Post on 21-Dec-2015
Conditional Probability
• if we have some information about the result…use it to adjust the probability
• likelihood an event E occurs under the condition that some event F occurs
• notation: P(E | F ) "the probability of E, given F ".
• called a “conditional probability”
Given They’re Male
• If an individual is selected at random, what is the probability a sedan owner is selected, given that the owner is male?
• P( sedan owner | male ) = _______?
Smaller Sample Space
• Given the owner is male reduces the total possible outcomes to 115.
( | )
( )
n sedan maleP sedan male
n male
In general...• In terms of the probabilities, we define
( )( | )
( )
P A BP A B
P B
sedan mini-van truck totals
male .16 .10 .20 .46
female .24 .22 .08 .54 .40 .32 .28 1.00
• P( sedan owner | male ) = _______?
Compute the probability sedan mini-van truck totals
male .16 .10 .20 .46
female .24 .22 .08 .54 .40 .32 .28 1.00
( )( | ) ?
( )
P van femaleP va female
fn
P emale
( )( | ) ?
( )
P female vanP fema van
vle
P an
Dependent Events?
• probability of owning a truck…
• ...was affected by the knowledge the owner is male
• events "owns a truck" and "owner is male" are called dependent events.
Independent Events
• Two events E and F , are called independent if
or simply
the probability of E is unaffected by event F
Roll the Dice• Using the elements of the sample space:
(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)
• Compute the conditional probability: P( sum = 6 | a “4 was rolled” ) = ?
• are the events “sum = 6" and “a 4 was rolled" independent events?
“Affected”
• The events are NOT independent • the given condition does have an effect.
• That is, P(sum = 6 | 4 is rolled ) = 2/11 = 0.1818but P(sum = 6) = 5/36 = 0.1389
• These are dependent events.
Not Independent
• These are dependent events.
• As a result, P(sum = 6 and a 4 was rolled) does not equal P(sum = 6)P(a 4 was rolled) ?
20.0555
36
5 110.0424
36 36
Probability of “A and B”
• Draw two cards in succession, without replacing the first card.
• P(drawing two spades) = ________?
( ) ( | ) ( )P A B P A B P B
( )( | )
( )
P A BP A B
P B
may be written equivalently as
Multiplication Rule
P(1st ca
rd is sp
ade)
P(2nd is spade | 1st is spade)
(spade, spade)
(1 is spade 2 is spade)
(2 spade |1 spade) (1 spade)
st nd
nd st st
P
P P
Compare with “combinations approach”, ( 13C2 )( 52C2 ).
Multiplicative Law for Probability
• For two events A and B,
• But when A and B are independent events, this identity simplifies to
( ) ( | ) ( )
( | ) ( )
P A B P A B P B
P B A P A
( ) ( ) ( )P A B P A P B
Example
• In a factory, 40% of items produced come from Line 1 and others from Line 2.
• Line 1 has a defect rate of 8%. Line 2 has a defect rate of 10%.
• For randomly selected item, find probability the item is not defective. D: the selected item is defective (i.e., ~D means not defective)
The Decision Tree
Line 1
Line 2
defective
defective
not defective
not defective
1 1 2 2(~ ) (~ | ) ( ) (~ | ) ( )P D P D L P L P D L P L
(~ ) (0.92)(0.40) (0.90)(0.60) 0.908P D
The Two Lines
• ~D: the selected item is not defective.
S
L1 L2
~D
1 2(~ ) (~ ) (~ )P D P D L P D L
1 1 2 2(~ | ) ( ) (~ | ) ( )P D L P L P D L P L
Total Probability
1 2
1 2
1 2
For the partition { , , , } of the sample space ,
we may write ( ) ( ) ( )
and so
( ) ( ) ( ) ( ).
k
k
k
B B B S
A A B A B A B
P A P A B P A B P A B
S
B1 B2 Bk…
A
1 1 2 2
or equivalently,
( ) ( | ) ( ) ( | ) ( ) ( | ) ( ).k kP A P A B P B P A B P B P A B P B
Total Probability
B1
B2
B3
A
A
A
A
A
A
P(A|B1)P(B1)
P(A|B2)P(B2)
P(A|B3)P(B3)
1 1 2 2 3 3
( )
( | ) ( ) ( | ) ( ) ( | ) ( ).
P A
P A B P B P A B P B P A B P B
Bayes’ Theorem follows…
( ) ( | ) ( )( | )
( ) ( )j j j
j
P A B P A B P BP B A
P A P A
1 1Since ( ) ( | ) ( ) ( | ) ( ),
we also havek kP A P A B P B P A B P B
1 1
( | ) ( )
( | ) ( ) ( | ) ( )j j
k k
P A B P B
P A B P B P A B P B
Bayes’
B1
B2
B3
A
A
A
A
A
A
P(A|B1)P(B1)
P(A|B2)P(B2)
P(A|B3)P(B3)
2 22
1 1 2 2 3 3
( | ) ( )( | )
( | ) ( ) ( | ) ( ) ( | ) ( )
P A B P BP B A
P A B P B P A B P B P A B P B
Back at the factory…• For randomly selected item, find probability
it came from Line 1, given the item is not defective. P( L1 | W ) =
Line 1
Line 2
defective
defective
not defective
not defective