Conditional Probability · Bayes' Formula
Lesson 7
Intuitively, it seems that since the test errs with a probability of no more than ten percent, a randomly chosen person with a positive test should be ill with a probability of about \(0.9\). But that is far from the case. Let's analyze this.
Denote the events “ill” and “positive test” as \(H\) and \(E\), respectively (\(H\) is our hypothesis, \(E\) is the observed event). Then \(\Pr[E \mid H]=0.9\) is the probability of a positive test for a sick person. \(\Pr[H]=0.01\) is the probability of being sick. Next, \(\Pr[E \mid \neg H]\Pr[\neg H]=\Pr[E \cap \neg H]=0.99\cdot 0.05\) is the probability of a positive test for a healthy person. Substituting this into Bayes' formula, we get: \[\Pr[H \mid E]= \frac{0.9}{0.01 \cdot 0.9+0.99\cdot 0.05}\cdot 0.01 \approx 0.154 \ .\]
One can look at it differently. Consider \(10\ 000\) people. Of them, \(100\) will be sick on average. Ninety out of one hundred will test positive. The remaining \(9\ 900\) will be healthy. But for \(9\ 900 \cdot 0.05=495\) of them, the test will be positive! Thus, there will be a total of \(90+495=585\) people with a positive test, but only \(90\) of them will actually be sick! (Of course, \(90/585 \approx 0.154\).) That is, healthy people make a big contribution to the group of people with a positive test: there are \(9900\) healthy people, and even five percent of that number is \(495\), which is much more than \(90\) (sick people with the disease).
For clarity, let us now repeat the same reasoning visually. The green rectangle shows the proportion of sick people (\(0.01\)). The pink rectangle shows people with positive tests. Their proportion is \(0.0585\). In particular, the proportion of people with positive tests among all sick people is \(0.9\), i.e., \(0.9\) of the green rectangle lies in the pink rectangle. At the same time, as can be seen, there are many healthy people with positive tests.
