AI Engineer Path

Concept Lab · Week 5 · Prerequisites

Bayes on a population grid

See why a 99%-accurate test for a rare condition is usually wrong.

The idea: Conditional probability and Bayes' theorem

P(A∣B)P(A\mid B) is the probability of A given that B happened: restrict the world to B, then ask how much of it is A. By definition P(A∣B)=P(A∩B)/P(B)P(A\mid B) = P(A \cap B)/P(B).

Write the joint probability both ways, P(A∩B)=P(A∣B)P(B)=P(B∣A)P(A)P(A\cap B) = P(A\mid B)P(B) = P(B\mid A)P(A), and divide: that is Bayes' theorem. It flips a conditional around: from 'how likely is this evidence if the hypothesis is true' to 'how likely is the hypothesis given the evidence'.

The classic trap is ignoring the base rate. A 99%-accurate detector for something that affects 1 in 1,000 people still produces mostly false positives. The simulation lets you see it as a population grid.

Open the full lesson in week 5

Next simulation: Central Limit Theorem