The Law of Total Probability
Suppose a factory receives components from three suppliers, each with a different defect rate. The components are mixed together on the same shelf. A quality engineer picks one component at random. A natural question follows: what is the overall probability it is defective? No single supplier's defect rate answers this. The answer depends on how the suppliers' contributions blend together. The Law of Total Probability is the precise tool for this kind of blending. It computes an unconditional ("marginal") probability by weighting conditional probabilities. This weighting happens across all the distinct scenarios that could have occurred. This idea matters because most real probabilities are not handed to us directly. They are hidden behind a mixture of causes, sources, or conditions. Medical tests are read differently depending on whether a patient truly has a disease. Insurance claims behave differently depending on the policyholder's risk class. A signal received over a noisy channel depends on which symbol was actually sent. In every case, the sample space naturally splits into disjoint pieces. The law tells us how to reassemble the whole picture from the conditional pieces using the Multiplication Rule. The big picture is one of divide, weight, and sum. Partition the sample space into mutually exclusive and exhaustive events. Compute the probability of the event of interest within each piece. Weight each conditional probability by the chance of being in that piece, and add. This is the probabilistic analogue of computing a weighted average. It is the single most-used identity for turning conditional information into unconditional answers. This article gives the formal definition of a partition. It states and rigorously proves the Law of Total Probability. This includes the case of a countably infinite partition. It works through two asymmetric numerical examples. It shows exactly what fails without the exhaustiveness and disjointness hypotheses. It previews how this very identity becomes the denominator engine driving Bayes' Theorem.
- A partition of the sample space is a collection of pairwise disjoint events whose union is the whole space.
- The Law of Total Probability computes by summing over the partition.
- It generalizes "weighted average": each conditional probability is weighted by how likely its scenario is.
- It relies on the Multiplication Rule applied piece-by-piece, then finite (or countable) additivity.
- It works for finite or countably infinite partitions, but requires every to have where it's used.
- Key idea: split the sample space into disjoint, exhaustive scenarios and reassemble the total probability as a probability-weighted average of conditional probabilities.
Where this lives today
In statistics, the Law of Total Probability underlies computing marginal distributions from joint or conditional models, such as mixture models where a population is partitioned into latent subgroups (clusters, risk classes) with different conditional behavior. In medical diagnostics and epidemiology, it computes the overall prevalence of a condition or the overall sensitivity of a screening protocol across demographic strata, and is the direct setup for the denominator in Bayes' Theorem when inverting test results into diagnoses. In computer science and information theory, it underlies channel capacity computations, where the average error probability over transmitted symbols is a partition-weighted sum of per-symbol error probabilities. In actuarial science and insurance, total claim probabilities are computed by partitioning policyholders into risk classes, weighting each class's claim probability by its share of the portfolio. In cryptography and randomized algorithms, total probability arguments bound the overall success or failure probability of an algorithm by conditioning on which random branch or key was used. In physics and engineering reliability, it computes overall failure probabilities of systems partitioned by which component or failure mode is triggered, feeding directly into fault-tree analysis.
Ask the tutor: How does the Law of Total Probability turn into the denominator of Bayes' Theorem when we want to invert conditional probabilities?
Let be a probability space. A collection of events (finite or countably infinite) is a partition of if: 1. Pairwise disjoint: for all ; 2. Exhaustive: ; 3. Each (measurable), and (for the conditioning statement below) . For any event , the Law of Total Probability states
Intuition
Picture the sample space as a rectangular region cut into disjoint vertical strips , each strip representing one "scenario" — say, which of three machines produced a randomly chosen item. The event (say, "the item is defective") is some blob overlapping several strips. Within each strip, the fraction of that strip covered by is the conditional probability . The width of the strip is . The total area covered by — which is — is obtained by adding up, strip by strip, the area of within that strip, and area within a strip is exactly (fraction covered) (strip width). That is precisely . This is why the law can be read as a weighted average: is a convex combination of the conditional probabilities , with weights that sum to 1. If one supplier dominates production, its defect rate dominates the overall rate; if all suppliers contribute equally, the overall rate is a simple average of the three defect rates.
Let be a probability space and let , with finite or countably infinite, be a partition of such that for every . Then for any event ,
We use countable additivity of (an axiom of a probability measure) together with the Multiplication Rule, whenever .
Step 1 — Decompose into disjoint pieces. Since is exhaustive, , and therefore
using distributivity of intersection over union, which holds for arbitrary (finite or countable) unions.
Step 2 — The pieces are pairwise disjoint. For , since (the are pairwise disjoint by hypothesis),
So is a countable (or finite) collection of pairwise disjoint events.
Step 3 — Apply countable additivity. Each because is a -algebra closed under finite intersections, and . By countable additivity of the probability measure (which subsumes finite additivity when is finite, by appending empty sets),
Step 4 — Apply the Multiplication Rule to each term. Since for every , the conditional probability is well-defined, and rearranging gives
This is exactly the Multiplication Rule applied to the pair of events and .
Step 5 — Combine. Substituting the result of Step 4 into the sum from Step 3,
This is precisely the claimed identity. When is countably infinite, the series on the right converges (absolutely, since all terms are nonnegative and the partial sums are bounded above by ), so the equality is between a well-defined convergent series and ; no additional convergence hypothesis is needed.
∎For any event with , and any event ,
This is the special case , , , since is always a partition of .
Worked examples
Example 1 — Mixed supplier shipment (finite partition, asymmetric weights). A warehouse stocks resistors from three suppliers. Supplier provides 50% of stock with a 4% defect rate; supplier provides 30% of stock with a 7% defect rate; supplier provides the remaining 20% with a 1% defect rate. A resistor is chosen uniformly at random from the warehouse. Let be the event it is defective. The events (which supplier the resistor came from) form a partition: they are mutually exclusive (a resistor has exactly one supplier) and exhaustive (). We are given
By the Law of Total Probability,
Compute each term: ; ; . Summing,
So 4.3% of the warehouse's resistors are defective overall — a figure strictly between the extremes (1% and 7%) as it must be, since it is a weighted average, but skewed toward Supplier 's 4% because that supplier contributes the largest share.
Example 2 — A countably infinite partition (geometric number of trials). A machine attempts to complete a task repeatedly; on each attempt it succeeds independently with probability . Let be the attempt number on which the first success occurs, so is geometric on with
This gives a countably infinite partition of the sample space, : exactly one value of occurs, so the are disjoint, and (a standard geometric series check: ), so they are exhaustive. Suppose that once the machine finally succeeds on attempt , it then produces a usable output with probability (later successes are "rustier," modeling wear), i.e. , where is the event of a usable output. We want , the overall (marginal) probability the eventual output is usable. By the Law of Total Probability (countable partition case),
Write . Then
Reindex with (so , runs from to ):
Recall the Taylor series for , so . With :
Then
Finally,
So despite each individual conditional probability shrinking toward 0, the overall probability of a usable output is about 30.9%, dominated by the early terms ( contributes , already about half the total) because early successes are by far the most likely outcomes under the geometric distribution.
Consider a single fair die roll, , each outcome equally likely with probability . Let be the event "the roll is even," so . Now define and . These are pairwise disjoint, but they are not exhaustive: , since and are missing. Compute the (incorrect) sum anyway:
So the naive sum gives
but the true value is . The discrepancy is exactly the missing mass: outcomes and (probability combined) include the even outcome , which was never accounted for. Without exhaustiveness, the decomposition in Step 1 of the proof fails — is left out entirely — so the additivity argument no longer computes all of . This shows the exhaustiveness hypothesis is not a technicality: remove it, and the formula silently undercounts.
Scope, edge cases & common traps
| Situation | What happens | Correct handling |
|---|---|---|
| Some | undefined | Drop such from the sum, or define by convention (measure-theoretic extension) |
| Countably infinite partition | Series may need care | Terms are nonnegative, so the sum is well-defined (possibly as a convergent series); no rearrangement issues arise |
| Partition not exhaustive | Formula undercounts | Verify before applying the law |
| Partition not disjoint | Double-counts overlapping probability | Verify pairwise disjointness; refine the partition if events overlap |
| Conditioning event chosen after seeing | Reversed conditioning needed | Use Bayes' Theorem to invert from |
The mathematician behind it
Origins · 1 minAndrey Nikolaevich Kolmogorov and how this was discovered
Kolmogorov gave probability theory its modern axiomatic foundation in his 1933 monograph Grundbegriffe der Wahrscheinlichkeitsrechnung, grounding it in measure theory. The Law of Total Probability, as a direct consequence of countable additivity and conditional probability, is a natural corollary of his axioms rather than a separately postulated rule — it exists because probability is a measure, and measures add over disjoint pieces. Kolmogorov's framework unified decades of informal reasoning about partitions and cases (used implicitly by Bayes, Laplace, and others) into a single rigorous calculus.
Why do we need the events to have ?
Conditional probability is only defined when the denominator is nonzero; dividing by zero is meaningless. If some has probability zero, it simply cannot contribute a well-defined conditional term, but this causes no real loss: the event has zero chance of occurring, so means the term , if assigned the value by convention, contributes nothing to the sum regardless of what "would be." In practice, one simply restricts the sum to those with strictly positive probability, and the identity remains exactly correct.
Is the Law of Total Probability the same as computing an expected value?
Yes, in a precise sense: if is the indicator random variable of (equal to 1 if occurs, 0 otherwise), then , and the Law of Total Probability is exactly the statement that , which is itself a special case of the general Law of Total Expectation (also called the tower property). So total probability is the indicator-random-variable instance of a much more general averaging principle used throughout probability theory.
Does the law require the partition to be finite?
No. As proven above, the law holds equally for a countably infinite partition , as long as countable additivity of the probability measure is invoked (which is one of Kolmogorov's axioms). The only subtlety is that the resulting sum is an infinite series rather than a finite sum, but since every term is nonnegative and the partial sums never exceed , the series always converges — there is no risk of divergence or conditional-convergence subtleties.
How does this relate to Bayes' Theorem?
The Law of Total Probability typically supplies the denominator in Bayes' Theorem. Bayes' rule computes , and since itself is rarely given directly, it is computed via the Law of Total Probability as . In this sense, total probability is the essential preprocessing step that makes Bayesian inversion computable from conditional data alone, without needing to separately measure the marginal probability of the evidence.
Can I apply the law with overlapping (non-disjoint) events?
Not directly — the theorem as stated requires pairwise disjointness, because the proof relies on additivity over disjoint pieces. If your candidate events overlap, applying the sum formula will overcount the intersection's probability. The fix is to refine the collection into genuinely disjoint atoms (for instance, using inclusion–exclusion, or by intersecting overlapping events with their complements to build a proper partition) before applying the law.
What's a common real-world pitfall when setting up the partition?
The most frequent error is choosing "cases" that feel natural (e.g., age brackets, weather categories, machine types) without verifying that every possible outcome falls into exactly one category. Boundary outcomes are often missed (an age exactly at a cutoff, a "cloudy" day that is neither clearly "rain" nor "sun") or double-counted. Before summing, always check numerically that the chosen probabilities of the actually add to 1, which catches most partition errors immediately.
Does the Law of Total Probability tell us anything about independence?
Not directly, but it interacts cleanly with independence: if is independent of the partition (i.e., for every ), the law reduces to the trivial identity . The interesting, informative cases are precisely when genuinely varies across , which is exactly the situation in the worked examples above — different suppliers or different attempt numbers give meaningfully different conditional probabilities.