4 Conditional Probability and Independence-Std
4 Conditional Probability and Independence-Std
4 Conditional Probability and Independence-Std
1
SB for Stst 2171-2021 4/8/2021
𝑃(𝐴∩𝐵)
𝑃 𝐴 𝐵 = , 𝑤ℎ𝑒𝑟𝑒 𝑃 𝐵 > 0
𝑃(𝐵)
𝑃(𝐴∩𝐵)
𝑃 𝐵 𝐴 = , 𝑤ℎ𝑒𝑟𝑒 𝑃 𝐴 > 0
𝑃(𝐴)
Conditional …
Example 1
A box contains 80 candles, 30 of which are defective. Suppose we take two candles from this box in
sequence with and without replacement. Defining the two events as follows, find the probabilities
for the events under the two situations.
a) with replacement
30 3
P(A)= =
80 8
30 3
P(B)= =
80 8
b) without replacement
30 3
P(A)= = P(B)=? This depends whether A did or did not occur.
80 8
30
If A did not occur, P(B)=
79
If A did occur, on the 2nd draw there are only 79 candles left of which 29 are defective.
29
Here P(B)= P(B/A)=
79
2
SB for Stst 2171-2021 4/8/2021
Conditional probability …
Example 2
A box contains black balls and white balls. A person selects two balls
without replacement. If the probability of selecting a black ball
and a white ball is 15
56 , and the probability of selecting a black ball
on the first draw is 83, find the probability of selecting a white ball
on the second draw, given that the first ball selected was a black
ball.
Soln
Let B= selecting a black ball W= selecting a white ball
Given: P(B and W) =
15 P(B) = 3
56 8 P(A and B)
Then by the conditional probability relationship P(B|A ) P(A )
P(B and W) 15 56 15 3 15 8 5
P( W|B)
P(B) 3 56 8 56 3 7
8
Five over seven is the probability of selecting a white ball on
the second draw given that the first ball selected was black. 5
Conditional probability …
Exercise 1
A random car is chosen among all those passing through the
gate of CNS on a certain day. The probability that the car is
yellow is 3/100: the probability that the driver is female is 1/5;
and the probability that the car is yellow and the driver is
female is 1/50. Find the probability that the driver is female
given that the car is yellow.
Soln
If A is the event ‘the car is yellow’ and B the event ‘the driver is female’,
then we are given that P(A) = 0.03, P(B) = 0.2, and P(A and B) = 0.02.
3
SB for Stst 2171-2021 4/8/2021
Conditional probability …
Exercise 2
Suppose that an office has 100 calculating machines. Some of these machines are
electric (E) while others are manual (M). And some of the machines are new (N)
while others are used ( U). The following table gives the number of machines in
each category. A person enters the office, picks a machine at random and discovers
that it is new. What is the probability that it is electric?
E M
N 40 30 70
U 20 10 30
60 40 100
Soln
𝑃(𝐸 ∩ 𝑁) 40
𝑃 𝐸 𝑁 = = 100 = 4
𝑃(𝑁) 70 7
100
That is,
𝑃 𝐴∩𝐵 =𝑃 𝐴 𝑃 𝐵 𝐴 .
Similarly,
𝑃 𝐴 ∩ 𝐵 = 𝑃 𝐵 𝑃 𝐴/𝐵
4
SB for Stst 2171-2021 4/8/2021
Multiplication …
Multiplication Rule 1
• When two events are independent, the probability of both
occurring is
P(A and B)= P(A)∙P(B)
Multiplication Rule 2
• When two events are dependent, the probability of both
occurring is
P(A and B)= P(A)∙P(B|A)
Examples of dependent events:
• Drawing a card from a deck, not replacing it, and then drawing a second card.
• Scoring excellent grades and winning a scholarship award.
• Cheating on exams and obtaining nil. 9
Multiplication…
𝐴𝑖 ≠ 0
𝑖=1
then,
𝑃 𝐴𝑖 = 𝑃 𝐴1 𝑃 𝐴2 𝐴1 𝑃 𝐴3 𝐴1 , 𝐴2 … 𝑃(𝐴𝑛 𝐴1 , 𝐴2 … , , 𝐴𝑛−1 )
𝐼=1
10
5
SB for Stst 2171-2021 4/8/2021
Multiplication ….
Example 1
Suppose a card is drawn from a deck and not replaced, and
then a second card is drawn. What is the probability of selecting
an ace on the first card and a king on the second card?
Soln:
Let
A= Selecting an ace
B= Selecting a king
Are the two evets dependent or independent?
The event of getting a king on the second draw given that an ace was drawn the first time is called
a conditional probability.
𝑃 𝐴∩𝐵 =𝑃 𝐴 ×𝑃 𝐴 𝐵
52 51 16 2652 4 663
4 4
11
Multiplication …
Example
Three cards are drawn from an ordinary deck and not replaced. Find the
probability of the following events:
a) Getting 3 jacks
b) Getting an ace, a king and a queen in order
c) Getting a diamond, a spade and a heart in order
d) Getting 3 hearts
Soln : (dependent or independent?)
a) P (3 jacks) 4 3 2 24
1
52 51 50 132,600 5525
4 4 4 64 8
b) P(ace and king and queen )
52 51 50 132,600 16,575
13 13 13 2197 169
c) P(diamond and spead and heart)
52 51 50 132,600 10,200
13 12 11 1,716 11
d) P( 3 hearts)
52 51 50 132,600 850 12
6
SB for Stst 2171-2021 4/8/2021
Multiplication …
Bayes’ Theorem
Given two dependent events A and B, the formulas for conditional probability allow
us to find P(A and B), or P(B/A). Related to these formulas is a rule developed by
Thomas Bayes (1702–1761). The rule is known as Bayes’ Theorem.
Let A and B be two events with their corresponding probabilities P(A) and P(B), then
𝑃(𝐴)
𝑃 𝐴 𝐵 = 𝑃(𝐵 𝐴)
𝑃(𝐵)
Bayes’Rule is based on the notion of a partition of a sample space. Events are said to
partition a sample space S if two conditions exist:
1) 𝑩𝒊 ∩ 𝑩𝒋 = ∅ for any pair i and j
2) 𝑩𝟏 ∪ 𝑩𝟐 ∪ 𝑩𝟑 ∪ ⋯ ∪ 𝑩𝒌 = 𝑺
Thus the events 𝑩𝟏 , 𝑩𝟐 , 𝑩𝟑 , … , 𝑩𝒌 are mutually exclusive and exhaustive.
Multiplication …
Let A be some event associated with S and 𝑩𝟏 , 𝑩𝟐 , … , 𝑩𝒌 be
partitions of S. Hence we can write
𝐴 = 𝐴 ∩ 𝐵1 ∪ 𝐴 ∩ 𝐵2 ∪ … ∪ (𝐴 ∩ 𝐵𝑘 )
• Some of 𝐴 ∩ 𝐵𝑖 may be empty. Note that since B's are partitions and
have no intersections, all sets 𝐴 ∩ 𝐵1 , 𝐴 ∩ 𝐵2 , … , (𝐴 ∩ 𝐵𝑘 ) are
pair-wise mutually exclusive. Hence we may apply the addition
property for mutually exclusive events and write
P(A) =𝑃 𝐴 ∩ 𝐵1 + 𝑃 𝐴 ∩ 𝐵2 + ⋯ 𝑃(𝐴 ∩ 𝐵𝑘 ).
7
SB for Stst 2171-2021 4/8/2021
Multiplication …
Total Probability Theorem
If we have 𝑩𝟏 , 𝑩𝟐 , … , 𝑩𝒌 as partitions of S for any event A
associated with S,
𝑃 𝐴 = 𝑃 𝐴 𝐵1 𝑃 𝐵1 + 𝑃 𝐴 𝐵2 𝑃 𝐵2 + … + 𝑃 𝐴 𝐵𝑘 𝑃 𝐵𝑘
= 𝑃 𝐴 𝐵𝑖 𝑃(𝐵𝑖 )
𝑖=1
15
Multiplication …
Example 1
Suppose a statistics class contains 60% girls and 40% boys. Suppose that 30% of the
girls and 20% of the boys scored A in the final exam. A student is chosen at random
from the class. What is the probability that the chosen student will have an A grade?
so there is a 26% chance that the randomly chosen student has scored an A grade.
16
8
SB for Stst 2171-2021 4/8/2021
Multiplication …
Exercise 1
A company buys chairs from two suppliers, 1 and 2. Supplier 1 has a
record of delivering chairs containing 10% defectives, whereas supplier 2
has a defective rate of only 5%. Suppose 40% of the current supply came
from supplier 1. If a chair is selected randomly from this supply, what is
the probability of the chair to be defective?
Soln
Let,
A be the set of all defective chairs.
B1 be the set of chairs from supplier 1
B2 be the set of chairs from supplier 2.
17
Multiplication …
Thinking about the previous exercise (Exercise 1), we may
want to get another important result. Suppose one chair is
chosen and is found to be defective. What is the probability
that it is from Supplier 1? The Bayes’ Theorem which has
been discussed previously can be used to answer this
question.
Bayes’ Theorem
𝑃 𝐴 𝐵𝑖 𝑃(𝐵𝑖 )
𝑃 𝐵𝑖 𝐴 = 𝑘
𝐽=1 𝑃 𝐴 𝐵𝑗 𝑃(𝐵𝑗 ) 18
9
SB for Stst 2171-2021 4/8/2021
Multiplication …
Example 2
Take the two suppliers information in Exercise 1. If a chair is
selected randomly from this supply and observed to be defective,
find the probability that it came from supplier 1.
Let Bi denote the event that a chair comes from supplier i (i = 1,2), and
note that B1 and B2 form a partition of the sample space for the
experiment of selecting one chair. Let A denote the event that the selected
chair is defective. Then
𝑃 𝐵1 𝑃(𝐴 𝐵1 )
𝑃 𝐵1 𝐴 =
𝑃 𝐵1 𝑃 𝐴 𝐵1 + 𝑃 𝐵2 𝑃(𝐴 𝐵2 )
0.40×0.10
=
0.40×0.10 +(0.60×0.05)
= 0.5714
Supplier 1 has a greater probability of being the party supplying the defective chair
than does supplier 2.
19
Multiplication …
Exercise 2
Consider the statistic class students’ information in Example 1.
It was observed that a randomly selected student has an A
grade. What is the probability that the chosen student is a girl?
Soln
We found out that a randomly selected student has scored A.
Our interest is to quantify the chance of occurrence that the
selected student is a girl.
20
10
SB for Stst 2171-2021 4/8/2021
… independence
Example 2: If a coin is tossed twice, what is the probability of getting
two heads? (dependent or independent?)
2 2 4
1 1 1
P(HH)=
1
Using the sample space HH,HT,TH,TT. Then P(HH)= 4
Solution
4
The probability of getting a queen is 52 ,
since the card is replaced, the probability of getting an ace is 4
52
Hence, the probability of getting a queen and an ace is
4 4 16 1
P(queen and ace) P(queen ) P(ace) 52
52 2704
169
22
11