.
Visualizing Conditional Probabilities
Therelative incidence of pneumonia in the United States in one year is around 2 percent—six million people out of the 324 million in the country are diagnosed each year (of course there are no doubt many undiagnosed cases, as well as individuals who may have more than one case in a year, but let’s ignore these details for now). Therefore the probability of any person drawn at random having pneumonia is approximately 2 percent. But we can home in on a better estimate if we know something about that particular person. If you show up at the doctor’s office with coughing, congestion, and a fever, you’re no longer a person drawn at random—you’re someone in a doctor’s office showing these symptoms. You can methodically update your belief that something is true (that you have pneumonia) in light of new evidence. We do this by applyingBayes’s rule to calculate a conditional probability: What is the probability that I have pneumonia given that I show symptom x? This kind of updating can become increasingly refined the more information you have. What is the probability that I have pneumonia given that I have these symptoms, and given that I have a family history of it, and given that I just spent three days with someone who has it? The probabilities climb higher and higher.
You can calculate the probabilities using the formula for Bayes’s rule (found in the Appendix), but an easy way to visualize and compute conditional probabilities is with the fourfold table, describing all possible scenarios: You did or didn’t order a hamburger, and you did or didn’t receive ketchup:
Ordered Hamburger
YES
NO
Received Ketchup
YES
NO
Then, based on experiments and observation, you fill in the various values, that is, the frequencies of each event. Out of sixteen customers you observed at a restaurant, there was one instance of someone ordering a hamburger with which they received ketchup, and two instances with which they didn’t. These become entries in the left-hand column of the table:
Ordered Hamburger
YES
NO
Received Ketchup
YES
1
5
NO
2
8
Similarly, you found that five people who didn’t order a hamburger received ketchup, and eight people did not. These are the entries in the right-hand column.
Next, you sum the rows and columns:
Ordered Hamburger
YES
NO
Received Ketchup
YES
1
5
6
NO
2
8
10
3
13
16
Now, calculating the probabilities is easy. If you want to know the probability that you received ketchup given that you ordered a hamburger, you start with the given. That’s the left-hand vertical column.
Ordered Hamburger
YES
NO
Received Ketchup
YES
1
5
6
NO
2
8
10
3
13
16
Three people ordered hamburgers altogether—that’s the total at the bottom of the column. Now what is the probability of receiving ketchup given you ordered a hamburger? We look now atthe “YES received ketchup” square in the “YES ordered hamburger” column, and that number is 1. The conditional probability, P(ketchup|hamburger) is then just one out of three. And you can visualize the logic: three people ordered a hamburger; one of them got ketchup and two didn’t. We ignore the right-hand column for this calculation.
We can use this to calculate any conditional probability, including the probability of receiving ketchup if you didn’t order a hamburger: Thirteen people didn’t order a hamburger, five of them got ketchup, so the probability is five out of thirteen, or about 38 percent. In this particular restaurant, you’re
Tricia McGill
Jason Wallace
Anne Calhoun
Elisabeth Wolf
Theodore Sturgeon
Renee Ericson
Ciana Stone
Alana Sapphire
Amy Goldman Koss
Nicole Luiken