Some probability questions involve several different ways an outcome can occur. Instead of treating the situation as a single block, it is often clearer to break it into separate cases and look at how each case contributes to the overall probability.
This idea is closely connected to conditional probability, because each case describes the event "if this situation happens, what is the chance of the outcome?" The law of total probability combines those conditional pieces into one overall value.
This structure also sets the stage for Bayes' theorem. Bayes reverses conditional probabilities, but it relies on the same breakdown of cases that total probability provides. Together, these ideas form one of the main building blocks of probabilistic reasoning.
This reasoning applies whenever a system can be in different states, and each state affects the outcome differently.
When the outcome depends on which case you're in: A diagnostic test's accuracy differs for people who actually have the disease versus those who don't. The overall rate of positive tests depends on both groups.
When data comes from mixed sources: Survey results combine responses from different age groups, regions, or demographics. The overall pattern reflects contributions from each subgroup.
When you don't know the underlying condition: A machine might be operating in good condition or degraded condition. Failure rates differ in each state, but if you don't know which state it's in, you need to consider both possibilities.
When processes have multiple pathways: A delivery can be delayed by weather, traffic, or mechanical failure. Each pathway has its own probability, and the total delay probability accounts for all routes.
The intuition is always the same: the final probability is a weighted blend of case-specific probabilities. Each scenario contributes its piece, weighted by how likely that scenario is to occur in the first place.
Pattern
Characteristic cases
Example domain
Outcome depends on a hidden state
disease present vs absent; machine in good vs degraded condition
diagnostic testing, machine reliability
Data from mixed sources
subgroups with different behavior — age groups, regions, demographics
survey aggregation, population studies
Unknown underlying condition
several possible operating states, each with its own failure rate
equipment monitoring, quality control
Multiple pathways to an outcome
an event can occur through several independent routes, each with its own probability
delivery delays, system failures, route-based risk
Splitting a Probability Across Cases
The key idea: you can divide all possible outcomes into distinct, non-overlapping scenarios. Each scenario contributes part of the final probability.
Think of it like splitting a bill at a restaurant. The total amount comes from adding what each person pays. No overlap — each dollar is counted exactly once.
With probability, the sample space gets partitioned into separate cases. An event might occur in Case 1, Case 2, or Case 3. The event's total probability comes from adding its probability within each case.
The core phenomenon:
overall probability = sum of case-specific contributions
This isn't a formula yet — it's the conceptual structure. You're breaking one probability question into smaller, manageable pieces.
Visual intuition:
Imagine a probability tree where branches split into different scenarios. Or picture blocks of the sample space, each colored differently. The event overlaps multiple blocks, and you add up how much probability it captures from each.
Each case contributes its share, and those shares sum to give the complete picture. That's the phenomenon at the heart of total probability.
A three-way partition and its outcomes
The first level splits the sample space into three cases that cannot overlap and together cover everything; the second level shows how the outcome behaves inside each case. The probability of the outcome is spread across the three branches. Adjust the case probabilities and watch the pieces move on the law of total probability visualizer.
The law states this splitting formally.
Total Probability Notation
Notation
Total Probability Notation
The law's marks are the machinery of splitting: the two conditions that make a family of cases a partition, the sum whose every term is one branch of a tree, and the integral the sum becomes when the cases refine to single values. All of them are catalogued among the probability symbols.
the cases tile the sample space: together they cover it, pairwise they never overlap
The words "disjoint and exhaustive" from Splitting a Probability Across Cases above, written as marks: the enlarged union with index limits collects every case into the whole sample space, and the empty pairwise intersection forbids overlap.
CasesThe overlap condition carries a silent qualifier — Bi∩Bj=∅ holds for every distinct pairi=j — the subscript-pair convention meaning "any two distinct cases"; read without it, the condition would demand Bi∩Bi=∅ and annihilate every case. The big ⋃ is the set world's ∑: same anatomy — running index below, stop above, collecting operator in front.
Do not confuseA mere list. Writing B1,…,Bn only names candidates; the two conditions are what make them a partition — and the law's conclusion silently fails when the cases leak coverage or double-count an outcome.
P(A)=∑iP(A∣Bi)P(Bi)
the probability of A: its chance within each case, times the weight of the case, summed
Each summand is one branch of the probability tree that Diagrammatic Representations below draws: multiply along the branch — the case's weight, then A's chance inside it — and add across branches. Product inside, sum outside: the mark encodes the whole procedure.
CasesWith only a case and its complement the sum shortens to P(A∣B)P(B)+P(A∣Bc)P(Bc); and as Bayes' theorem's denominator the identical expression serves a second career — written there with the letters traded, evidence outside the bar and hypotheses inside.
Do not confuseA letter pattern. Memorizing "P(A) equals a sum over the B's" breaks the moment a source trades letters — the Bayes page writes this same law in mirrored roles; what stays fixed is the grammar: target outside the bar, cases inside it and standing alone as weights.
P(A)=∫P(A∣B=b)f(b)db
the continuous law: condition on each value, weight by density, integrate
The partition refined to infinitely many hairline cases: ∑ becomes ∫, and the case weight P(Bi) becomes a density times db. The capitals inside the condition follow random variable notation: B is the variable, b one of its values.
CasesFor a continuous variable the condition B=b has probability zero, so P(A∣B=b) cannot mean the ratio formula — it is defined by a limiting construction the notation quietly papers over; advanced texts flag the subtlety, elementary ones let the analogy carry it.
Do not confuseA sum with more terms. The integral is not "add up P(A∣B=b)⋅P(B=b)" — every P(B=b) is zero; only density-times-db makes the weights meaningful, which is why f(b) replaces the probability rather than approximating it.
Now we formalize the phenomenon described in the previous sections.
Statement in words:
If an event A can occur through several disjoint cases B₁, B₂, ..., Bₙ that cover the entire sample space, then the probability of A is the sum of its probability within each case, weighted by the probability of that case occurring.
• P(A∣Bi)⋅P(Bi) is the contribution from case i • P(A∣Bi) tells you how likely A is in that case • P(Bi) weights that contribution by how likely the case is • The sum adds all contributions to get the total
Discrete version:
This is the form shown above, used when you have a finite or countable number of cases.
Continuous version (conceptual):
When the partition becomes continuous (like a range of values), the sum becomes an integral:
The Law of Total Probability
P(A)=∫P(A∣B=b)⋅f(b)db
where f(b) is the probability density of the conditioning variable.
This law expresses mathematically what we've already understood conceptually: probability distributes across cases, and the total comes from adding weighted contributions.
Diagrammatic Representations
Total probability becomes clearer when visualized. Here are three ways to see the same idea.
Probability tree:
Start with the root. Branches split into the different cases B1,B2,...,Bn, each labeled with P(Bi). From each case, further branches show whether A occurs or not, labeled with P(A∣Bi) and P(A′∣Bi).
To find P(A), trace all paths that end in A. Multiply along each path, then add across paths. This gives the total probability formula naturally.
Partition block diagram:
Draw the sample space as a rectangle. Divide it vertically into blocks representing B1,B2,...,Bn. The width of each block is proportional to P(Bi).
Now overlay the event A as a horizontal band cutting across all blocks. The area of A within each block represents P(A∩Bi). The total area of A is the sum of these pieces.
Table view (joint distribution):
Create a table with cases as rows and outcomes (A or A′) as columns. Fill in joint probabilities P(A∩Bi) and P(A′∩Bi).
The row totals are P(Bi). The column total for A is P(A) — which equals the sum of P(A∩Bi) down that column. Since P(A∩Bi)=P(A∣Bi)⋅P(Bi), you see the total probability formula in the table structure.
All three diagrams show the same phenomenon: A's probability distributes across cases, and you recover the total by adding contributions.
Event A drawn across a three-compartment partition
The Venn view of the same idea: the partition slices the sample space into compartments, event A cuts across all of them, and the probability of A is the sum of its pieces inside each compartment. The tree and the table show the same sum in other shapes. Select a compartment and read the piece of A inside it on the partition Venn diagram.
Worked examples put numbers on the pieces.
Examples
Example 1: Medical testing
A disease affects 1% of the population. A test is 95% accurate for infected people (true positive rate) and 90% accurate for healthy people (true negative rate, so 10% false positive rate).
A factory has three machines producing parts. Machine A makes 50% of parts with 2% defect rate. Machine B makes 30% with 3% defect rate. Machine C makes 20% with 5% defect rate.
What's the probability a randomly selected part is defective?
Cases: B1= from A, B2= from B, B3= from C
• P(B1)=0.50,P(B2)=0.30,P(B3)=0.20
• P(defective∣B1)=0.02
• P(defective∣B2)=0.03
• P(defective∣B3)=0.05
P(defective)=0.02×0.50+0.03×0.30+0.05×0.20
=0.010+0.009+0.010
=0.029
2.9% of all parts are defective.
Example 3: Weather scenarios
Tomorrow will be sunny, cloudy, or rainy with probabilities 0.6, 0.3, and 0.1. You'll go running with probability 0.8 if sunny, 0.5 if cloudy, and 0.1 if rainy.
What's the probability you go running tomorrow?
Cases: B1= sunny, B2=cloudy, B3= rainy
• P(B1)=0.6,P(B2)=0.3,P(B3)=0.1
• P(run∣B1)=0.8
• P(run∣B2)=0.5
• P(run∣B3)=0.1
P(run)=0.8×0.6+0.5×0.3+0.1×0.1
=0.48+0.15+0.01
=0.64
64% chance you'll go running.
In each example, the total probability emerges from weighted contributions across distinct scenarios.
Example
Cases (Bi)
Weights P(Bi)
Conditionals P(A | Bi)
P(A)
Medical test (positive)
has disease / healthy
0.01 / 0.99
0.95 / 0.10
0.1085
Manufacturing (defective)
machine A / B / C
0.50 / 0.30 / 0.20
0.02 / 0.03 / 0.05
0.029
Weather → running
sunny / cloudy / rainy
0.6 / 0.3 / 0.1
0.8 / 0.5 / 0.1
0.64
Example 3: weighting the cases
The running example. Navy bars: the chance of running in each case, 0.8, 0.5 and 0.1. Amber bars: each one multiplied by the probability of its case, 0.8 × 0.6 = 0.48, 0.5 × 0.3 = 0.15 and 0.1 × 0.1 = 0.01. Stacked, the three contributions give P(run) = 0.64. The rainy case barely counts: a low chance of running in a rare case adds almost nothing.
Averaging the three navy bars without weights, (0.8 + 0.5 + 0.1)/3 ≈ 0.47, gives the wrong answer.
Why the Law Works
The law follows from three fundamental facts about how probability behaves.
Fact 1: Exactly one case occurs
The cases B1,B2,...,Bn partition the sample space. They're disjoint and exhaustive. Every outcome belongs to exactly one case. When you run the experiment, one and only one case happens.
Fact 2: Aoverlaps each case separately
The event A might occur in any of the cases. We can split A into pieces: the part that happens in B1, the part in B2, and so on. These pieces are A∩B1,A∩B2,...,A∩Bn.
Fact 3: Disjoint pieces add
Since the cases don't overlap, the pieces of A don't overlap either. When you have disjoint events, their probabilities add:
Why the Law Works
P(A)=P(A∩B1)+P(A∩B2)+...+P(A∩Bn)
Now use the definition of conditional probability. We know P(A∩Bi)=P(A∣Bi)⋅P(Bi). Substitute this into the sum:
You're not doing anything clever. You're just acknowledging that A happens "in pieces" across the cases, and probability naturally adds across those disjoint pieces. The conditional probabilities weight each piece by how much of A falls in that case. The case probabilities weight by how likely each case is to occur.
It's the simplest possible accounting: count every way A can happen, weight by likelihood, sum the contributions. Nothing more.
The first case highlighted: its contribution to the total
The highlighted branch contributes P(A1) times P(B given A1), the probability of B occurring by way of the first case. Exactly one case occurs, the cases do not overlap and each piece is a product, which is why the pieces simply add. Highlight each case in turn and add the contributions on the law of total probability visualizer.
Conditional probability is the ingredient inside each product.
Connection to Conditional Probability
Total probability is built entirely from conditional probabilities. It shows how an unconditional probability emerges from conditional pieces.
The left side is unconditional — no assumptions about which case occurred. The right side is entirely conditional — every P(A∣Bi) assumes you know the case.
Total probability is the bridge. It reconstructs the unconditional probability from conditional pieces.
Why this matters:
Often, conditional probabilities are easier to know or estimate than unconditional ones. If you can break a problem into cases where each case has clear conditional probabilities, total probability lets you work backward to the overall answer.
Medical testing works this way. You know accuracy rates conditional on disease status. Total probability combines them to find the overall test-positive rate.
Manufacturing works this way. You know defect rates conditional on which machine produced the part. Total probability gives the overall defect rate.
Weather prediction works this way. You know behavior conditional on weather conditions. Total probability gives overall behavior.
Conditional probability is the foundation. Total probability is the mechanism that builds upward from it.
Chain Rule as a Complementary Mechanism
Total probability and the chain rule work together but serve different purposes.
Chain rule: multiply along a path
The chain rule breaks a joint probability into a sequence of conditional steps:
Each term P(A∣Bi)⋅P(Bi) is actually P(A∩Bi) by the chain rule. So total probability is summing P(A∩Bi) across all cases.
How they work together:
• Chain rule: multiply down a single branch of the probability tree • Total probability: add across multiple branches
In a probability tree, you multiply along each path (chain rule) to get that path's probability. Then you add across paths (total probability) to get the overall probability of the endpoint.
Why both matter:
Chain rule builds joint probabilities from conditional pieces. Total probability aggregates those joint probabilities across cases.
Together, they form the computational foundation for Bayes' theorem. Bayes uses the chain rule in the numerator and total probability in the denominator.
Relationship to Bayes' Theorem
Bayes' theorem cannot exist without total probability. They're inseparable.
The numerator uses the chain rule for one specific case. The denominator uses total probability summed across all cases.
Without total probability, you have no way to compute P(A) from the conditional pieces. Bayes would be incomplete.
The conceptual flow:
1. You observe event A 2. You want to know which case Bi caused it (posterior probability) 3. You start with how likely each case is (prior: P(Bi)) 4. You know how likely A is in each case (likelihood: P(A∣Bi)) 5. Chain rule gives the numerator: P(A∣Bi)⋅P(Bi) 6. Total probability normalizes across all cases: ∑P(A∣Bj)⋅P(Bj) 7. The ratio gives the posterior: P(Bi∣A)
Total probability ensures the posteriors sum to 1. It's the normalization constant that makes Bayes work.
Bayes and total probability are two sides of the same reasoning framework. Total probability aggregates forward (from cases to outcome). Bayes inverts backward (from outcome to cases).
Tool
Formula
Operation
Direction
Chain rule
P(A ∩ B) = P(A | B) · P(B)
multiplies along a single path
combines case + outcome into a joint probability
Total probability
P(A) = Σi P(A | Bi) · P(Bi)
adds contributions across all paths
aggregates forward (cases → outcome)
Bayes' theorem
P(Bi | A) = P(A | Bi) · P(Bi) / P(A)
divides one path's contribution by the total
inverts backward (outcome → cases)
Common Mistakes
Using non-disjoint cases
The cases must be mutually exclusive. If B1 and B2 can both occur, you'll double-count probability. Example: splitting by "rain" and "bad weather" overlaps since rain is bad weather.
Fix: ensure cases can't happen simultaneously.
Failing to cover the entire space
Cases must be exhaustive. If your cases don't account for every possibility, you'll underestimate P(A).
Example: dividing a population by "under 30" and "over 40" misses ages 30-40.
Fix: verify cases partition the whole sample space.
Mixing conditional and unconditional probabilities
The formula requires P(A∣Bi), not P(A). Using unconditional probabilities breaks the calculation.
Example: using P(A) directly instead of P(A∣B1), P(A∣B2), etc.
Fix: ensure every term inside the sum is properly conditioned.
Missing cases
Forgetting to include all relevant scenarios leads to incomplete sums.
Example: considering only two machines when a third also produces parts.
Fix: explicitly list all cases before computing.
Misapplying independence assumptions
Assuming P(A∣Bi)=P(A) implies independence, which defeats the purpose of splitting into cases. If A were independent of all cases, total probability would be trivial.
Fix: only use total probability when the outcome depends on which case occurred.
Using wrong weights
The weights must be P(Bi), not P(Bi∣A) or other quantities.
Fix: verify you're using prior probabilities of cases, not posteriors.
Each mistake violates the fundamental structure: a valid partition with properly weighted conditional contributions.
Mistake
What goes wrong
Fix
Non-disjoint cases
overlapping cases cause probability to be counted twice
check that every Bi ∩ Bj = ∅ for i ≠ j
Incomplete partition
missing outcomes lead to an underestimate of P(A)
verify that the union of all Bi covers the whole sample space
Mixing conditional and unconditional
using P(A) where P(A | Bi) is required breaks the formula
every term inside the sum must be a true conditional probability
Missing a case
the sum runs over fewer cases than actually exist
enumerate every Bi explicitly before computing
Misapplied independence
assuming P(A | Bi) = P(A) makes the law trivial
apply the law only when A's probability genuinely varies across cases
Wrong weight
using P(Bi | A) (a posterior) instead of P(Bi) (a prior)
weights are unconditional prior probabilities of the cases
Why Total Probability Matters in Practice
Real-world processes rarely operate under single, uniform conditions. They involve subgroups, states, or scenarios that behave differently.
In data science and machine learning:
Classification algorithms compute P(class | features) using Bayes, which requires P(features) from total probability. Mixture models represent data as coming from multiple sources, each contributing according to total probability. Ensemble methods combine predictions from different models using weighted averages — the same structure as total probability.
In medicine and public health:
Disease prevalence varies across demographics. Treatment effectiveness differs by patient subgroup. Risk assessment requires accounting for multiple pathways to an outcome. Total probability combines these conditional effects to give population-level estimates.
In reliability and engineering:
Systems fail through multiple failure modes. Each mode has its own probability conditional on operating conditions. Total system reliability comes from summing over all failure pathways, weighted by how often each condition occurs.
In finance and risk management:
Investment returns depend on economic states. Default probabilities vary by credit rating and industry. Portfolio risk aggregates conditional risks across different market scenarios. Total probability provides the framework for these calculations.
In forecasting and prediction:
Weather models combine forecasts conditional on different atmospheric patterns. Economic forecasts account for different policy scenarios. Any prediction involving uncertainty about underlying conditions uses total probability implicitly.
The common pattern:
You have data from mixed sources, outcomes that depend on hidden states, or processes with multiple pathways. Direct calculation of overall probabilities is hard. But conditional probabilities within each case are manageable. Total probability bridges from the manageable conditional pieces to the overall answer you need.
Without this framework, you'd be forced to treat heterogeneous systems as if they were uniform. Total probability lets you respect the structure of real-world complexity.
Connections to Other Ideas
Total probability connects to fundamental concepts across probability theory.
Conditional probability: Total probability is built entirely from conditional pieces. It shows how to reconstruct unconditional probabilities from conditional ones.
Chain rule: Each term P(A∣Bi)⋅P(Bi) equals P(A∩Bi) by the chain rule. Total probability sums these joint probabilities across cases.
Bayes' theorem: Bayes uses total probability as its denominator. The normalization constant P(A) comes from summing P(A∣Bi)⋅P(Bi) over all cases.
Partitions: Total probability requires a partition — disjoint, exhaustive cases. Any partition of the sample space enables total probability reasoning.
Mixture distributions: A mixture distribution is a probability distribution formed by combining multiple component distributions, weighted by mixing probabilities. This is exactly the structure of total probability.
Weighted averages: The formula P(A)=∑P(A∣Bi)⋅P(Bi) is a weighted average of conditional probabilities, with weights P(Bi). The overall probability is the expectation of P(A∣B) over the distribution of B.
Joint probability: Total probability decomposes P(A) into pieces P(A∩Bi). It marginalizes over the cases: P(A)=∑P(A∩Bi).
Law of total expectation: The expectation version states E[X]=∑E[X∣Bi]⋅P(Bi). Same structure, different quantity.
Independence: If A is independent of all Bi, then P(A∣Bi)=P(A) for all i, and total probability becomes trivial: P(A)=P(A)⋅∑P(Bi)=P(A). The interesting cases involve dependence.
Total probability sits at the center of a web of interconnected ideas. Master it, and the rest of probability theory becomes clearer.
Total Probability at a Glance
The law of total probability sits at the center of a small constellation of related rules — conditional probability, the chain rule, mixture distributions, and Bayes' theorem — and its formula reappears throughout this page in different guises. The table below collects the most-used facts in one place, with each row pairing an aspect of the law (its formula, its requirements, its meaning, or its role elsewhere) with the symbolic statement that captures it and a brief note on its interpretation or use.
Aspect
Formula or principle
Note
What it computes
P(A)
the unconditional probability of event A
Discrete formula
P(A) = Σi P(A | Bi) · P(Bi)
conditional × weight, summed over the cases
Continuous formula
P(A) = ∫ P(A | B = b) f(b) db
the conditioning variable has density f(b)
Required structure
∪ Bi = Ω, Bi ∩ Bj = ∅ for i ≠ j
cases must be both exhaustive and disjoint
Each term means
P(A | Bi) · P(Bi) = P(A ∩ Bi)
the chain rule converts a term into a joint probability
Equivalent form
P(A) = Σi P(A ∩ Bi)
marginalizing the joint distribution over the partition
Direction
cases → outcome
aggregates conditional pieces forward into the overall probability
Role in Bayes' theorem
denominator of P(Bi | A)
supplies the normalization constant that makes posteriors sum to 1
Statistical interpretation
P(A) = E[P(A | B)]
a weighted average — the expectation of a conditional probability
Typical use
hidden state, mixed source, multiple pathway
apply whenever the outcome depends on which case occurs
Total Probability FAQ
What makes a valid set of cases in total probability?
+
The cases must form a partition: disjoint and exhaustive. Disjoint means no two overlap, so no outcome is counted twice; exhaustive means their union is the whole sample space, so nothing is missed. Simply listing B₁, …, Bₙ names candidates, not a partition — and the law silently returns a wrong answer if the cases leak coverage or double-count.Read more →
How do you know which event goes inside the conditioning bar?
+
Go by the grammar, not the letters. The target — the thing whose probability you want — stands outside the bar in every term. The cases stand inside the bar and also appear alone as the weights. Memorizing “P(A) equals a sum over the B's” breaks as soon as a source trades letters, which Bayes' theorem does routinely.Read more →
How does the law of total probability work for continuous variables?
+
The sum becomes an integral: P(A) = ∫ P(A | B = b) f(b) db. The partition refines to infinitely many hairline cases, and each case's weight becomes a density times db. It is not a sum with more terms — every P(B = b) is zero, so the density replaces the probability rather than approximating it, and the conditional rests on a limiting construction rather than the ratio formula.Read more →
Why does the disjointness condition specify i ≠ j?
+
Because without it the condition would be self-defeating. Bᵢ ∩ Bⱼ = ∅ is meant to say that any two distinct cases never overlap; if i and j were allowed to be equal it would also demand Bᵢ ∩ Bᵢ = ∅, forcing every case to be empty. The subscript-pair convention is doing real work here.Read more →