Bayes' Theorem
The agency buys a fake-listing detector. It catches 90% of fake listings and wrongly flags only 10% of genuine ones. A listing gets flagged. Is it 90% likely to be fake? Most people say yes, and most people are badly wrong. Bayes' theorem shows why.
The rule
Reverse a condition: likelihood times prior, divided by evidence.
The detector tells you . You want the reverse, . Bayes' theorem connects them:
- Prior : how common the cause is before any evidence. Here 5% of listings are fake.
- Likelihood : how often the evidence appears when the cause is true. Here 0.9.
- Evidence : how often the evidence appears at all, from any cause.
- Posterior : the updated belief after seeing the evidence.
Check it on last lesson's 20 flats: , the same answer the table gave by counting.
Bayes' theorem also chains. If a second, independent check flags the same listing, today's posterior of 0.32 becomes the prior for that update, and the belief climbs again. Learning from evidence is repeated Bayesian updating.
A naive Bayes classifier uses this rule directly: it multiplies the likelihoods of each feature (each word in a listing, say) with the prior for each class, and picks the class with the higher result.
The shortcut
Natural frequencies. Imagine a round number of cases, such as 1000, and split them down a tree. Then the posterior is a simple fraction you can read off, with no formula to misremember.
Start with 1000
5% are fake: 50 fake listings and 950 genuine ones.
The detector is good, but fakes are rare, so a small false-alarm rate applied to the large genuine group produces more flags than the real fakes do. Ignoring the prior is called base-rate neglect, and it is the trap this lesson is about.
Drills
Answer fast — trust the rule.
From the 20-flat table, P(fast given near) = 0.75, P(near) = 0.4 and P(fast) = 0.6. What is P(near given fast)?
Out of 1000 listings (50 fake), how many genuine listings does the detector wrongly flag?
What is the chance that a flagged listing is actually fake?
If fakes were 50% of listings, with the same detector, what would P(fake given flag) be?
In this problem, which quantity is the prior?
Remember
- Reverse a condition: likelihood times prior, divided by evidence.
- Shortcut: imagine 1000 cases, split them down a tree, read off the fraction.
- Trap: base-rate neglect, forgetting how rare the cause is.
