Probability Tree for Bayes' Theorem
Two coral paths end in evidence $B$: the true-positive branch $A \cap B$ and the false-positive branch $A' \cap B$. Bayes' Theorem divides the top coral branch by the sum of BOTH coral branches.
Two-Line Derivation from Conditional Probability
Write the intersection $P(A \cap B)$ in two symmetric ways using the multiplication rule.
- By conditional probability, $P(A \cap B) = P(A \mid B)P(B)$ and also $P(A \cap B) = P(B \mid A)P(A)$.
- Set them equal: $P(A \mid B)P(B) = P(B \mid A)P(A)$.
- Divide by $P(B)$: $P(A \mid B) = \frac{P(B \mid A)P(A)}{P(B)}$.
- Expand $P(B)$ using the Law of Total Probability: $P(B) = P(B \mid A)P(A) + P(B \mid A')P(A')$.
The 4 Pieces of Bayes' Theorem
Initial probability of hypothesis $A$ BEFORE seeing the evidence.
Probability of observing evidence $B$ if hypothesis $A$ is true (e.g., test sensitivity).
Sum of ALL ways $B$ can happen: $P(B \mid A)P(A) + P(B \mid A')P(A')$.
Updated probability of $A$ AFTER observing evidence $B$.
Step-by-Step Worked Examples
Example 1: The Classic Medical Screening Paradox
- True-positive branch: $P(+ \mid D)P(D) = 0.99 \times 0.01 = 0.0099$.
- False-positive branch: $P(+ \mid D')P(D') = 0.05 \times 0.99 = 0.0495$.
- Total positive probability: $P(+) = 0.0099 + 0.0495 = 0.0594$.
- Posterior: $P(D \mid +) = \frac{0.0099}{0.0594} = \frac{1}{6} \approx 16.7\%$ — far lower than $99\%$ because the condition is rare!
Example 2: Two Factories Quality Control
- Branch A defective: $0.60 \times 0.02 = 0.012$. Branch B defective: $0.40 \times 0.05 = 0.020$.
- Total defective: $P(\text{Def}) = 0.012 + 0.020 = 0.032$.
- Apply Bayes: $P(B \mid \text{Def}) = \frac{0.020}{0.032} = 0.625$ ($62.5\%$).
Common Mistakes to Avoid
Mistake 1: Base-Rate Fallacy: Confusing $P(A \mid B)$ with $P(B \mid A)$
Why: When $A$ is rare, even a small false-positive rate on the huge $A'$ group can outnumber true positives.
Mistake 2: Forgetting the Second Term in $P(B)$
Why: Drawing a quick 2-level tree diagram makes both branches impossible to miss.
Frequently Asked Questions
When should I draw a probability tree vs. a two-way table?
Both work! For quick mental intuition, imagine $10{,}000$ people in a $2 \times 2$ table—you'll get the exact same Bayes ratio without memorizing letters.
What if there are 3 or more hypotheses ($A_1, A_2, A_3$)?
Just sum all $k$ branches in the denominator: $P(B) = \sum_{i=1}^k P(B \mid A_i)P(A_i)$.
Where is Bayes' Theorem used in real life?
Medical diagnostics, email spam filters, machine learning classifiers, A/B testing, and forensic statistics.