Lesson Explainer: Conditional Probability: Tree Diagrams | Nagwa Lesson Explainer: Conditional Probability: Tree Diagrams | Nagwa

Lesson Explainer: Conditional Probability: Tree Diagrams Mathematics

In this explainer, we will learn how to use tree diagrams to calculate conditional probabilities.

When working with conditional probabilities, it is helpful to use a tree diagram to illustrate the probability of the different outcomes. To help us understand how tree diagrams are used, let’s first recall the formula for conditional probability.

Definition: Conditional Probability

The probability that an event 𝐡 occurs, given that event 𝐴 has already occurred, is 𝑃(𝐡∣𝐴)=𝑃(𝐴∩𝐡)𝑃(𝐴), where 𝑃(𝐡∣𝐴) is the probability of 𝐡 given that 𝐴 occurs, 𝑃(𝐴∩𝐡)is the probability of 𝐴 and 𝐡 occurring at the same time, and 𝑃(𝐴) is the probability of 𝐴 occurring.

We can rewrite the formula above by multiplying both sides by 𝑃(𝐴), giving us 𝑃(𝐴∩𝐡)=𝑃(𝐡∣𝐴)𝑃(𝐴).

We can use this form of the formula to determine the probability of the intersection of two events. On a tree diagram, it can be calculated by multiplying across branches, with the first branch representing the probability of 𝐴 and the second branch representing the probability of 𝐡, given that 𝐴 has occurred, as shown below.

We can use our knowledge of the rules of probability to build on our understanding of tree diagrams. Let’s recall some of the rules of probability first.

Definition: Simple Rules of Probability

For any event 𝐴, if 𝑃(𝐴) is the probability of event 𝐴 occurring, we have the following:

  • The probability of event 𝐴 occurring is given by 𝑃(𝐴)=𝑛(𝐴)𝑛(𝑆), where 𝑛(𝐴) is the number of elements in event 𝐴 and 𝑛(𝑆) is the number of elements in the sample space 𝑆.
  • All probabilities lie in the interval [0,1], or 0≀𝑃(𝐴)≀1.
  • 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 𝐴, and 𝑃(𝐴)=1βˆ’π‘ƒ(𝐴).

Note

The complement of event 𝐴 is sometimes also written as 𝐴.

Using these rules of probability, we can apply them to a tree diagram. In a tree diagram, each set of branches must add up to 1, since the probabilities of all possible outcomes add up to 1. As such, if we have two outcomes of an event, with the first branch of the pair being the probability of 𝐴, then the second branch of the pair must be the probability of 𝐴, the complement of 𝐴. Similarly, if we have the probability of 𝐡 given that 𝐴 has occurred as one of the pair of branches, then the other branch must be the probability of 𝐡 given that 𝐴 has occurred. Further, if we have the probability of 𝐡 given that 𝐴 has occurred as one of the pair of branches, then the other branch must be the probability of 𝐡 given that 𝐴 has occurred. We can illustrate this also on the following tree diagram.

As the tree diagram above has only pairs of branches, then we can use the complement to find the other branch. However, if there are three or more sets of branches, then this will not be the case.

Let’s explore how to use a tree diagram to find a conditional probability in the first example.

Example 1: Finding a Conditional Probability on a Tree Diagram

A bag contains 3 blue balls and 7 red balls. Fares selects 2 balls without replacement and draws the following tree diagram.

Given that the first ball is red, find the value of π‘₯ that represents the probability that the second ball selected is red.

Answer

We are told from the question that two balls are selected without replacement. This means that the colour of the second ball is dependent on the colour of the first ball. As such, we need to consider what the outcome of the first event is when calculating the probability of the outcome in the second event.

As we are required to find the value of π‘₯, which represents the probability that the second ball selected is red given that the first ball selected is red, then we need to use the information that a red ball is first selected to determine π‘₯.

At the start, there are 3 blue balls and 7 red balls. If a red ball is selected first, then there will be 6 red balls in the bag now, but the number of blue balls remains unchanged. So, the probability that the second ball will be red is calculated by taking the number of red balls in the bag after a red ball (6) is selected and dividing it by the total number of balls after a red ball is selected (9), as follows: 𝑃(∣)==69=23.secondballisredfirstballisrednumberofredballsafteraredballisselectedtotalnumberofballsafteraredballisselected

As we are told in the problem that the probability of the second ball being blue given that the first ball is red is 39, then we can use the fact that sets of branches must add up to 1 as a way of checking our answer. As 23+39=23+13=1, then we can say that this is correct.

Therefore, the probability that the second ball is red given that the first ball is red is 23.

In the next example, we will discuss how to draw a tree diagram in order to find the probability of a conditional event.

Example 2: Calculating Conditional Probability without Replacement

A Bag contains 22 red balls and 15 black balls. Two balls are drawn without replacement at random. Find the probability that the second ball is black given that the first ball is red. Give your answer in its simplest form.

Answer

We can see from the question that it concerns two events of balls being selected from a bag. As such, it is helpful to use a tree diagram to illustrate this.

