Skip to content

Tree diagrams

Probability · level 4, lesson 2 of 6

A question to start

Flip a coin three times. What is the chance of getting exactly two heads?

Here are three answers people often give:

  • "You can get 0, 1, 2 or 3 heads. That is four results, so \(\tfrac14\)."
  • "Two heads out of three flips, so \(\tfrac23\)."
  • "Each flip is a half, so it must be about a half."

None of them is right. The answer is \(\tfrac38\). A tree diagram makes that answer easy to see, and it keeps working when there are too many stages for a table.

The idea

Why we need something new

In lesson 1, a table showed two experiments at once: one down the side, one across the top. But a table has only two directions. Three coin flips would need a table with three directions, a cube of squares, and four flips would need four. We need a picture that can keep growing.

Building a tree

A tree diagram shows an experiment that happens in stages, one after another.

  1. Start at a single point on the left.
  2. Draw one branch for each possible result of the first stage. Write the result at the end of the branch and its probability on the branch.
  3. From the end of every branch, draw branches for the second stage. Then the third, and so on.

Here is the tree for three coin flips. Each flip has two branches, heads (H) and tails (T), each with probability \(\tfrac12\).

1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 H T H T H T H T H T H T H T HHH 1/8 HHT 1/8 HTH 1/8 HTT 1/8 THH 1/8 THT 1/8 TTH 1/8 TTT 1/8 1st flip 2nd flip 3rd flip

Each way of travelling from the start to a tip on the right is called a path. A path is one complete outcome: the top path is H, then H, then H, written \(HHH\). There are 8 tips, because the tree doubles at every stage:

\[2 \times 2 \times 2 = 8\]

That is the same multiplying you did for tables, now done once for each stage.

Probability along a path: multiply

What is the probability of one path, say \(HHT\)?

Think of doing the three flips 800 times.

  • The first flip is H about half the time: 400 times.
  • Of those 400, the second flip is H about half the time: 200 times.
  • Of those 200, the third flip is T about half the time: 100 times.

So \(HHT\) happens about 100 times in 800, which is \(\tfrac18\). Each step kept a fraction of the previous group. Taking a half of a half of a half is

\[\frac12 \times \frac12 \times \frac12 = \frac18\]

This is the first rule of trees: along a path, multiply the probabilities on the branches.

It agrees with counting. All 8 paths have the same probability, \(\tfrac18\), so they are 8 equally likely outcomes, and listing them is just listing the sample space from level 3.

Probability of an event: add the paths

Now the question at the start. Which paths have exactly two heads? They are shaded green: \(HHT\), \(HTH\) and \(THH\). The two heads can be in flips 1 and 2, flips 1 and 3, or flips 2 and 3. So three paths, and each has probability \(\tfrac18\):

\[P(\text{exactly two heads}) = \frac18 + \frac18 + \frac18 = \frac38\]

This is the second rule: for an event, add up the probabilities of all the paths that give it. We can add because the paths never overlap; each time you do the experiment, you travel along exactly one path.

Why were the popular answers wrong?

  • "\(\tfrac14\)" treats 0, 1, 2 and 3 heads as equally likely. They are not: 0 heads is 1 path, 1 head is 3 paths, 2 heads is 3 paths, 3 heads is 1 path. In eighths: \(\tfrac18, \tfrac38, \tfrac38, \tfrac18\).
  • "\(\tfrac23\)" is the fraction of flips that are heads in one particular result; it is not a probability at all.

A check that always works

All the tips together cover every possible result, once each. So the probabilities at the tips add to 1. For three coins: \(8 \times \tfrac18 = 1\). ✓ If your tips do not add to 1, a branch is missing or wrong.

There is a second check at every fork: the branches leaving one point add to 1, because one of them must happen.

Branches that are not equal

Trees really pay off when the branches are not equal. A spinner wins with probability \(\tfrac14\) and loses with probability \(\tfrac34\). It is spun twice.

1/4 3/4 1/4 3/4 1/4 3/4 win lose win lose win lose win, win: 1/16 win, lose: 3/16 lose, win: 3/16 lose, lose: 9/16 1st spin 2nd spin

Multiply along each path:

  • win, win: \(\tfrac14 \times \tfrac14 = \tfrac{1}{16}\)
  • win, lose: \(\tfrac14 \times \tfrac34 = \tfrac{3}{16}\)
  • lose, win: \(\tfrac34 \times \tfrac14 = \tfrac{3}{16}\)
  • lose, lose: \(\tfrac34 \times \tfrac34 = \tfrac{9}{16}\)

Check: \(\tfrac{1 + 3 + 3 + 9}{16} = \tfrac{16}{16} = 1\). ✓ Here the four paths are not equally likely, so simply counting paths would be wrong. Multiplying handles it.

Trees can change shape

A tree does not have to have the same branches everywhere. If the second stage depends on the first, draw different branches. For example: toss a coin; on heads roll a die, on tails spin a spinner with 4 parts. The heads branch then splits into 6, the tails branch into 4. A tree can also stop early on some paths, as in a "best of three" match (worked example 3).

Worked examples

1. More from three flips. Use the tree above.

  • \(P(\text{at least two heads})\): paths with 2 or 3 heads, \(HHT, HTH, THH, HHH\). \(\tfrac48 = \tfrac12\).
  • \(P(\text{all the same})\): \(HHH\) and \(TTT\). \(\tfrac28 = \tfrac14\).
  • \(P(\text{at least one tail})\): every path except \(HHH\). Use the opposite: \(1 - \tfrac18 = \tfrac78\).

