Advertisement

Bayes' theorem calculator

Enter a prior and the chance of the evidence under each of two competing cases. Choose a different unknown to rearrange the same model.

Calculator

Posterior P(A | B)
66.666667%
Prior P(A)
20.000000%
P(B | A)
80.000000%
P(B | not A)
10.000000%
Evidence probability P(B)
24.000000%

Advertisement

How this calculator works

Bayes theorem reweights a prior by how well each case predicts the observed evidence. The two cases A and not A must exhaust the possibilities. The evidence probability is a weighted sum across those cases. Inverse modes reject impossible solutions and cases that do not determine one unique answer. These are model probabilities; the calculation does not establish whether the prior or likelihood estimates are reliable.

Formula

P(A | B) = P(A)P(B | A) / [P(A)P(B | A) + (1 - P(A))P(B | not A)].

Worked example

A factory supplies 20% of parts. A flag occurs for 80% of its parts and for 10% of all other parts. The flag rate is 0.2 × 0.8 + 0.8 × 0.1 = 0.24. A flagged part came from this factory with probability 0.16/0.24 = 66.67%.

Advertisement

Frequently asked questions

Are P(A | B) and P(B | A) interchangeable?

No. They condition on different events. A common effect can have a very different reverse probability when the cause is rare.

Can the evidence have probability zero?

No. A conditional probability needs a positive conditioning probability. Zero-probability evidence is rejected.

Why can an inverse mode have no solution?

The supplied numbers may imply a likelihood above 100%, or may leave the unknown undetermined. Neither case gives a unique valid probability.

Sources

Advertisement