Quant GT
Browse all lessons
Section 3 · Lesson 3.2

Bayes' Theorem

Flipping conditional probabilities — updating beliefs with evidence.

Bayes' Theorem lets you swap the order of conditioning. If you know P(BA)P(B \mid A) and want P(AB)P(A \mid B):

P(AB)=P(BA)P(A)P(B)P(A \mid B) = \frac{P(B \mid A)\, P(A)}{P(B)}

The denominator P(B)P(B) usually expands via the law of total probability:

P(B)=P(BA)P(A)+P(BAc)P(Ac)P(B) = P(B \mid A)\, P(A) + P(B \mid A^c)\, P(A^c)

The classic worked example: a test for a rare disease (prevalence 11 in 1,0001{,}000) has 99%99\% sensitivity and 99%99\% specificity. You test positive. What's the probability you actually have the disease?

P(D+)=P(+D)P(D)P(+D)P(D)+P(+Dc)P(Dc)=0.990.0010.990.001+0.010.9990.090P(D \mid +) = \frac{P(+ \mid D)\, P(D)}{P(+ \mid D)\, P(D) + P(+ \mid D^c)\, P(D^c)} = \frac{0.99 \cdot 0.001}{0.99 \cdot 0.001 + 0.01 \cdot 0.999} \approx 0.090

Only about 9%9\%. Base rates dominate even very accurate tests when the underlying condition is rare.

This counter-intuitive answer is why Bayesian reasoning shows up everywhere — fraud detection, medical screening, classifier calibration, and any decision where you're updating from a low-prior prior with imperfect evidence.