2. Exactly one win. In the spinner tree, "exactly one win" is win-lose or lose-win:

\[\frac{3}{16} + \frac{3}{16} = \frac{6}{16} = \frac38\]

A common slip is to stop at \(\tfrac{3}{16}\), forgetting that the win can come first or second.

3. Best of three. Two players, A and B, play games until one has won 2. Each game is won by A with probability \(\tfrac12\). What is the chance the match needs all three games?

Draw the tree, but stop a path as soon as someone has 2 wins:

  • \(AA\): A wins in two games, probability \(\tfrac14\). Stop.
  • \(BB\): B wins in two games, probability \(\tfrac14\). Stop.
  • \(AB\) and \(BA\): 1 win each, so a third game is played. These two paths have \(\tfrac14 + \tfrac14 = \tfrac12\).

So \(P(\text{three games}) = \tfrac12\). (The third game then splits each of those paths in two, giving the tips \(ABA\), \(ABB\), \(BAA\), \(BAB\), each \(\tfrac18\). Check: \(\tfrac14 + \tfrac14 + 4 \times \tfrac18 = 1\). ✓)

4. A bag, with the marble put back. A bag has 2 red marbles and 1 blue. Take one, look, put it back, mix, and take another. Each draw: red \(\tfrac23\), blue \(\tfrac13\).

  • \(P(RR) = \tfrac23 \times \tfrac23 = \tfrac49\)
  • \(P(RB) = \tfrac23 \times \tfrac13 = \tfrac29\), and \(P(BR) = \tfrac29\)
  • \(P(BB) = \tfrac13 \times \tfrac13 = \tfrac19\)

One of each colour: \(\tfrac29 + \tfrac29 = \tfrac49\). Check all tips: \(\tfrac{4 + 2 + 2 + 1}{9} = 1\). ✓

(If the marble is not put back, the second branches change, because the bag has changed. That is the subject of level 5.)

Try it

  1. Draw the tree for two coin flips. What is \(P(HT)\)? What is \(P(\text{one head and one tail})\)?
  2. For three coin flips, find \(P(\text{exactly one head})\) and \(P(\text{no heads})\).
  3. For four coin flips: how many tips does the tree have? How many paths have exactly two heads? What is \(P(\text{exactly two heads})\)?
  4. A spinner lands on red with probability \(\tfrac13\). It is spun twice. Find \(P(\text{two reds})\) and \(P(\text{exactly one red})\).
  5. Toss a coin. On heads, roll a die. On tails, spin a spinner numbered 1 to 4. What is the chance of ending with the number 4?
  6. In a best-of-three match, A wins each game with probability \(\tfrac23\). Find \(P(\text{A wins the match})\).
  7. A friend says: "In three flips, \(P(\text{exactly two heads}) = \tfrac14\), because the number of heads is 0, 1, 2 or 3." Explain to them, using the tree, what is wrong.
Answers
  1. Tips \(HH, HT, TH, TT\), each \(\tfrac12 \times \tfrac12 = \tfrac14\). \(P(HT) = \tfrac14\). One of each: \(HT\) or \(TH\), \(\tfrac14 + \tfrac14 = \tfrac12\).
  2. Exactly one head: \(HTT, THT, TTH\), \(\tfrac38\). No heads: \(TTT\), \(\tfrac18\).
  3. \(2 \times 2 \times 2 \times 2 = 16\) tips. Exactly two heads: \(HHTT, HTHT, HTTH, THHT, THTH, TTHH\), 6 paths. So \(\tfrac{6}{16} = \tfrac38\).
  4. Two reds: \(\tfrac13 \times \tfrac13 = \tfrac19\). Exactly one red: red then not, or not then red: \(\tfrac13 \times \tfrac23 + \tfrac23 \times \tfrac13 = \tfrac29 + \tfrac29 = \tfrac49\).
  5. Heads then 4: \(\tfrac12 \times \tfrac16 = \tfrac{1}{12}\). Tails then 4: \(\tfrac12 \times \tfrac14 = \tfrac18\). Add: \(\tfrac{2}{24} + \tfrac{3}{24} = \tfrac{5}{24}\).
  6. A wins by \(AA\): \(\tfrac23 \times \tfrac23 = \tfrac49 = \tfrac{12}{27}\). By \(ABA\): \(\tfrac23 \times \tfrac13 \times \tfrac23 = \tfrac{4}{27}\). By \(BAA\): \(\tfrac13 \times \tfrac23 \times \tfrac23 = \tfrac{4}{27}\). Total: \(\tfrac{12 + 4 + 4}{27} = \tfrac{20}{27}\), about 0.74. Better than A's chance in a single game (\(\tfrac23\), about 0.67): longer matches favour the stronger player.
  7. The tree has 8 equally likely tips. Exactly two heads is 3 of them (\(HHT\), \(HTH\), \(THH\)), so \(\tfrac38\). The four results 0, 1, 2, 3 heads are not equally likely: they have 1, 3, 3 and 1 paths.

Common mistake

Adding along a path or multiplying across paths. Along one path ("this and then that"), multiply. Across different paths ("this path or that path"), add. Mixing them up gives numbers bigger than 1, or far too small.

Forgetting the other order. "One win and one loss" is two paths, win-lose and lose-win. Look for every path that gives the event, not just the first one you think of.

Where it leads