Bayes' Theorem

1 min read

P(AB)=P(BA)P(A)P(B)P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}

Components:

  • P(AB)P(A|B)posterior: updated belief about AA after observing BB
  • P(BA)P(B|A)likelihood: probability of evidence BB given AA
  • P(A)P(A)prior: belief about AA before seeing evidence
  • P(B)P(B)marginal likelihood (normalizer): P(B)=iP(BAi)P(Ai)P(B) = \sum_i P(B|A_i)P(A_i)

Intuition: Bayes' theorem is a principled way to update beliefs with evidence. Start with a prior → observe data → compute posterior.

Where it appears:

  • MAP = argmax of posterior = MLE + prior
  • Naive Bayes classifier — assumes feature independence given the class
  • Bayesian inference — treat model parameters as random variables with priors
  • Bayesian RL — maintain posterior over environment dynamics or reward functions

Concrete example: a medical test is 99% accurate. Disease prevalence is 1%. If you test positive:

P(diseasepositive)=0.99×0.010.99×0.01+0.01×0.99=0.5P(\text{disease}|\text{positive}) = \frac{0.99 \times 0.01}{0.99 \times 0.01 + 0.01 \times 0.99} = 0.5

A positive test only means 50% chance of disease — the prior matters enormously.

See also: KL Divergence, Key Probability Distributions

Linked from