The Law of Total Probability
A recipe for finding the probability of an event by splitting the world into disjoint cases, solving each easy case, and reweighting by how likely each case is. The denominator of Bayes' theorem and the backbone of "condition on what you don't know."
Prerequisites: Conditional Probability
The law of total probability is the "divide and conquer" of probability. When an event is hard to reason about directly, you split the world into a handful of separate cases, work out how likely is inside each easy case, and then blend those answers together, weighting each by how likely the case itself is. It is the single most reliable move for a problem that starts with the words "depends on."
The idea in words
Suppose the world can only be in one of several cases, , that do not overlap and together cover every possibility. Such a set of cases is called a partition: exactly one of them is true, always. The event then happens by happening inside one of those cases. So the total chance of is just the chance of within each case, added up and scaled by how often each case occurs.
Symbol by symbol: is how likely case is; is how likely is if you are in case (a Conditional Probability); and the sum runs over every case. Because the cases are disjoint and exhaustive, their probabilities satisfy , so you are taking an honest weighted average of the conditional probabilities.
When a problem starts with "it depends on...", condition on the thing you don't know: split the world into disjoint, exhaustive cases and take a weighted average, .
Why it works
Because the cases never overlap, the ways of " and ," " and ," and so on are separate slices with no double-counting, so their probabilities simply add: . Then rewrite each slice with the multiplication rule, , and you have the law. It is nothing more than "add up the disjoint pieces, then measure each piece with a conditional probability."
Worked example
A trading signal fires in one of three market regimes. In a calm regime (60% of days) the signal is profitable 55% of the time; in a trending regime (30% of days) it wins 70% of the time; in a choppy regime (10% of days) it wins only 20% of the time. What is the overall chance the signal is profitable on a random day?
Let = "signal is profitable" and let the regimes be the partition. Then:
Working the three terms: , then , then . Add them:
So the signal is profitable about 56% of the time overall. Note this sits between the best case (70%) and the worst (20%), pulled toward the calm regime because that case is the most common weight in the average.
Common pitfalls
The cases must be truly disjoint and cover everything, and their probabilities must sum to 1, otherwise you double-count or miss a possibility. And remember it is a weighted average: averaging the conditional probabilities evenly gives the wrong answer.
- Cases that overlap or leave gaps. The law only holds if the are truly disjoint and cover everything. If two cases can both be true, you double-count; if they miss a possibility, you undercount.
- Forgetting the weights. The answer is a weighted average, not a plain one. Averaging evenly would give , which is wrong, because the regimes are not equally likely.
- Weights that don't sum to 1. If your case probabilities add to more or less than 1, you have mis-specified the partition. Check that first.
- Choosing unhelpful cases. The trick is to condition on the very thing you don't know but wish you did. Pick the partition that makes each easy to write down.
This law is the denominator whenever you invert a conditional with Bayes' theorem, and its close cousin for averages, the law of total expectation, does the same job for Expected Value. Both rest on the same partition idea from Conditional Probability.
Practice in interviews
Further reading
- Blitzstein & Hwang, Introduction to Probability, ch. 2
- Ross, A First Course in Probability