8 Conditional Probability
8 Conditional Probability
Probability
Conditional Probability
Lecture 8
Tauseef Iftikhar
1/38
Today’s Agenda
Conditional Probability
Multiplication Theorem of Probability
Law of Total Probability
Bayes’ Theorem
Independence
2/38
Conditional Probability
Infection Total(rows)
Present Absent
Test Positive(+) 30 10 40
Negative(−) 15 45 60
Total(column) 45 55 100
I There is infection and the test diagnoses it, i.e. the test is
correctly diagnosing the infection.
I There is no infection and the test does not diagnose it, i.e.
the test is correctly diagnosing that there is no infection.
I There is an infection and the test does not diagnose it, i.e.
the test is incorrect in stating that there is no infection.
I There is no infection but the test diagnoses it, i.e. the test is
incorrect in stating that there is an infection.
3/38
Conditional Probability
I Relative frequencies as probabilities – assumption n is larger
than 100
Infection Total(rows)
Present Absent
Test Positive(+) 0.30 0.10 0.40
Negative(−) 0.15 0.45 0.60
Total(column) 0.45 0.55 1.0
5/38
Conditional Probability
I Laplace probability – assumption that all simple events in
Ω = {ω1 , ω2 , . . . , ωk } are equally probable,
i.e.P(ωj ) = k1 , j = 1, 2, , . . . , k.
I Let A and B be two events containing nA and nB numbers of
simple events.
I Let further A ∩ B contain nAB numbers of simple events.
I Laplace Probability
nA nB nAB
P(A) = , P(B) = and P(A ∩ B) = .
k k k
6/38
Conditional Probability
I Laplace probability – assumption that all simple events in
Ω = {ω1 , ω2 , . . . , ωk } are equally probable,
i.e.P(ωj ) = k1 , j = 1, 2, , . . . , k.
I Let A and B be two events containing nA and nB numbers of
simple events.
I Let further A ∩ B contain nAB numbers of simple events.
I Laplace Probability
nA nB nAB
P(A) = , P(B) = and P(A ∩ B) = .
k k k
I Assume we have prior knowledge that A has occurred. Then
conditional probability of event B i.e., P(B|A) =?
P(A ∩ B)
P(B|A) = (1)
P(A)
8/38
Conditional Probability
9/38
Conditional Probability
11/38
Conditional Probability
12/38
Conditional Probability
I P(M = 1|B) = 1 2 3 4 5 6
Figure: Finite sample space.
13/38
Conditional Probability
I P(M = 1|B) = 0 1 2 3 4 5 6
Figure: Finite sample space.
14/38
Conditional Probability
I Let M = max(X , Y ) 2
1
I P(M = 1|B) = 0
1 2 3 4 5 6
I P(M = 3|B) =
Figure: Finite sample space.
15/38
Conditional Probability
I Let M = max(X , Y ) 2
I P(M = 1|B) = 0 1
P(M=3 ∩ B)
1 2 3 4 5 6
I P(M = 3|B) = P(B)
Figure: Finite sample space.
16/38
Conditional Probability
I Let M = max(X , Y ) 2
I P(M = 1|B) = 0 1
1/36
1 2 3 4 5 6
I P(M = 3|B) = 1
7/36 = 7
Figure: Finite sample space.
17/38
Conditional Probabilities
I Event B: Something
registers on radar screen
I P(A ∩ B) =
18/38
Conditional Probabilities
I Event B: Something
registers on radar screen
I P(A ∩ B) = P(A)P(B|A)
19/38
Conditional Probabilities
I Event B: Something
registers on radar screen
I P(A ∩ B) =
P(A)P(B|A) = 0.0495
20/38
Conditional Probabilities
I Event B: Something
registers on radar screen
I P(A ∩ B) =
P(A)P(B|A) = 0.0495
I P(B) = P(A)P(B|A) +
P(A0 )P(B|A0 )
21/38
Conditional Probabilities
22/38
Conditional Probabilities
23/38
Conditional Probabilities
24/38
Multiplication Theorem of Probability
Theorem 1 (Multiplication Theorem of Probability)
For two arbitrary events A and B, the following holds:
More generally
26/38
Multiplication Theorem of Probability
∩ B) A∩B ∩C
P (C |A
|A) A∩B
P (B
P (C 0
|A ∩
B) A ∩ B ∩ C0
A
0
P (B 0 P (C |A
∩B ) A ∩ B0 ∩ C
|A)
P(A) A∩ B0
P (C 0
|A ∩
B 0) A ∩ B0 ∩ C 0
P (C |A
0 ∩ B) A0 ∩ B ∩ C
P(A0 ) 0) A0 ∩B
|A
P (B
P (C 0 0
|A ∩
B) A0 ∩ B ∩ C 0
A0
0
P (B 0 0 ∩B ) A0 ∩ B 0 ∩ C
P (C |A
|A 0)
A0 ∩ B0
P (C 0 0
|A ∩
B 0) A0 ∩ B 0 ∩ C 0
27/38
Law of Total Probability
Theorem 2 (Law of Total Probability)
Assume that A1 , A2 , . . . , Am are events such that m
S
i=1 Ai = Ω and
Ai ∪ Aj = ∅, ∀i 6= j, P(Ai ) > 0, S ∀i, i.e., A1 , A2 , . . . , Am form a
complete decomposition of Ω = m i=1 Ai in pairwise disjoint events,
then the probability of an event B can be calculated as
m
X
P(B) = P(B|Ai )P(Ai ). (4)
i=1
29/38
Law of Total Probability
Theorem 3 (Law of Total Probability)
Assume that A1 , A2 , . . . , Am are events such that m
S
i=1 Ai = Ω and
Ai ∪ Aj = ∅, ∀i 6= j, P(Ai ) > 0, S ∀i, i.e., A1 , A2 , . . . , Am form a
complete decomposition of Ω = m i=1 Ai in pairwise disjoint events,
then the probability of an event B can be calculated as
m
X
P(B) = P(B|Ai )P(Ai ). (5)
i=1
30/38
Bayes’ Theorem
Bayes Theorem gives a connection between P(A|B) and P(B|A).
For events A and B with P(A) > 0 and P(B) > 0, using (1) and
(3), we get
P(B|Aj )P(Aj )
P(Aj |B) = P (7)
i P(B|Ai )P(Ai )
33/38
Bayes’ Theorem
3. If we have a properly working DVD what is the probability
that it is from store 1.
P(A1 ∩ B)
P(A1 |B) =
P(B)
P(B̄|A1 )P(A1 )
P(A1 |B̄) =
P(B̄|A1 )P(A1 )P(B̄|A2 )P(A2 )
34/38
Bayes’ Theorem
35/38
Independence
Two events A and B are independent if the probability of
occurrence of B has no effect on the probability of occurrence of A
P(A|B) = P(A) and P(A|B̄) = P(A).
from (1) we know that
P(A ∩ B)
P(A|B) =
P(B)
and
P(A ∩ B̄)
P(A|B̄) =
P(B̄)
This yields:
P(A ∩ B)P(B̄) = P(A ∩ B̄)P(B)
P(A ∩ B)(1 − P(B)) = P(A ∩ B̄)P(B)
P(A ∩ B) = P(A ∩ B̄)P(B) + P(A ∩ B)P(B)
P(A ∩ B) = (P(A ∩ B̄) + P(A ∩ B))P(B)
P(A ∩ B) = P(A)P(B) 36/38
Independence
Definition 1
Two random events A and B are called (stochastically)
independent if
P(A ∩ B) = P(A)P(B)
i.e. if the probability of simultaneous occurrence of both events A
and B is the product of the individual probabilities of occurrence of
A and B.
Definition 2
The n events A1 , A2 , . . . , An are stochastically mutually
independent, if for any subset of m events Ai1 , Ai2 , ..., Aim (m ≤ n)
holds.
If condition (8) is fulfilled only for two arbitrary events, i.e. m = 2,
then the events are called pairwise independent. 37/38
Independence
Example 2
Consider an urn with four balls. The following combinations of
zeroes and ones are printed on the balls: 110, 101, 011, 000. One
ball is drawn from the urn. Define the following events: