Update probabilities with new evidence
P(A|B) = P(B|A) × P(A)/P(B)
Where:
Enter your values and click "Calculate" to see results here
This calculator applies Bayes' Theorem to update the probability of a hypothesis (Event A) based on new evidence (Event B). It transforms your initial belief (prior probability) into a revised belief (posterior probability) after considering how likely the evidence is under both your hypothesis and alternative scenarios.
Key output: P(A|B) = The probability your hypothesis is true given the observed evidence. This fundamental concept is also the basis for more advanced tools like the Bayesian updating calculator which handles sequential evidence.
Bayes' Theorem answers: "Given that I observed this evidence, how likely is my hypothesis now?"
Your initial belief about the hypothesis before seeing new evidence. Also called the "base rate."
How probable the evidence is if your hypothesis is true. Measures test sensitivity or accuracy.
How probable the evidence is if your hypothesis is false. Measures test error rate.
Your updated belief about the hypothesis after considering the evidence.
| Symbol | Name | Definition | Example Context |
|---|---|---|---|
| P(A) | Prior Probability | Initial probability of hypothesis before evidence | Disease prevalence in population (1%) |
| P(B|A) | Likelihood | Probability of evidence given hypothesis is true | Test sensitivity (99% true positive rate) |
| P(B|¬A) | False Positive Rate | Probability of evidence given hypothesis is false | Test false alarm rate (5%) |
| P(¬A) | Complement of A | Probability hypothesis is false = 1 - P(A) | 99% of people don't have the disease |
| P(B) | Marginal Likelihood | Overall probability of observing the evidence | Total positive test results in population |
| P(A|B) | Posterior Probability | Updated probability of hypothesis after evidence | Probability actually has disease given positive test |
Subtract prior probability from 1: P(¬A) = 1 - P(A)
Total probability of evidence: P(B) = P(B|A)P(A) + P(B|¬A)P(¬A)
P(A|B) = [P(B|A) × P(A)] / P(B)
Why this works: The denominator P(B) accounts for all possible ways the evidence could occur, both when your hypothesis is true and when it's false. This normalization ensures probabilities sum to 1. The calculation of the marginal probability P(B) is essentially a weighted average, a concept also used in calculating a relative frequency from observed data.
Interpret your posterior probability P(A|B) based on these guidelines:
Evidence supports your hypothesis. The evidence is more likely under your hypothesis than alternatives.
Evidence contradicts your hypothesis. Alternative explanations are more likely.
Evidence is uninformative. It's equally likely under all hypotheses.
Practical interpretation: A posterior probability of 0.1667 means there's a 16.67% chance your hypothesis is true given the observed evidence. This might be surprisingly low even with a "99% accurate" test if the prior probability was very low. This process of updating beliefs can be understood visually using tools like a probability tree diagram generator.
Scenario: Rare disease (1% prevalence), 99% accurate test, 5% false positive rate.
Result: Positive test only means ~16.7% actual disease probability.
Lesson: Base rates matter more than test accuracy for rare events.
Scenario: 20% of emails are spam, filter catches 95% of spam, has 3% false positives.
Result: Flagged email has ~89% probability of actually being spam.
Lesson: High prior probability leads to reliable filtering despite errors.
Scenario: 0.1% break-in chance, 99% detection rate, 1% false alarm rate.
Result: Alarm indicates ~9% actual break-in probability.
Lesson: False alarms overwhelm true signals for rare events.
Most common error: Ignoring P(A) and focusing only on P(B|A). People think "99% accurate test" means "99% chance I have the disease" when the prior probability is low.
Wrong: "The test is 99% accurate, so I have a 99% chance of having the disease."
Right: "Given a positive test, I have a 16.7% chance of having the disease."
Forgetting that evidence can occur even when your hypothesis is false. This is captured by P(B|¬A).
Test accuracy combines sensitivity and specificity. A "99% accurate" test might still give misleading results for rare conditions.
Not dividing by P(B) leads to probabilities that don't sum to 1 across all possibilities.
P(A|B) means "probability of A given B" or "probability of A conditional on B." It's not division!
Instead of percentages, think: "Out of 10,000 people, 100 have the disease, 99 test positive..." This avoids base rate errors.
Bayesian: Probability = degree of belief. Frequentist: Probability = long-run frequency. Bayes lets you update beliefs.
When P(A) is very small (like 0.1%), even excellent tests (99% accuracy) yield modest posterior probabilities.
When precision matters: For critical applications (medical diagnosis, legal evidence, financial decisions), consult a statistician and use specialized software with error propagation analysis.
Results compute in <10ms using client-side JavaScript
All calculations occur in your browser for privacy and speed
Fully responsive design works on all devices
Future Enhancements Planned: Multiple hypothesis testing, Bayesian networks, prior distribution selection, and confidence interval estimation for inputs.