Probability · Calculator · 5 min

Bayes’ theorem

A signal arrives. How much should it change your belief? Explore prior probability, true positives, and false positives.

02/ 08
Make it your own
%
%
%

Change a value. See what changes.

What happensLive calculation

The idea to keep

A reliable signal can still be misleading when the thing you are looking for is rare.

01 / The explanation

What is going on?

Bayes’ theorem updates a prior probability after new evidence. The numerator counts signals from the event of interest. The denominator counts all signals, including false positives. Thinking in counts often makes the result easier to understand than thinking only in percentages.

P(A | signal) = P(signal | A)P(A) / [P(signal | A)P(A) + P(signal | not A)P(not A)]
02 / Step by step

Work through it

  1. Multiply the prior probability by the true-positive rate.
  2. Multiply the probability of the event being absent by the false-positive rate.
  3. Divide the first result by the sum of both results.
03 / A worked example

Put numbers to the idea

Imagine 10,000 items, with 1% defective. A check flags 90% of defective items and 5% of good items. It flags 90 defective items and 495 good items. Among flagged items, 90 / 585 ≈ 15.38% are defective.

04 / Common questions

A little more clarity

What is a prior probability?

It is the probability of the event before considering this particular signal. In the worked example, it is the fraction of items that are defective.

Is specificity the same as false-positive rate?

Specificity is the true-negative rate. False-positive rate equals 1 minus specificity, so 95% specificity corresponds to a 5% false-positive rate.

Why can the posterior be undefined?

When neither group can produce the signal, the denominator is zero. Conditioning on that impossible signal has no defined result in this model.