# Explainer: Tree Diagrams

In this explainer, we will learn how to represent a sample space using a tree diagram.

A tree diagram can be a great way of illustrating all the possible outcomes in an experiment. Each stage of the experiment is represented by a set of branches and each outcome is represented by a branch with its probability attached. The tree diagram of an experiment contains every possible outcome, that is, the sample space.

Before we draw a tree diagram, let us remind ourselves of how to write a sample space, using an example.

### Example 1: Writing a Sample Space

A bag contains 7 balls which are numbered 1 to 7. Determine the sample space of choosing a ball at random.

The sample space consists of all possible outcomes in an experiment. In this case, the experiment is “choosing a ball at random.” The bag we are choosing from contains 7 balls numbered 1 to 7 and the result of choosing a single ball will be a ball with one of these numbers on it. So, the sample space contains each of these seven possible outcomes: one, two, three, four, five, six, and seven, but nothing else.

We usually write a sample space within curly brackets, so in this case the sample space is .

In our next example, we will use a tree diagram to represent the sample space.

### Example 2: The Sample Space on a Tree Diagram

Suppose 60% of single-scoop ice cream from the local ice cream van is sold in a carton and the other 40% is sold in a cone. Suppose also that the ice cream van sells three different flavors of ice cream—chocolate, vanilla, and strawberry—and that 25% of single-scoop sales are chocolate, 45% are vanilla, and 30% are strawberry.

Draw a tree diagram to represent single-scoop ice cream sales from the ice cream van.

We can begin our tree diagram with two branches representing the two types of ice cream container.

We need to add our probabilities to the branches, but first we will convert the percentages to probabilities. If 60% of single-scoop ice cream is sold in cartons, this means the probability for “carton” is . Similarly, if 40% of single-scoop sales is in cones, then the probability of “cone” is . We can put these on the branches in our diagram.

Both the carton and the cone options have 3 possible flavors of ice cream to choose from, so there will be 3 further branches attached to each of the carton and cone branches.

Working out the probabilities for the 3 different flavors, we have

We can now complete our tree diagram by adding the probabilities for the ice cream flavors.

Our tree diagram above represents the sample space for single-scoop ice cream sales. Every possibility is covered by a branch or set of branches; and since there are 2 choices to begin with (carton or cone) and 3 flavors (chocolate, vanilla, or strawberry), there are possible outcomes in total.

In our next example, we will represent a sample space on a tree diagram and use this to calculate a probability.

### Example 3: Sample Space for Flipping a Coin Twice

1. Draw a tree diagram to represent flipping a fair coin twice.
2. Write the sample space and determine the number of possible outcomes.
3. Determine how many outcomes contain a single heads.
4. Find the probability of throwing a single heads in two flips of a fair coin.