AI in Motion

Bayes’ Theorem: Reasoning Under Uncertainty

Artificial IntelligenceBeginner1:185 chapters

A positive medical test that is “90% accurate” — so why is the chance of being sick only about 32%? Bayes’ theorem explained with 200 people.

📄 Illustrated notes · every chapter as a picture · printable

Shortcuts: Space play/pause · ←/→ 5 s · N/P chapter · M voice · C subtitles · F fullscreen

Quick quiz

3 questions to check your understanding.

Q1 In the example, how many of the 28 positive tests were truly sick?
Q2 What is the “prior” in this example?
Q3 Why is the posterior so much lower than 90%?

Go deeper

University-level written lectures in The AI Lecture Hall:

Transcript

Introduction. AI systems constantly reason under uncertainty. Bayes theorem tells us how to update a belief when new evidence arrives. Let us see it with a simple medical test.

Counting people. Picture 200 people. Five percent, that is ten people, are actually sick. The test catches 90 percent of sick people, so nine test positive. But it also wrongly flags 10 percent of the 190 healthy people, which is 19 false alarms. So of 28 positive results, only nine are sick. About 32 percent.

The formula. The formula says: the posterior equals the likelihood times the prior, divided by the evidence. Point nine times point zero five, divided by point one four, gives about point three two. Exactly what we counted.

Why it matters. Our intuition fails because we ignore the base rate. When a condition is rare, even a small false-alarm rate produces many false positives. A second independent test would change the picture a lot. Spam filters and diagnostic AI use exactly this reasoning.

Recap. To recap. Start with a prior. Weigh the evidence with the likelihood. Get an updated posterior. And never forget the base rate.