Back to the on-screen lesson ·

The law of total probability

Splitting an event by a partition, weighting each case and adding, and why the answer is a weighted average.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

You will compute the probability of an event by splitting the sample space into cases, weighting each case by how likely it is, multiplying by the probability of the event within that case, and adding. You will also check that the cases really partition the space, and use the fact that the answer is a weighted average as a check on it.

2. Two rules, about to be combined

Additivity says disjoint events add. The multiplication rule says a joint probability is a weight times a conditional. Put them together and you get a way of computing the probability of an event you cannot reach directly, by reaching it one case at a time.

3. Words for this lesson

A partition of $\Omega$ is a collection of events that are pairwise disjoint and whose union is everything. Each one is a branch; its weight is its own probability; and its contribution is that weight multiplied by the probability of the event of interest within it. The total is a weighted average of the branch probabilities.

4. Split into cases, weight them, add

Events $B_1, \ldots, B_n$ form a partition when they are pairwise disjoint and their union is $\Omega$. For any event $A$,

$$P(A) = \sum_{i} P(A \mid B_i) \, P(B_i).$$

The proof is two lines. $A$ is the disjoint union of the pieces $A \cap B_i$, so their probabilities add; and each piece is $P(B_i) P(A \mid B_i)$ by the multiplication rule.

The useful reading is that $P(A)$ is a weighted average of the conditional probabilities $P(A \mid B_i)$, with the weights $P(B_i)$. Two consequences follow immediately and are worth more than the formula: the answer always lies between the smallest and the largest branch probability, and it lies nearer the branches that carry more weight.

The commonest mistake is to average the branch probabilities without weighting them, which is the special case where every weight happens to be equal — and in real problems they rarely are.

Another way: picture

A tree with $n$ branches at the first fork. Each branch carries its weight; along each branch the event either happens or does not. The probability of the event is the total weight of all the routes that reach it, and every route is a weight times a conditional.

Another way: steps

  1. Name the cases, and check they are disjoint and cover everything.
  2. Write the weight of each case.
  3. Write the probability of the event within each case.
  4. Multiply the pairs, add the products.
  5. Check the answer lies between the smallest and largest branch probability.

5. A weighted average, laid out

Three suppliers of one part.

SupplierShareFault rateContribution
A0.50.020.010
B0.30.050.015
C0.20.100.020
Total1.00.045

The overall rate, $0.045$, lies between $0.02$ and $0.10$, as it must. The unweighted average of the three rates is $0.057$ — a different number, and the answer to no question anyone asked. The shares column adding to one is the check that the cases really do partition the parts.

6. Where this goes wrong

Averaging the branch probabilities. That is the answer only when the weights are equal. Otherwise it can be badly out, and in the direction of whichever branch is rarest.

Using cases that overlap. An outcome in two branches is counted twice, and the total can exceed one.

Using cases that leave something out. Some of the probability is never accounted for, and the total comes out too small.

Weighting by the wrong thing. The weight is $P(B_i)$, how likely the case is — not how many cases there are, and not the conditional probability itself.

7. Two urns

  1. Urn I holds $3$ red and $7$ white; urn II holds $6$ red and $4$ white. An urn is chosen by a fair coin, then a ball is drawn.

    The partition is which urn.

  2. $P(\text{red}) = 0.5 \times 0.3 + 0.5 \times 0.6$.

    Weight, conditional, weight, conditional.

  3. $= 0.45$, which lies between $0.3$ and $0.6$ as it must.

    Here the weights are equal, so it is the plain average.

8. The same urns, chosen unequally

  1. Now urn I is chosen nine times in ten.

    Only the weights change.

  2. $P(\text{red}) = 0.9 \times 0.3 + 0.1 \times 0.6 = 0.33$.

    Same conditionals, different answer.

  3. It is much nearer $0.3$, because that branch now carries almost all the weight.

    This is what unweighted averaging would have missed.

9. Your turn: a coin is fair with probability $0.8$ and two-headed with probability $0.2$; find the probability of heads on one toss

  1. The partition is which coin it is: weights $0.8$ and $0.2$.

    Name the cases first.

  2. Within each case: heads with probability $0.5$ and with probability $1$.

    The conditionals.

  3. Your turn: work this step out. Its working is at the end of the packet.

    So $0.8 \times 0.5 + 0.2 \times 1 = 0.6$, between $0.5$ and $1$.

10. Guided practice

A workshop has two machines. The first makes $60\%$ of the output and $30\%$ of what it makes is faulty; the second makes the other $40\%$ and $70\%$ of what it makes is faulty. Give the two contributions and the overall fault rate.

Probability
From the first machine and faulty
From the second machine and faulty
Faulty overall

11. Guided practice

Three suppliers provide a part. The first supplies half of it and $30\%$ of its parts fail; the second supplies three tenths with $50\%$ failing; the third supplies the remaining fifth with $90\%$ failing. What fraction of all parts fail?

Answer:

12. Practice

Put the steps of a law-of-total-probability calculation into the order they have to be done in.

Number the steps in order (write the number in the box):

13. Practice

A quarter of the letters posted in a town go by the fast service, which is late $30\%$ of the time; the rest go by the slow service, which is late $80\%$ of the time. Give each service's contribution to the overall lateness.

Fast service: p. Slow service: q.

14. Somewhere new

A factory runs two lines. The first makes $80\%$ of the output with a fault rate of $3/10$; the second makes the rest with a fault rate of $9/10$. The marks are one hundredth apart. Put the marker at the overall fault rate.

0 |——————————| 1

Mark the position with a cross, then write the value:

15. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

16. Test question

One roll of a fair die. Do these events partition the sample space: the roll is at most two, and the roll is at least five?

17. What you can do now

You can name a partition, weight its cases, and add the contributions to get an overall probability. Say in your own words why the answer must lie between the smallest and the largest of the branch probabilities.

Working for the steps left to you

9. Your turn: a coin is fair with probability $0.8$ and two-headed with probability $0.2$; find the probability of heads on one toss, step 3