InfyCalculator
➗

Bayes’ Theorem Calculator

Update a prior probability with new evidence using Bayes’ theorem — ideal for medical-test, spam-filter and diagnostic reasoning.

Prior P(A) — base rate
P(B|A) — true positive rate
P(B|not A) — false positive rate
Loading calculator…

How it works

P(A|B) = [ P(B|A) · P(A) ] / [ P(B|A) · P(A) + P(B|¬A) · (1 − P(A)) ]

Bayes’ theorem revises a prior probability P(A) once you observe evidence B. The denominator is the total probability of seeing that evidence — the true-positive path plus the false-positive path — which is why a very accurate test can still yield a low posterior when the condition is rare. This base-rate effect is the reason a 99% accurate screen for a 1-in-100 condition still leaves most positives as false alarms.

Worked example

With a base rate of 1%, a 99% true-positive rate and a 5% false-positive rate: numerator = 0.99 × 0.01 = 0.0099; denominator = 0.0099 + 0.05 × 0.99 = 0.0594; so P(A|B) = 0.0099 / 0.0594 = 16.67%.

Sources: Bayes’ theorem — Wikipedia

Frequently asked questions

Why is the posterior so low when the test is 99% accurate?

Because the condition is rare. With a 1% base rate there are far more healthy people, so even a small 5% false-positive rate produces more false positives than true positives. Bayes’ theorem weighs both, giving about 17%.

What is the false positive rate?

It is P(B|not A) — the chance the test comes back positive for someone who does not have the condition. It equals one minus the test’s specificity.

Can I chain a second test?

Yes. Use the posterior from the first test as the prior for the second. Two independent positives multiply the odds, which is why confirmatory testing works.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.