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
Conditional Probability Rule: P (A |B ) = or P (B |A ) =
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) = = = 0.5233.
c) P (Gov|Foreign) = = = 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) = = = 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) = = = 0.0946.
Definition
Keep in mind that P(A | B) ≠ P(B | A) since we would divide by a different total in the equation.
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?
Try it in XYZ Crunch
Bayes lab: prior 0.25, likelihoods 0.95 and 0.10
The Bayes lab takes each hypothesis with its prior and its probability of a positive result: Disease 0.25 and 0.95, No disease 0.75 and 0.10 (a 90% correct negative means a 10% false positive). With a population of 10,000 it counts 2,375 true positives against 750 false positives, so P(D | +) = 2375/3125 = 0.76. Drop the prior to 0.01 and the same positive result is only 8.8% believable - the base-rate effect.
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|+) = .

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.
| DC | D | Total | |
|---|---|---|---|
| + | 0.075 | 0.2375 | 0.3125 |
| – | 0.675 | 0.0125 | 0.6875 |
| Total | 0.75 | 0.25 | 1 |
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, https://mostlyharmlessstat.wixsite.com/webpage), © Rachel Webb, licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.