Bayes' Theorem Examples in Math
Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Bayes' Theorem.
This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Math.
Concept Recap
Bayes' theorem gives the posterior probability of a hypothesis given evidence: P(H|E) = \frac{P(E|H) \cdot P(H)}{P(E)}.
Start with a prior belief, then reweight it by how likely the evidence is under each hypothesis.
Read the full concept explanation โHow to Use These Examples
- Read the first worked example with the solution open so the structure is clear.
- Try the practice problems before revealing each solution.
- Use the related concepts and background knowledge badges if you feel stuck.
What to Focus On
Core idea: Posterior equals prior times likelihood, normalized by evidence.
Common stuck point: The base rate (prior probability P(H)) is the most commonly neglected factor โ ignoring it leads to the base-rate fallacy and wildly overconfident conclusions.
Sense of Study hint: When you need to update a probability after new evidence, use Bayes' theorem. First, identify the prior probability P(A) and the likelihood P(B|A). Then compute the total probability of the evidence P(B) = P(B|A)P(A) + P(B|A^c)P(A^c). Finally, apply the formula: P(A|B) = P(B|A) \cdot P(A) / P(B).
Worked Examples
Example 1
mediumSolution
- 1 Prior: P(\text{spam})=0.3, P(\text{legit})=0.7
- 2 Likelihoods: P(\text{free}|\text{spam})=0.8, P(\text{free}|\text{legit})=0.1
- 3 Law of total probability: P(\text{free}) = 0.8(0.3) + 0.1(0.7) = 0.24 + 0.07 = 0.31
- 4 Bayes: P(\text{spam}|\text{free}) = \frac{P(\text{free}|\text{spam}) \times P(\text{spam})}{P(\text{free})} = \frac{0.8 \times 0.3}{0.31} = \frac{0.24}{0.31} \approx 0.774
Answer
Example 2
hardPractice Problems
Try these problems on your own first, then open the solution to compare your method.
Example 1
easyExample 2
hardRelated Concepts
Background Knowledge
These ideas may be useful before you work through the harder examples.