As the two balls are being selected either simultaneously or one after another, then we can treat these events as two consecutive events. So, the first set of branches will have two outcomes: red ball and black ball, to represent the first ball, and the second set of branches will have the same outcomes but will represent the second ball, as seen below.

As the first ball and the second ball are drawn at the same time, then we can assume that they are selected without replacement. This means that once the first ball is selected, it is not put back in the bag, and this changes the total number of balls in the bag, as well as the number of each colour. Therefore, we must consider the outcome of the first ball when calculating the probability of the outcome of the second ball.

We will start calculating the probabilities of the outcomes of the first ball. As there are 22 red balls and 15 black balls, then there are 37 balls in total. For the probability of selecting a red ball, we can use the simple rule for probability: 𝑃()==2237.rednumberofredballstotalnumberofballs

Similarly, the probability of selecting a black ball is 𝑃()==1537.blacknumberofblackballstotalnumberofballs

We can now add this information onto the first branches of the tree diagram as follows.

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.

Next, we will determine the probabilities of the outcomes of the second ball. To do this, we must consider what the first outcome was in order to adjust the number of balls of each colour, as well as the total number of balls.

If the first ball was red, then that means there is one fewer red ball in the bag when the second ball is selected. This means that there are now 21 red balls; however, the number of black balls, 15, remains unchanged. This also means that the total number of balls is now 21+15=36.

The probability that the second ball is red, given that the first is red, is the number of red balls in the bag (21 now) divided by the total (now 36): 𝑃(∣)=2136.secondredfirstred

Similarly, the probability that the second ball is black, given that the first is red, is the number of black balls in the bag (still 15) divided by the total (now 36): 𝑃(∣)=1536.secondblackfirstred

Therefore, we have found that the probability that the second ball is black, given that the first ball is red, is 1536, as the question requires.

Note

We can check our answer by using the fact that the set of two branches add up to one, as seen below on the tree diagram.

In the next example, we will discuss how to find probabilities of events when given conditional probabilities by using a tree diagram.

Example 3: 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.

  1. Work out the probability that it rains on a given day and the friends play football.
  2. Work out the probability that it does not rain on a given day and the friends play football.
  3. What is the probability that the friends will play football on a given day?

Answer

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, 𝑃rain, is 1βˆ’π‘ƒ()=1βˆ’0.6=0.4rain, 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 that if it rains, the probability that the friends play football is 0.2, so the probability of not playing football if it rains is 1βˆ’0.2=0.8. 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 1βˆ’0.8=0.2. 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.

Part 1

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.

The probability that it rains and the friends play football is, therefore, 𝑃(∩)=𝑃()×𝑃(∣)=0.6Γ—0.2=0.12.rainfootballrainfootballrain

Part 2

To work out the probability that it does not rain on a given day and the friends play football, we multiply the probability on the branch for no rain, with the probability of football on the branch leading from no rain.

The probability that it does not rain on a given day and the friends play football is therefore 0.32. That is, there is a 32% chance that it will not rain and the friends will play football.

Part 3

To find the probability that the friends will play football on a given day, we must consider every combined outcome where the result is β€œplaying football.” This means adding the probability that it rains and they play football to the probability that it does not rain and they play football.

The probability that the friends play football on a given day is, therefore, 𝑃()=𝑃(∩)+𝑃(∩)=0.12+0.32=0.44.footballrainfootballnorainfootball

We can say that there is a 44% chance that the friends will play football on any given day.

Note

The sum of the probabilities for every possible outcome, combined, is equal to 1. This should always be the case.

In the following example, we will discuss situations where a β€œfalse positive” may occur and how to use a tree diagram to calculate this.

Example 4: Conditional Probabilities, Tree Diagrams, and False Positives

It is a little-known fact that drugs have been used to enhance performance in sports since the original Olympic Games (776 to 393 BC). In fact, the origin of the word doping is thought to come from the Dutch word doop, which is a type of opium juice used by the ancient Greeks.

Drug testing has become standard practice. In 2003, after anonymous testing of almost 1β€Žβ€‰β€Ž500 players, the Major League Baseball (MLB) announced that approximately 6% of MLB players used performance-enhancing drugs. They got this result taking into account that there was a 5% chance that those who had not taken drugs tested positive (false positive effect) and a 10% chance that those who had taken drugs tested negative (false negative effect).

  1. Find the probability that an MLB player chosen at random had not taken drugs and tested positive. Round your answer to three decimal places if necessary.
  2. Find the probability that an MLB player chosen at random had taken drugs and tested positive. Round your answer to three decimal places if necessary.
  3. Find the probability that an MLB player chosen at random had positive test results. Round your answer to three decimal places if necessary.

Answer

Our situation is that an MLB player chosen at random had either taken drugs or had not taken drugs and that, either way, they were given a drug test with either positive or negative results. Our first step is to draw a tree diagram using the information we have. We can then use this to work out the required probabilities.

