03 · UNDERSTAND THE METHOD
How the bayes’ theorem calculator works
Bayes’ theorem updates a prior probability using how likely the observed evidence is in two complementary groups. This calculator models A and not A as exhaustive alternatives, then calculates the share of evidence B that originates from A. It is useful for learning how base rates and likelihoods interact. The inputs are hypothetical or user supplied; the tool does not determine the quality or applicability of the underlying evidence model.
The formula and its variables
- Prior
- Probability of A before conditioning on B.
- Likelihoods
- Probabilities of B in A and its complement.
The calculation, step by step
- Enter the prior probability of A, the likelihood of B given A, and the likelihood of B given not A. Use the same definition of evidence in both groups.
- Multiply the prior by its likelihood and the complementary prior by the other likelihood. Add these two joint contributions to obtain total evidence probability.
- Divide the A contribution by total evidence. Require the total to be positive and read the updated conditional probability.
A worked example
A prior of 0.2, likelihood 0.8 in group A, and likelihood 0.1 outside A produce evidence contributions 0.16 and 0.08. Total evidence probability is 0.24. The posterior share is 0.16/0.24=2/3, approximately 66.666667%. Ignoring the second group would incorrectly treat all observed evidence as coming from A.
| Prior P(A) | 0.2 |
|---|---|
| P(B given A) | 0.8 |
| P(B given not A) | 0.1 |
| Posterior P(A given B) | 66.666667% |
How to read the result and visual
The posterior depends on both likelihoods and the prior. Evidence common outside A may provide less support than a large first likelihood alone suggests. The result is a conditional model output, not a statement of causation. A posterior can legitimately remain low when a prior is small, even if evidence is more likely within A.
Assumptions, rounding, and limitations
The two groups must be complementary and exhaustive. Zero total evidence is rejected because the requested condition is impossible under the entered model. This tool does not estimate likelihoods, quantify uncertainty in them, or make a medical, legal, or financial classification. Such applications need domain-appropriate data beyond arithmetic.
Frequently asked questions
Is P(B|A) the same as the posterior?
No. The posterior reverses the condition and must account for the prior and evidence from the other group.
Can Bayes’ theorem create reliable inputs?
No. It combines the probabilities you supply; their reliability must be assessed separately.