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.