The mathematics of uncertainty
Often you know one direction of a conditional but want the other. A medical test tells you P(positive | disease), but the patient wants P(disease | positive). Bayes' theorem is the bridge that flips a conditional probability around.
It falls straight out of last lesson. The multiplication rule gives P(A∩B) two ways, as P(A|B)P(B) and as P(B|A)P(A). Set them equal and divide by P(B). The three pieces have names you'll meet everywhere in ML: P(A) is the prior (belief before evidence), P(B|A) is the likelihood (how well A explains the evidence), and P(A|B) is the posterior (updated belief).
The bottom P(B) is usually computed by splitting across all the ways B can occur, the law of total probability: