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.

### Answer

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.

### Answer

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

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

### Answer

**Part 1**

To draw the tree diagram, we first note that when flipping a fair coin there are two possible outcomes, heads and tails. To represent our first flip of the coin, we will need one branch for each of these outcomes.

The top branch represents the coin landing with heads facing up and the bottom branch represents tails facing up. (We will fill in the probabilities later when we have all our branches in place.) If our coin landed heads up on the first throw, on our second throw we have the same possible outcomes as before: either heads or tails. So from the “heads” branch of the first throw we need 2 more branches for the outcomes of the second throw.

If we got tails on out first throw, for our second throw we again have two possible outcomes: heads and tails. And each of these needs a branch.