themath.net is available for acquisition at >$999. View prospectus·Contact
Probability

Bayes' Theorem in Practice: Three Problems That Build the Intuition

By Dr. Iris Vaughan, Mathematics Editor·Published 10 May 2025·Last reviewed 1 September 2025

Bayes' theorem is taught as a formula; it is understood as a way of updating beliefs in the face of evidence. These three problems — of increasing complexity — build the latter from the former.

Bayes' theorem: P(A|B) = P(B|A) · P(A) / P(B)

In words: the probability of hypothesis A given evidence B equals the probability of observing B if A were true, times the prior probability of A, divided by the total probability of observing B.

The formula is correct. Its significance is that it quantifies how evidence changes beliefs — and how much the prior probability matters.

Problem 1 — Medical testing

A disease affects 1% of the population. A test for the disease is 95% accurate (if you have the disease, the test is positive 95% of the time; if you do not have it, the test is negative 95% of the time).

You test positive. What is the probability you have the disease?

Most people say "95%" — because the test is 95% accurate. The correct answer is approximately 16%.

Using Bayes': P(disease | positive) = P(positive | disease) · P(disease) / P(positive)

P(positive) = P(positive | disease)·P(disease) + P(positive | no disease)·P(no disease) = 0.95 × 0.01 + 0.05 × 0.99 = 0.0095 + 0.0495 = 0.059

P(disease | positive) = (0.95 × 0.01) / 0.059 ≈ 0.161 ≈ 16%

The low prior probability (1% prevalence) dominates the calculation. This is the base-rate fallacy: intuition ignores the prior and focuses on the evidence alone.

Problem 2 — Card game

You draw two cards from a standard 52-card deck without replacement. You know (from a peek by someone else) that at least one card is an Ace. What is the probability that both are Aces?

P(both Aces | at least one Ace) = P(both Aces) / P(at least one Ace)

P(both Aces) = C(4,2)/C(52,2) = 6/1326 = 1/221

P(at least one Ace) = 1 − P(no Aces) = 1 − C(48,2)/C(52,2) = 1 − 1128/1326 = 198/1326 = 33/221

P(both | at least one) = (1/221) / (33/221) = 1/33 ≈ 3%

Problem 3 — Spam filtering

A spam filter classifies emails. 30% of incoming email is spam. The filter correctly identifies spam 90% of the time (true positive rate). It incorrectly marks legitimate emails as spam 2% of the time (false positive rate).

An email is marked spam. What is the probability it actually is spam?

P(spam | marked spam) = P(marked spam | spam) · P(spam) / P(marked spam) = (0.90 × 0.30) / (0.90 × 0.30 + 0.02 × 0.70) = 0.27 / (0.27 + 0.014) = 0.27 / 0.284 ≈ 95%

The much higher prior (30% spam rate vs. 1% disease rate) produces a much more reliable filter output. This is why spam filters are accurate and why disease tests need confirmatory tests.

Written by Dr. Iris Vaughan. Subscribe to The Math Notebook for weekly posts.