Quant Memo
Foundational

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 AA is hard to reason about directly, you split the world into a handful of separate cases, work out how likely AA 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, B1,B2,,BnB_1, B_2, \dots, B_n, 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 AA then happens by happening inside one of those cases. So the total chance of AA is just the chance of AA within each case, added up and scaled by how often each case occurs.

P(A)=i=1nP(Bi)P(ABi).P(A) = \sum_{i=1}^{n} P(B_i)\,P(A \mid B_i) .

Symbol by symbol: P(Bi)P(B_i) is how likely case ii is; P(ABi)P(A \mid B_i) is how likely AA is if you are in case ii (a Conditional Probability); and the sum i\sum_i runs over every case. Because the cases are disjoint and exhaustive, their probabilities satisfy P(B1)++P(Bn)=1P(B_1) + \dots + P(B_n) = 1, 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, P(A)=iP(Bi)P(ABi)P(A) = \sum_i P(B_i)\,P(A \mid B_i).

P(B1) P(B2) P(B3) B1 B2 B3 P(A|B1) P(A|B2) P(A|B3) A A A P(A) = P(B1)P(A|B1) + P(B2)P(A|B2) + P(B3)P(A|B3)
The three cases carve up the whole world; collect A across every branch, each weighted by its case, to recover the total probability of A.

Why it works

Because the cases never overlap, the ways of "AA and B1B_1," "AA and B2B_2," and so on are separate slices with no double-counting, so their probabilities simply add: P(A)=iP(ABi)P(A) = \sum_i P(A \cap B_i). Then rewrite each slice with the multiplication rule, P(ABi)=P(Bi)P(ABi)P(A \cap B_i) = P(B_i)\,P(A \mid B_i), 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 AA = "signal is profitable" and let the regimes be the partition. Then:

P(A)=(0.60)(0.55)+(0.30)(0.70)+(0.10)(0.20).P(A) = (0.60)(0.55) + (0.30)(0.70) + (0.10)(0.20) .

Working the three terms: 0.60×0.55=0.330.60 \times 0.55 = 0.33, then 0.30×0.70=0.210.30 \times 0.70 = 0.21, then 0.10×0.20=0.020.10 \times 0.20 = 0.02. Add them:

P(A)=0.33+0.21+0.02=0.56.P(A) = 0.33 + 0.21 + 0.02 = 0.56 .

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 BiB_i 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 0.55,0.70,0.200.55, 0.70, 0.20 evenly would give 0.480.48, 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 P(ABi)P(A \mid B_i) 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.

Related concepts

Practice in interviews

Further reading

  • Blitzstein & Hwang, Introduction to Probability, ch. 2
  • Ross, A First Course in Probability
ShareTwitterLinkedIn