Statistics

Bayes' Theorem: Formula, Intuition, and Worked Examples

Bayes' Theorem tells you how to update a probability when new evidence arrives. Learn the formula, the intuition behind priors and posteriors, why the base rate fallacy fools doctors and juries, and how to set up Bayes problems step by step with worked examples from medical testing and spam filtering.

Frequently asked questions

How do you use Bayes' theorem step by step?

Write down the prior P(A), the likelihood P(B|A), and the total probability of the evidence P(B). Then compute P(A|B) = P(B|A)·P(A) / P(B). Find P(B) by adding P(B|A)·P(A) and P(B|not A)·P(not A). Drawing a tree diagram keeps the numbers organized.

Why is a positive test often a false alarm for a rare disease?

Most people tested are healthy, so even a small false positive rate produces many false alarms. Suppose 1 in 1,000 people have a disease, and the test catches 99% of cases with a 5% false positive rate. Per 1,000 people you get about 1 true positive and 50 false ones, so a positive result is real only about 2% of the time.

What is the difference between P(A|B) and P(B|A)?

P(A|B) is the probability of A given that B happened, and P(B|A) is the probability of B given A. They are usually different numbers. Many people with a cold have a runny nose, but many people with a runny nose do not have a cold. Bayes' theorem converts one into the other.

What are prior and posterior probabilities?

The prior is your probability for a hypothesis before seeing new evidence. The posterior is the updated probability after the evidence, found as likelihood times prior divided by the probability of the evidence. A posterior can become the prior for the next piece of evidence, so you can update step by step.

Where is Bayes' theorem used in real life?

It is used to interpret medical tests, filter spam, and classify data in machine learning. Naive Bayes spam filters estimate how likely a message is spam given the words it contains. Doctors use it to turn test accuracy and disease prevalence into the chance a patient really has the condition.

Try these solvers

Statistics10 min read

Introduction to Probability: Rules, Formulas & Examples

Probability measures how likely events are. Master sample spaces, the addition and multiplication rules, conditional probability, and Bayes' theorem with clear examples.

Statistics14 min read

Hypothesis Testing: Step-by-Step Guide with Examples

Master hypothesis testing step by step. Learn to set up the null and alternative hypotheses, choose z-tests vs t-tests, interpret p-values, and avoid Type I and Type II errors.

Statistics12 min read

Normal Distribution & Z-Scores: How to Use the Bell Curve

Understand the normal distribution and z-scores with this complete guide. Learn the properties of the bell curve, how to calculate and interpret z-scores, use the z-table, and apply it all to real-world problems.

Stuck on your own problem?

Snap a photo in Solver AI for iPhone and iPad and see every step, so you can do the next one yourself.