Bayes' Theorem
InteractiveWorked example: given that a session contains an add-to-cart event, what is the probability it results in a purchase? Bayes' theorem lets us get there starting from P(Cart | Purchase) instead of measuring P(Purchase | Cart) directly.
The Formula
Plugging In the Numbers
Two Routes, Same Answer
The two calculations agree because Bayes’ theorem is a mathematical identity, not a source of new information — it is simply a different way of arranging the same joint probabilities. It becomes genuinely useful in practice when you know P(B | A) from one source (for example, a subgroup study or a lab test’s known false-positive rate) but cannot directly observe P(A | B).
Try It Yourself: Any Two Events
Understanding Bayes’ Theorem
Bayes’ theorem is a way to flip a conditional probability around. If you know how likely evidence is given an outcome, you can use it — together with how common the outcome and the evidence are on their own — to work out how likely the outcome is given the evidence. It is the mathematical backbone of updating a belief when new information arrives.