Finds the probability of really having a condition after testing positive. From the prior P(A), the true positive rate P(B|A) and the false positive rate P(B|Ā), it calculates P(A|B).
Bayes' theorem updates a probability in the light of new evidence. Its most famous use is working out how likely you are to be ill after testing positive.
The denominator collects everyone who tests positive: the ill who are correctly flagged plus the healthy who are wrongly flagged.
A disease affects 1% of people (). The test catches 99% of cases and wrongly flags 5% of healthy people. You test positive.
Despite the positive result, the chance of actually being ill is only 16.7%.
Imagine 10,000 people. About 100 are ill, and 99 of them test positive. Of the 9,900 healthy people, 5% — that is 495 — also test positive.
That makes 594 positive results, of which only 99 are genuine: .
Because the disease is rare, the false positives among the healthy majority simply outnumber the true positives. Even an accurate test produces mostly false alarms when screening for something uncommon. This is the base rate fallacy.