3_Conditional Prob
3_Conditional Prob
3_Conditional Prob
∙ Conditional probability
∙ Chain rule
∙ Sequential calculation of probabilities
∙ Law of total probability
∙ Bayes rule
∙ Independence
∙ Summary
∙ We are often interested in the probability of event A given that event B occurred
∙ Examples:
Alice tests positive for a certain disease, what is the probability that she has this disease?
A is read out of a memory chip, what is the probability that a was stored?
/
Example
∙ Roll a -sided die twice. So, the sample space is {, , , }
Assume each sample point has probability /.
Let B be the event that the minimum of the two die rolls is , and
A be the event that the maximum of the two die rolls is
Find P(A | B)
B
P(A, B)
P(A | B) =
P(B)
P(B) =
nd roll
P(A, B) =
P(A | B) =
Compared to P(A) = A
st roll
/
P(⋅ | B) is a probability measure
nd roll
assigns probability / to each outcome
Conditioned on B, the conditional
probability measure first assigns probability
/ to (, ), (, ), (, ), (, ), (, ) and zero
to all other outcomes
st roll
/
Chain rule
∙ Probability measures are often specified via conditional probabilities
∙ Two methods to calculate probability of an event from conditional probabilities:
the sequential method and
a “divide and conquer” method using the law of total probability
/
Sequential calculation of probabilities
. Construct a tree description of the sample space for the sequential experiment
. Assign conditional probabilities to the corresponding edges
. By the chain rule, the probability of an outcome is the product of the
conditional probabilities along the path from the root to the outcome’s leaf node
s P(A , A ) = P(A ) P(A | A )
s
P(A |A )
✁✁❅ P(A | A )
c
s✁
✁
❆
❆
P(Ac ) s P(Ac , A ) = P(Ac ) P(A |Ac )
❆
❆❆s P(A |Ac )
❅
❅s P(Ac , Ac ) = P(Ac ) P(Ac |Ac )
P(Ac |Ac )
❅
/
Diagnosing a disease
s
P(B|A) = .
✁❅
P(A) = . ✁ .❅s P(A, Bc ) = . × . = . (Misdiagnosis)
s✁
✁
❆
P(Ac ) = .
❆ s P(Ac , B) = . × . = . (False diagnosis)
❆ .
❆s
❅
P(Bc |Ac ) = .
❅s P(Ac , Bc ) = P(Ac ) P(Bc |Ac )
/
Example
/
Example
t✟
P(A |A , A ) = /✟✟ P(A , A , A ) = P(A ) P(A | A ) P(A | A , A ) = × ×
t
✁✁❅
P(A ) = / ✁ /❅❅t
✁
t✁
✁
❆
❆
P(Ac ) = /❆
❆
❆❆t
/
Recap
P(A ∩ B)
∙ Conditional probability of A given B (with P(B) ̸= ) is: P(A | B) =
P(B)
P(⋅ | B) is a probability measure
∙ Chain rule: For two events, P(A ∩ B) = P(A | B) P(B)
n
In general: P ∩ni= Ai = P(Ai | A , A , . . . , Ai− ), A =
i=
/
Law of total probability
/
Binary communication link
.
P() = .
P( | ) = .
/
Binary communication link
.
P() = .
P( | ) = .
/
Bayes rule
∙ Let A , A , . . . , An be nonzero probability events (the causes) that partition Ω,
and let B be a nonzero probability event (the effect/observation)
∙ Given the a priori probabilities P(Ai ) and
the conditional probabilities P(B | Ai ), i = , . . . , n,
find the a posteriori probabilities P(Aj | B), j = , . . . , n
∙ From the definition of conditional probability,
P(B, Aj ) P(B | Aj )
P(Aj | B) = = P(Aj )
P(B) P(B)
By the law of total probability
Thomas Bayes (-)
n
P(B) = P(Ai ) P(B | Ai )
i=
/
Disease diagnosis
∙ Recall that A is the event a person has the disease and B is the event that he tests
positive, where P(A) = ., P(B | A) = ., P(B | Ac ) = .
What is the probability that the person has the disease given he tested positive?
∙ We want to find P(A|B), so we use Bayes rule
P(B | A)
P(A|B) = c c
P(A)
P(A) P(B | A) + P(A ) P(B | A )
.
= × . = .
. × . + . × .
Versus a priori probability of ., so the test increased the probability a lot
But the test is as good as flipping a fair coin, even though it is % accurate!
What test accuracy would we needed to achieve % correct diagnosis?
/
Disease diagnosis
∙ Recall that A is the event a person has the disease and B is the event that he tests
positive, where P(A) = ., P(B | A) = ., P(B | Ac ) = .
What is the probability that the person has the disease given he tested negative?
∙ We want to find P(A|Bc ), so we again use Bayes rule
c P(Bc | A)
P(A|B ) = P(A)
P(A) P(Bc | A) + P(Ac ) P(Bc | Ac )
.
= × . = .
. × . + . × .
Versus a priori probability of ., so the test decreased the probability a lot
/
Independence
In this case we say that the two events are statistically independent
∙ Examples:
Flip a fair coin and get a H, the probability of a H in the next flip is still /
You are told Alice is born on /, the probability Bob is born on / is still /
/
Independence for more than two events
/
Independence for more than two events
n
∙ Note that P(A , . . . , An ) = P(Ai ) alone is not sufficient for independence
i=
Are A, B, C independent?
∙ Clearly, A, B are independent, A, C are independent, and B, C are independent
But, P(A, B, C) = ̸= P(A) P(B) P(C) = ,
since if you know A and B, you know that C could not have occurred
/
Coupon collector problem
∙ A food company includes a baseball player card in each cereal box it sells.
Assume k players and each box contains a randomly and independently chosen
card of one of them (with replacement). A fan buys n cereal boxes,
what is the probability that she gets Babe Ruth’s card?
Let Ei be the event that she gets Ruth’s card in cereal box i ∈ {, , . . . , n}
We want to find P ∪ni= Ei
Since the card selection is random and with replacement, P(Ei ) =
k
This is not enough information to find the probability of the union
Let’s try to find the probability of the complementary event P ∩ni= Eic (De Morgan’s)
Since the Ei s are independent, so are the Eic s, hence
n n
n
P ∩ni= Eic = P(Eic ) = ( − P(Ei )) = −
i= i= k
n
Hence, P ∪ni= Ei = − P ∩ni= Eic = − −
k
For example if k = and we want P ∪ni= Ei = ., then n ≈
/
Summary
/