Loading…

Bayes' Theorem Basic Calculator

Math Probability • Conditional Probability and Events

View all topics

Bayes’ Theorem Basic Calculator – Prior → Posterior (Free)

Compute the posterior probability with Bayes’ theorem: \(P(A\mid B)=\dfrac{P(B\mid A)P(A)}{P(B)}\). The tool also computes the evidence \(P(B)\) by normalization.

Tip: Press Play after a successful calculation to animate the “prior → posterior” bars.

Inputs (probabilities)

Accepted expressions: 1e-3, pi, e, sqrt(2), sin(), cos(), tan(), ln(), log(), abs(). Use * for multiplication.

Output settings
Evidence is computed automatically: \(P(B)=P(B\mid A)P(A)+P(B\mid\neg A)P(\neg A)\).
Animation
Canvas supports pan (drag empty space) and zoom (mouse wheel / trackpad).
Ready
Interactive prior → posterior view

Left: prior split \(P(A)\) vs \(P(\neg A)\). Right: posterior split \(P(A\mid B)\) vs \(P(\neg A\mid B)\) (animated by Play).

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What is Bayes’ theorem used for?

It updates a probability after observing evidence: it converts a prior P(A) into a posterior P(A|B) using likelihoods and normalization.

What is the evidence P(B) and why is it needed?

P(B) normalizes the result so the posterior is a valid probability. In the binary case it is computed as P(B|A)P(A)+P(B|¬A)P(¬A).

Why can the posterior be much smaller than the test accuracy?

If the prior is very small (rare hypothesis) and false positives are non-negligible, the evidence P(B) includes many cases from ¬A, reducing P(A|B).

Does Bayes’ theorem work for more than two hypotheses?

Yes. For mutually exclusive hypotheses {Hi}, the posterior is P(Hi|B)=P(B|Hi)P(Hi)/Σj P(B|Hj)P(Hj).