The Theorem of Total Probability: From Intuition to Formula
Imagine you want to know the probability that a randomly selected student owns a bicycle. You don't have a direct number, but you do know the school is divided into three houses — Red, Blue, and Green — and you know the bicycle ownership rate within each house. How would you combine that information?
You'd reason: first pick a house at random, then within that house check for bicycle ownership. The overall probability is a weighted average of the house-specific probabilities, where the weights are the probabilities of being in each house. That's the core idea of the Theorem of Total Probability.
The Setup
We have a sample space S (all possible outcomes). Suppose S is partitioned into n mutually exclusive and exhaustive events A1,A2,…,An. "Mutually exclusive" means no two overlap — a student belongs to exactly one house. "Exhaustive" means together they cover the whole space — every student is in some house.
Now let B be any other event in the same sample space — say, "owns a bicycle." We want P(B).
The Intuition
Since the Ai's cover everything, B can be split into pieces: B happens partly when A1 happens, partly when A2 happens, and so on. Formally:
B=(B∩A1)∪(B∩A2)∪⋯∪(B∩An)
Because the Ai's are disjoint, these intersections are also disjoint. So the probability of B is just the sum of the probabilities of these pieces:
P(B)=P(B∩A1)+P(B∩A2)+⋯+P(B∩An)
Now recall the multiplication rule: P(B∩Ai)=P(Ai)⋅P(B∣Ai). Substituting gives:
P(B)=P(A1)P(B∣A1)+P(A2)P(B∣A2)+⋯+P(An)P(B∣An)
That's the theorem.
Theorem of Total Probability
P(B)=∑i=1nP(Ai)P(B∣Ai)
where {A1,A2,…,An} is a partition of the sample space.
Why It Matters
The theorem lets you compute an "overall" probability when you only know probabilities conditioned on different scenarios. It's the bridge between conditional probabilities and unconditional ones.
Think of it as a weighted average: each P(B∣Ai) is weighted by P(Ai), the chance of being in that scenario.
A Concrete Example
A factory has two machines. Machine I produces 60% of the output, Machine II produces 40%. Machine I has a 2% defect rate, Machine II has a 5% defect rate. What's the overall defect rate?
Here A1 = "item from Machine I", A2 = "item from Machine II". B = "item is defective".
P(B)=P(A1)P(B∣A1)+P(A2)P(B∣A2)
P(B)=(0.60)(0.02)+(0.40)(0.05)=0.012+0.020=0.032
So 3.2% of all items are defective. Notice how we never needed to inspect every item — we just combined the machine-specific rates.
A common mistake is to forget that the Ai's must form a partition — they must be mutually exclusive and cover all possibilities. If some outcome falls outside all Ai, the formula fails.
The Big Picture
The Theorem of Total Probability is not a standalone trick — it's the foundation for Bayes' Theorem, which lets you reverse the conditioning: given that B occurred, what's the probability it came from a particular Ai? That's how spam filters learn, how medical tests are interpreted, and how evidence is weighed in court.
But first: master the weighted-average idea. Whenever you see a probability that depends on which "case" you're in, and you know the probabilities of those cases, the Theorem of Total Probability is your tool.