In this explainer, we will learn how to use tree diagrams to calculate conditional probabilities.
When working out probabilities for more than one event, it can be helpful to illustrate the problem using a tree diagram. These can be particularly useful when we are looking at conditional probabilities. (Recall that the conditional probability of event is the probability of event given that event has occurred and is written as .)
In our first example, we will use a tree diagram to calculate probabilities for selection without replacement.
Example 1: Compound Probability, Taking Two Balls from a Bag without Replacement
A bag contains 22 red balls and 15 black balls. One red ball is removed from the bag and then a second ball is drawn at random. Find the probability that the second ball is black. Give your answer to three significant figures.
To find the probability that the second ball drawn is black, we note that since the second ball is drawn without replacing the first, the probability of the second being black is dependent on what happens in the first selection. And to calculate our second probability, we first need to work out the probability that the first ball selected is red.
To begin, there are 22 red balls and 15 black ones, so there are balls in total. The probability of drawing a red ball from the bag on our first pick is, therefore,
We can draw the first branches in our tree diagram using this information.
Notice that the probabilities, which are on the two branches, add up to 1. This must be true for each set of branches in the tree diagram since, at every stage, all possible outcomes are covered by each set of branches.
Since we are keeping the first ball out of the bag, there is one less ball in the bag in total, so there are now 36 balls in the bag. Of those 36, there is one less red, so 21 red balls remain in the bag.
From each of the first branches, we now have two possible outcomes for our second selection. The second ball could be either red or black. Let us complete our tree diagram with all possible outcomes for the second selection.
The probability that the second ball is black is found by multiplying the probabilities on the branches corresponding to “first ball red” and “second ball black”:
The probability that the second ball drawn is black, having already drawn a red ball, is therefore 0.248. We can say that there is approximately a 25% chance of selecting a red ball and then a black ball (since ).
The probability of drawing a black ball in our second selection is dependent on what we selected first, and in our calculation we have actually used the formula for dependent events:
The probability is the conditional probability of selecting a black ball given that a red ball has already been taken from the bag. the probability that the first ball selected is red. Using the formula, we therefore have
Before looking at some other examples, let us remind ourselves of some of the rules of probability that we will need.
Some Probability Rules and Definitions
For any event , if is the probability of event occurring, we have the following:
Total probability: the sum of the probabilities of all possible outcomes is equal to 1 (or 100%).
The complement of event , written as , refers to everything that is not .
Note: The complement of event is sometimes also written as .
Two events, and , are
- independent if the fact that occurs does not affect the probability of occurring,
- dependent if the fact that occurs does affect the probability of occurring.
For independent events, .
If two events are not independent, however, where is the conditional probability for event , given that event has occurred. If the events and are independent, and
In our next example, we will look at conditional probability applied to the weather, using a tree diagram.
Example 2: Conditional Probability Applied to the Weather Using a Tree Diagram
The probability that it rains on a given day is 0.6. If it rains, the probability that a group of friends play football is 0.2. If it does not rain, the probability that they play football rises to 0.8.
- Work out the probability that it rains on a given day and the friends play football.
- Work out the probability that it does not rain on a given day and the friends play football.
- What is the probability that the friends will play football on a given day?
Since we have a small number of outcomes, Rain/No Rain and Football/No Football, we can easily represent the whole set of outcomes on a tree diagram. The outcomes related to football are dependent on whether or not it rains, so our first set of branches should cover whether or not it rains. We know that the probability of rain is 0.6, so the probability that it does not rain, , is , and we can attach these probabilities to the relevant branches.
The second sets of branches covering football-related outcomes will lead off from these two branches and, as we did for Rain/No Rain, we can work out the probabilities for Football/No Football from the information we have.
We know if it rains the probability the friends play football is 0.2, so the probability of not playing football if it rains is . Similarly, if it does not rain, the probability that they play football is 0.8, so the probability that they do not play football if it does not rain is . With this information, we can fill in the new branches and probabilities on our tree diagram.
Now that we have our tree diagram, we can calculate the required probabilities.
To work out the probability that it rains on a given day and the friends play football, we multiply the probabilities on the branches along the top of the diagram, corresponding to Rain and Football, highlighted below.