Octonote AI
Make your own →

Bayes' theorem and the 99%-accurate test

Sunil Tiwari· Oct 12, 2026 · 1 min

A medical test is 99% accurate. You test positive. What's the chance you actually have the disease? Most people say 99%. The real answer is usually far lower.

The theorem

P(D∣+)=P(+∣D) P(D)P(+)P(D \mid +) = \frac{P(+ \mid D)\, P(D)}{P(+)}

where the denominator sums over both ways to test positive:

P(+)=P(+∣D) P(D)+P(+∣¬D) P(¬D)P(+) = P(+ \mid D)\,P(D) + P(+ \mid \neg D)\,P(\neg D)

Plug in numbers

  • Prevalence P(D)=0.001P(D) = 0.001 (1 in 1,000)
  • Sensitivity P(+∣D)=0.99P(+ \mid D) = 0.99
  • False-positive rate P(+∣¬D)=0.01P(+ \mid \neg D) = 0.01
P(D∣+)=0.99×0.0010.99×0.001+0.01×0.999=0.000990.01098≈9%P(D \mid +) = \frac{0.99 \times 0.001}{0.99 \times 0.001 + 0.01 \times 0.999} = \frac{0.00099}{0.01098} \approx 9\%

Why so low?

Picture 100,000 people. 100 are sick and 99 of them test positive. Of the 99,900 healthy people, 1% — about 999 — also test positive. So only 99 of 1,098 positives are real.

When a condition is rare, false positives outnumber true positives — even with an accurate test.

Test twice

Use the posterior as the new prior. After a second independent positive:

P(D∣++)=0.99×0.090.99×0.09+0.01×0.91≈91%P(D \mid ++) = \frac{0.99 \times 0.09}{0.99 \times 0.09 + 0.01 \times 0.91} \approx 91\%
Was this useful?
Written bySunil TiwariMore from Octonote examples →
Notes and canvases, together.This page was made with Octonote AI. Publish your own in one click.
Get started free