The first branches illustrate the outcomes β€œDrugs” and β€œNo drugs,” that is, whether an MLB player took drugs or not. We know that approximately 6% of MLB players took drugs, so the probability that an MLB player did not take drugs is 0.94 (since 6%=0.06 as a probability and 1βˆ’0.06=0.94).

Our next step is to add branches to each of the outcomes, no drugs and drugs, for the test results, which were either positive or negative.

Since the probability of a false positive was 0.05 (5%), that is, it was known that no drugs had been taken but the test was positive anyway, the probability of testing negative when no drugs had been taken was 1βˆ’0.05=0.95. These two probabilities (0.05 and 0.95) have been placed on the tree diagram next to the relevant branches (positive or negative), from the no drugs branch.

Similarly, when it was known that drugs had been taken, the probability of testing negative was 0.1 (i.e., 10%), and, hence, the probability of testing positive was 1βˆ’0.1=0.9. These probabilities (0.1 and 0.9) have been placed next to the positive and negative branches from the drugs branch.

Part 1

To find the probability that an MLB player had not taken drugs and tested positive, we multiply the probability on the no drugs branch by that on the associated positive branch.

Hence, the probability that an MLB player chosen at random had not taken drugs and tested positive was 0.047 or 0.047Γ—100%=4.7%.

Part 2

To find the probability that an MLB player chosen at random is on drugs and tests positive, we multiply the probabilities for drugs on the first set of branches and positive on the second set.

Part 3

To find the probability that an MLB player chosen at random had positive test results, we must add together the probabilities for every possible situation where an MLB player may test positive. Fortunately for us, there are two ways a player might test positive and we have already worked out the probabilities for them both! These are the probability that a player was not on drugs and tested positive (𝑃(π·βˆ©π‘ƒ)=0.047) and the probability that a player was on drugs and tested positive (𝑃(π·βˆ©π‘ƒ)=0.054).

Hence, the probability that an MLB player chosen at random tested positive is 0.047+0.054=0.101. That is, approximately 10% of the players tested positive.

In the next example, we will discuss how to find an unknown number of outcomes given a conditional probability and other information. We will use a tree diagram to help us do this.

Example 5: Finding An Unkwown Parameter Using a Tree Diagram

There are an unknown number of balls in the bag. There are 3 white balls and some black balls. Two balls are selected without replacement. If the probability of selecting a black ball, given that the first ball is white, is 67, how many black balls are there in the bag?

Answer

As we are told in the question that there are two possible outcomes of each event, white and black, and that two balls are selected without replacement, then it is helpful to use a tree diagram to represent this information. We will start by laying out the tree diagram with the different outcomes.

We are told in the question that the probability of selecting a black ball, given that the first ball is white, is 67. This is represented by the branch for selecting a black ball that stems from the branch for selecting a white ball, as shown below.

We are told that there are 3 white balls in the bag initially, but an unknown number of balls in total, and an unknown number of black balls. If we let 𝑏 equal the number of black balls, then the number of balls in total is 𝑏+3, since it is the number of black balls, 𝑏, plus the number of white balls, 3.

We can then say the probability that the first ball is white is the number of white balls, 3, divided by the number of balls in total, 𝑏+3. This gives us 𝑃()==3𝑏+3.firstballiswhitenumberofwhiteballstotalnumberofballs

Labelling this on the tree diagram, we get the following.

Using 𝑏 as the number of black balls in the bag, and 𝑏+3 as the total number of balls, we can then write an expression for the probability that the second ball is black, given that the first ball is white. When we select the second ball, we know that since the first ball selected is white, then there are only 2 white balls left in the bag, but still 𝑏 black balls. So the probability of the second ball being black given that the first ball is white is the number of black balls, 𝑏, divided by the number of balls in the bag, 𝑏+2, since there are only 2 white balls in the bag now. This gives us 𝑃(∣)==𝑏𝑏+2.secondisblackfirstiswhitenumberofblackballsgiventhatthefirstiswhitetotalnumberofballsgiventhatthefirstiswhite

As we already know that the probability that the second ball is black, given that the first ball is white, is 67, then we can equate this to the expression above to find 𝑏. This gives us 𝑏𝑏+2=677𝑏=6(𝑏+2)7𝑏=6𝑏+12𝑏=12.

Therefore, the number of black balls in the bag is 12.

In this explainer, we have discussed how to find the probability of conditional events using tree diagrams. Let’s recap the key points.

Key Points

  • When there is a relatively small number of outcomes, for compound (more than one) events, a tree diagram is a useful way of illustrating a probability problem.
  • On each branch of the tree, we write the probability of that outcome and the following should be true in any tree diagram:
    • The sum of the probabilities for each set of branches should equal 1.
    • The sum of the probabilities of all the final outcomes should also equal 1.
  • If we have two events and each event has two possible outcomes, our tree diagram will look like this:

Join Nagwa Classes

Attend live sessions on Nagwa Classes to boost your learning with guidance and advice from an expert teacher!

  • Interactive Sessions
  • Chat & Messaging
  • Realistic Exam Questions

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy