4.6 Conditional Probability
The probability of event B happening, given that event A already happened, is called the conditional probability . The conditional probability of B, given A is written as P(B | A), and is read as “the probability of B given A happened first.” We can use the General Multiplication Rule when two events are dependent.
Definition
General Multiplication Rule
P
(
A
∩
B
)
=
P
(
A
)
·
P
(
B
|
A
)
P
(
A
∩
B
)
=
P
(
A
)
·
P
(
B
|
A
)
Example 1
A bag contains 10 colored marbles: 7 red and 3 blue. A random experiment consists of drawing a marble from the bag, then drawing another marble without replacement (without putting the first marble back in the bag). Find the probability of drawing a red marble on the first draw (event R 1 ), and drawing another red marble on the second draw (event R 2 ).
Show solution
Drawing a red marble on the first draw and drawing a red marble on the second draw are dependent events because we do not place the marble back in the bag. The probability of drawing a red marble on the first draw is P(R 1 ) = 7 10 , but on the second draw, the probability of drawing a red marble given that a red marble was drawn on the first draw is P(R 2 |R 1 ) = 6 9 .
# Check the tree-diagram answer by simulating the two dependent draws
bag <- rep(c("R", "B"), c(7, 3)) # 7 red, 3 blue
set.seed(2)
both_red <- replicate(10000, {
draw <- sample(bag, 2) # sample() draws WITHOUT replacement
draw[1] == "R" && draw[2] == "R"
})
mean(both_red) # simulation estimate of P(R1 and R2)
(7/10) * (6/9) # general multiplication rule -> 0.4667
# Change the bag to rep(c("R","B"), c(5, 5)) and re-run both lines
Thus, by the general multiplication rule, P(R 1 and R 2 ) = P(R 1 )·P(R 2 |R 1 ) = ( 7 10 ) ( 6 9 ) = 0.4667.
Example 3
The following table shows the utility contract granted for a specific year. One contractor is randomly chosen.
Corporation
Government
Individual
Total
United States
0.45
0.007
0.08
0.537
Foreign
0.41
0.003
0.05
0.463
Total
0.86
0.01
0.13
1
Compute the probability the contractor is from the United States and is a corporation. Compute the probability the contractor is from the United States given that they are a corporation. If the contractor is from a foreign country, what is the probability that it is from a government? Are the events a “contractor is an individual” independent of a “contractor from the United States?”
Show solution
a) For the intersection in the contingency tables use where the row and column meet. P(U.S. ∩ Corp) = 0.45.
b) P (U.S.|Corp) = P ( U.S. ∩ Corp ) P ( Corp ) = 0.45 0.86 = 0.5233.
c) P (Gov|Foreign) = P ( Gov ∩ Foreign ) P ( Foreign ) = 0.003 0.463 = 0.0065.
d) Do not assume independence between two variables in a contingency table since the data may show relationships that you didn’t know were there.
Use the definition of independent events. If the two events are independent then we would have P(Individual ∩ U.S.) = P(Individual)·P(U.S.). First find the intersection using where the row and column meet to get P(Individual ∩ U.S.) = 0.08. Then use the row and column totals to find P(Individual)·P(U.S.) = 0.13·0.537 = 0.0698. Since P(Individual ∩ U.S.) ≠ P(Individual)·P(U.S.) these two events are dependent.
Example 4
A random sample of 500 people was taken from the 2010 United States Census. Their marital status and race were recorded in the following contingency table. A person is randomly chosen, find the following.
Race
Marital Status
American Indian
Black
Asian
White
Two Major Races
Total
Divorced
0
6
1
30
1
38
Married
1
25
23
156
4
209
Single
2
33
21
155
11
222
Widowed
0
7
2
22
0
31
Total
3
71
47
363
16
500
a) P(Single and Asian)
b) P(Single | Asian)
c) Given that a person is single what is the probability their race is Asian?
Show solution
a) The intersection for a contingency table is found by simply finding where the row or intersection meets. There are 21 single Asians, therefore the P(Single ∩ Asian) = P(Single and Asian) = 21/500 = 0.042. Do not multiply the row total times the column total since there is no indication that these are independent events.
b) In words we are trying to find the probability that the person is single given that we already know that their race is Asian. Using the conditional probability formula, we get P(Single | Asian) = P ( Single ∩ Asian ) P ( Asian ) = 21 47 = 0.4468.
c) This seems similar to the last question, however the part we know is that the person is single, but we do not know their race. In symbols we want to find the P(Asian | Single) = P ( Asian ∩ Single ) P ( Single ) = 21 222 = 0.0946.
Example 5
A blood test correctly detects a certain disease 95% of the time (positive result), and correctly detects no disease present 90% of the time (negative result). It is estimated that 25% of the population have the disease. A person takes the blood test and they get a positive result. What is the probability that they have the disease?
Show solution
Let D = Having the Disease, DC = Not having the disease, + is a positive result, and – is a negative result. We are given in the problem the following: P(+ | D ) = 0.95, P(– | DC ) = 0.90, P(D ) = 0.25. We want to find P (D |+) = P ( D ∩ + ) P ( + ) .
Figure 4-16
When you multiply up each pair of tree branches from left to right as shown in Figure 4-16, you are finding the intersection of the events. Place the multiplied values into a table. Note that the 0.2375 is not our answer. This is the people who have the disease and tested positive, but does not take into consideration the false positives. Since we know that the result was positive, we only divide by the proportion of positive results.
P
(
D
|
+
)
=
P
(
D
∩
+
)
P
(
+
)
=
0.2375
0.3125
=
0.76
There is a 76% chance that they have the disease given that they tested positive. Many of the more difficult probability problems can be set up in a table, which makes the probabilities easier to find.
Adapted from Mostly Harmless Statistics by Rachel Webb (Portland State University), hosted on LibreTexts (stats.libretexts.org) and licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0 .