CHAPTER 2
CONDITIONAL PROBABILITY
CONDITIONAL PROBABILITY
• The probability of event A, given that event B
occurred is called the conditional probability
of A given B and denoted by P(A|B)
P (A B
P (A | B ) , P (B ) 0
P (B )
• Note that the occurrence of event B precedes
the occurrence of event A.
2
CONDITIONAL PROBABILITY
• The conditional probability of B, given A is
P (A B
P (B | A ) , P (A ) 0
P (A )
• It follows that
P (A B ) P (A )P (B | A ) P (B )P (A | B )
• This is called the multiplication rule of two
events A and B in probability
3
CONDITIONAL PROBABILITY
• Multiplication Rule for 3 events A, B, and C is
P (A B C ) P (A )P (B | A )P (C | A B )
• In general, for A1 , A2 , … An we have
n n 1
P Ai P (A1 )P (A 2 | A1 )P (A3 | A1 A 2 )...P A n | A i
i 1 i 1
4
CONDITIONAL PROBABILITY
Example : (1) Let A, B be defined on S such that:
P (A ) 0.38, P (B ) 0.45, P (A B ) 0.65
Find P(A|B), P(B|A).
Solution:
P(A∩ B) = 0.38 + 0.45 – 0.65 = 0.18
P(A | B) = 0.18 / 0.45 = 0.40
P(B | A) = 0.18 / 0.38 = 0.47
5
CONDITIONAL PROBABILITY
Example (2):
Two cards are drawn at random, in succession
from an ordinary deck of 52 playing cards.
Find the probability that both cards will be
Hearts, if the drawing was:
(1) with replacement
(2) without replacement
6
CONDITIONAL PROBABILITY
Solution:
Let Hi = event i th card is Heart, i = 1, 2.
Required Probability = P(H1 ∩H2)
= P(H1 ) P(H2 | H1 )
(1) Req. Prob. = (13/52) x (13/52) = 0.063
(2) Req. Prob. = (13/52) x (12/51) = 0.059
7
CONDITIONAL PROBABILITY
Example (3):
Two cards are drawn at random, in succession
from an ordinary deck of 52 playing cards.
Find the probability that both cards will be
Kings, if the drawing was:
(1) with replacement
(2) without replacement
8
CONDITIONAL PROBABILITY
Solution:
Let Ki = event i th card is King, i = 1, 2.
Required Probability = P(K1 ∩K2)
= P(K1 ) P(K2 | K1 )
(1) Req. Prob. = (4/52) x (4/52) = 0.006
(2) Req. Prob. = (4/52) x (3/51) = 0.005
9
CONDITIONAL PROBABILITY
Example (4)
Three cards are drawn at random in succession
from an ordinary deck of 52 playing cards.
Find the probability that all cards will be Kings,
if the drawing was:
(1) with replacement
(2) without replacement
10
CONDITIONAL PROBABILITY
Solution:
Let Ki = event i th card is King, i = 1, 2, 3.
Req. Prob. = P(K1 ∩ K2 ∩ K3 )
= P(K1 ) P(K2 | K1 ) P(K3 | K1 ∩ K2)
(1) Req. Prob. = (4/52)3 = 0.0005
(2) Req. Prob. = (4/52) x (3/51) x (2/50)
= 0.0002
11
CONDITIONAL PROBABILITY
Example (5)
Three cards are drawn at random in succession
from an ordinary deck of 52 playing cards.
Find the probability that all cards will be
Hearts, if the drawing was:
(1) with replacement
(2) without replacement
12
CONDITIONAL PROBABILITY
Solution:
Let Hi = event i th card is Heart, i = 1, 2, 3.
Req. Prob. = P(H1 ∩ H2 ∩ H3 )
= P(H1 ) P(H2 | H1 ) P(H3 | H1 ∩ H2)
(1) Req. Prob. = (13/52)3 = 0.016
(2) Req. Prob. = (13/52) x (12/51) x (11/50)
= 0.013
13
CONDITIONAL PROBABILITY
Independence of events
Events A and B are said to be statistically
independent if
P(A|B) = P(A)
Or, equivalently
P(B|A) = P(B)
Consequently, for independent events:
P(A∩B) = P(A) P(B)
Statistics Department - Faculty of Science - King Abdulaziz University 14
CONDITIONAL PROBABILITY
Example (6)
A large city has two fire-engines operating
independently. The probability that a specific
engine is available when needed is 0.85. Find:
(1) P(an engine is available when needed)
(2) P(neither engine is available when needed)
Solution: For I = 1, 2 define the event
Ei = “ ith engine is available when needed”.
Statistics Department - Faculty of Science - King Abdulaziz University 15
CONDITIONAL PROBABILITY
P(E1 ) = P(E2 ) = 0.85,
P(E1 ∩ E2 ) = P( E1 )P(E2 ) = 0.85 x 0.85 = 0.7225
(1) Req. Prob. = P(E1 U E2 )
= P(E1 ) + P(E2 ) – P(E1 ∩ E2 )
= 0.85 + 0.85 – 0.7225 = 0.9775
(2) Req. Prob. = P[(E1 U E2 )c ] = 1 – P(E1 U E2 )
= 1 – 0.9775 = 0.0225
Statistics Department - Faculty of Science - King Abdulaziz University 16
CONDITIONAL PROBABILITY
• A, B, and C are said to be independent if:
(1) P(A∩B) = P(A) P(B)
(2) P(A∩C) = P(A) P(C)
(3) P(B∩C) = P(B) P(C)
(4) P(A∩B∩C) = P(A) P(B) P(C).
• A, B, C are said to be pairwise independent If
conditions (1) – (3) are satisfied.
Statistics Department - Faculty of Science - King Abdulaziz University 17
CONDITIONAL PROBABILITY
Example (7)
A large city has 3 fire-engines operating
independently. The probability that a specific
engine is available when needed is 0.85. Find:
(1) P(an engine is available when needed)
(2) P(neither engine is available when needed)
Solution: For I = 1, 2, 3 define the event
Ei = “ ith engine is available when needed”.
Statistics Department - Faculty of Science - King Abdulaziz University 18
CONDITIONAL PROBABILITY
P(E1 ) = P(E2 ) = P(E3 ) = 0.85,
P(E1 ∩ E2 ) = P( E1 )P(E2 ) = 0.85 x 0.85 = 0.7225
P(E1 ∩ E3 ) = P( E1 )P(E3 ) = 0.85 x 0.85 = 0.7225
P(E2 ∩ E3 ) = P( E2 )P(E3 ) = 0.85 x 0.85 = 0.7225
P(E1 ∩ E2 ∩ E3) = P( E1 )P(E2 ) P(E3 )
= 0.85 x 0.85 x 0.85
= 0.6141
Statistics Department - Faculty of Science - King Abdulaziz University 19
CONDITIONAL PROBABILITY
(1) Req. Prob. = P(E1 U E2 U E3 )
= 3 x (0.85) – 3 x (0.7225) + 0.6141
= 0.9966
(2) Req. Prob. = P[(E1 U E2 U E3 )c ]
= 1 – P(E1 U E2 U E3)
= 1 – 0.9966 = 0.0034
Statistics Department - Faculty of Science - King Abdulaziz University 20
CONDITIONAL PROBABILITY
Partition of the Sample Space
The collection A1 , A2 , …, An is said to constitute
a partition of S if:
(1) They are mutually exclusive, i. e.
Ai A j , i j
(2) Their union equals S, i. e.
A1 A 2 ... A n S
Statistics Department - Faculty of Science - King Abdulaziz University 21
CONDITIONAL PROBABILITY
The Law of Total Probability
Let A1 , A2 , …, An be a partition of S. Let D be an
event defined on S. Then
n
P (D ) P (A
i 1
i ) P (D | A i )
Statistics Department - Faculty of Science - King Abdulaziz University 22
CONDITIONAL PROBABILITY
Bayes’ Rule
Let A1 , A2 , …, An be a partition of S. Let D be an
event, defined on S. Then
P (D | A k )P (A k )
P (A k | D ) n
, k 1, 2,..., n
P (A
i 1
i )P (D | A )
Statistics Department - Faculty of Science - King Abdulaziz University 23
CONDITIONAL PROBABILITY
Example (8) The distribution of colored balls in
two boxes is as follows:
Box Red White Black
I 4 6 5
II 7 8 4
A ball is selected at random from Box I and put
unseen into Box II. Then, a ball is selected at
random from Box II.
Statistics Department - Faculty of Science - King Abdulaziz University 24
CONDITIONAL PROBABILITY
It is required to find:
1. P(both selected balls have the same color)
Solution:
Req. Prob. = P(W1∩W2) + P(R1∩R2) + P(B1∩B2)
= P(W1) P(W2|W1) + P(R1) P(R2|R1) +
P(B1) P(B2|B1)
= 6/15 x 9/20 + 4/15 x 8/20 + 5/15 x 5/20
= 0.37
Statistics Department - Faculty of Science - King Abdulaziz University 25
CONDITIONAL PROBABILITY
2. P(both selected balls have different colors)
= 1 – P(both have the same color) = 0.63.
3. P(the second ball is white) = P(W2)
= P(W2 | W1)P(W1) + P(W2 | R1)P(R1) +
P(W2 | B1)P(B1)
= 9/20 x 6/15 + 8/20 x 4/15 + 8/20 x 5/15
= 126/300 = 0.42
Statistics Department - Faculty of Science - King Abdulaziz University 26
CONDITIONAL PROBABILITY
3. P(first ball is White, given the second was
White)
P (W 2 |W 1 )P (W 1 ) (9 / 20)(6 / 15)
P (W 1 |W 2 ) 0.429
P (W 2 ) 0.42
4. P(the second ball is red) = P(R2)
= P(R2 |W1)P(W1) + P(R2 |R1)P(R1)
+ P(R2 |B1)P(B1) = …
Statistics Department - Faculty of Science - King Abdulaziz University 27
CONDITIONAL PROBABILITY
5. P(the second ball is black) = P(B2)
= P(B2 | W1)P(W1) + P(B2 | R1)P(R1)
+ P(B2 | B1)P(B1) = …
6. P(first ball is red, given the second was red)
P (R 2 | R1 )P (R 1 )
P (R1 | R 2 ) ...
P (R 2 )
Statistics Department - Faculty of Science - King Abdulaziz University 28
CONDITIONAL PROBABILITY
8. P(first ball is black, given the second was
black)
P (B 2 | B 1 )P (B 1 )
P (B 1 | B 2 ) ...
P (B 2 )
Statistics Department - Faculty of Science - King Abdulaziz University 29
CONDITIONAL PROBABILITY
Example (9) Three machines produce respectively 0.35,
0.37, and 0.28 of the total production of a given item
at a certain factory. The probabilities of producing a
defective item on these machines are 0.07, 0.05, and
0.08 respectively.
(i) An item is selected at random. Find the probability
that the selected item is defective.
Solution
Req. = 0.35 x 0.07 + 0.37 x 0.05 + 0.28 x 0.08 = 0.0654
Statistics Department - Faculty of Science - King Abdulaziz University 30
CONDITIONAL PROBABILITY
(ii) An item is selected at random and found
defective. Find the probability that the
selected defective item is produced by the
second machine.
Solution
0.37x 0.05
Re q . 0.0198
0.35x 0.07 0.37x 0.05 0.28x 0.08
Statistics Department - Faculty of Science - King Abdulaziz University 31
CONDITIONAL PROBABILITY
(iii) An item is selected at random and found
non-defective. Find the probability that the
selected non-defective item is produced by
the second machine.
Solution
0.37x (1 0.05)
Re q . 0.3761
1 [0.35x 0.07 0.37x 0.05 0.28x 0.08]
Statistics Department - Faculty of Science - King Abdulaziz University 32
CONDITIONAL PROBABILITY
Example (10) The following circuit operates only if there
is a path of functional devices from left to right. The
probability that each device functions is shown on the
graph.
0.8 0.9
Assume that devices fail independently. What is the
probability that the circuit operates?
• Required = 0.8 x 0.9 = 0.72
Statistics Department - Faculty of Science - King Abdulaziz University 33
CONDITIONAL PROBABILITY
Example (11) consider the following system
0.8 0.9 0.7
0.8 0.9 0.7
Assume that devices fail independently. What
is the probability that the circuit operates?
• Required = 0.754
Statistics Department - Faculty of Science - King Abdulaziz University 34