Law of total probability
Theorem taught in Random experiments and probability, part of Probability
Law of total probability

| Type | Theorem |
| Taught in | Random experiments and probability |
| Part | Probability |
| Worked examples | 3 |
| Questions using it | 1 |
If B_1,\ldots,B_n are disjoint and their union is \Omega, then for every event A
\mathbb{P}(A)=\sum_{i=1}^n \mathbb{P}(A\mid B_i)\,\mathbb{P}(B_i).
The events A\cap B_i are disjoint and exhaust A, so the sum rule applies, and each term is the product rule.
Examples
Three factories
Worked example from Random experiments and probability
A chip is made in factory 1, 2 or 3 with probabilities 0.15, 0.35 and 0.50, and the defective rates are 0.01, 0.05 and 0.02.
Question. A chip in hand is defective. What is the probability that it came from factory 1?
Solution. By Bayes’ rule, the probability it came from factory 1 is
\frac{0.15\times 0.01}{0.15\times 0.01+0.35\times 0.05+0.50\times 0.02}=\frac{0.0015}{0.029}\approx 0.052.
The rare factory is unlikely to be the source, because the two larger factories produce more defectives in total even though each chip from factory 1 is less often defective.
The same calculation gives 0.0175/0.029=0.603 for factory 2 and 0.010/0.029=0.345 for factory 3. The denominator, 0.029, is the overall defective rate, from the law of total probability.
A channel with unequal inputs
Question page: A channel with unequal inputs
A binary channel sends a 1 with probability 1/4 and a 0 with probability 3/4. A sent 1 is received as 1 with probability 0.90, and a sent 0 is received as 0 with probability 0.95.
Find the probability that a 1 is received.
Given that a 1 is received, find the probability that a 1 was sent.
Let S be the symbol sent and R the symbol received.
- By the law of total probability,
\mathbb{P}(R=1)=\mathbb{P}(R=1\mid S=1)\mathbb{P}(S=1)+\mathbb{P}(R=1\mid S=0)\mathbb{P}(S=0)=0.90\times\tfrac14+0.05\times\tfrac34=0.225+0.0375=0.2625.
- By Bayes’ rule,
\mathbb{P}(S=1\mid R=1)=\frac{0.225}{0.2625}=\frac67=0.857.
One received 1 in seven is a corrupted 0, because 0s are sent three times as often.
A zero received
Question page: A zero received
Zeros and ones are sent with equal probability. A sent 0 is received as 0 with probability 0.95, and a sent 1 is received as 1 with probability 0.99. A 0 is received. Find the probability that a 1 was sent.
Let B be the event that a 1 was sent and A the event that a 0 was received. Then \mathbb{P}(A\mid B)=0.01, \mathbb{P}(A\mid B^c)=0.95 and both inputs have probability 1/2, so
\mathbb{P}(B\mid A)=\frac{0.01\times 1/2}{0.01\times 1/2+0.95\times 1/2}=\frac{0.01}{0.96}=\frac{1}{96}.
Used in
- Taught in Random experiments and probability, where the derivation and examples are.
- Also used in Joint distributions
- Questions that use it (1) — A channel with unequal inputs (answer)
- All 17 questions on Random experiments and probability
See also
Product rule · Sample space · Event · Probability measure · Properties of a probability · Equally likely outcomes · Four ways of counting draws · Conditional probability