# 1.17. Use tree diagrams to represent and work with events

[responsivevoice_button rate=”0.9″ voice=”UK English Female” buttontext=”Listen to Post”]

When attempting to determine a sample space (the possible outcomes from an experiment), it is often helpful to draw a diagram which illustrates how to arrive at the answer.

**Tree diagram Analysis**

In addition to helping determine the number of outcomes in a sample space, the tree diagram can be used to determine the probability of individual outcomes within the sample space. The probability of any outcome in the sample space is the product (multiply) of all possibilities along the path that represents that outcome on the tree diagram.

**Examples:**

Show the sample space for tossing one penny and rolling one die. (H = heads, T = tails)

By following the different paths in the tree diagram, we can arrive at the sample space.

Sample space:

H1, H2, H3, H4, H5, H6, T1, T2, T3, T4, T5, T6

The probability of each of these outcomes is 1/2 • 1/6 = 1/12

A family has three children. How many outcomes are in the sample space that indicates the sex of the children? Assume that the probability of male (M) and the probability of female (F) are each 1/2.

Sample space:

MMM; MMF; MFM; MFF; FMM; FMF; FFM; FFF

There are 8 outcomes in the sample space.

The probability of each outcome is 1/2 • 1/2 • 1/2 = 1/8.

*Use counting techniques to determine the number of ways an event can occur*

*Use counting techniques to determine the number of ways an event can occur*

The solution to many statistical experiments involves being able to count the number of points in a sample space. Counting points can be hard, tedious, or both. Fortunately, there are ways to make the counting task easier. This section focuses on three rules of counting that can save both time and effort – event multiples, permutations, and combinations.

The first rule of counting deals with event multiples. An **event multiple** occurs when two or more independent events are grouped together. The first rule of counting helps us determine how many ways an event multiple can occur.

Rule 1. Suppose we have k independent events. Event 1 can be performed in n1 ways; Event 2, in n_{2} ways; and so on up to Event k (which can be performed in n_{k} ways). The number of ways that these events can be performed together is equal to n_{1}n_{2} . . . n_{k} ways. |

**Examples**

- How many sample points are in the sample space when a coin is flipped 4 times?

Each coin flip can have one of two outcomes – heads or tails. Therefore, the four coin flips can land in (2)(2)(2)(2) = 16 ways.

- A businessman has 4 dress shirts and 7 ties. How many different shirt/tie outfits can he create?

For each outfit, he can choose one of four shirts and one of seven ties. Therefore, the business man can create (4)(7) = 28 different shirt/tie outfits.

Often, we want to count all of the possible ways that a single set of objects can be arranged.

- Consider the letters X, Y, and Z. These letters can be arranged a number of different ways (XYZ, XZY, YXZ, etc.) Each of these arrangements is a permutation.

In general, n objects can be arranged in n(n – 1)(n – 2) … (3)(2)(1) ways. This product is represented by the symbol n!, which is called n factorial. (By convention, 0! = 1.)

A **permutation** is an arrangement of all or part of a set of objects, with regard to the order of the arrangement.

The number of permutations of n objects taken r at a time is denoted by _{n}P_{r}.

Rule 2. The number of permutations of n objects taken r at a time is _{n}P_{r} = n(n – 1)(n – 2) … (n – r + 1) = n! / (n – r)! |

**Examples**

- How many different ways can you arrange the letters X, Y, and Z?

One way to solve this problem is to list all of the possible permutations of X, Y, and Z. They are:

- XYZ, XZY, YXZ, YZX, ZXY, and ZYX.

Thus, there are 6 possible permutations.

Another approach is to use Rule 2. Rule 2 tells us that the number of permutations is n! / (n – r)!.

- We have 3 distinct objects so n = 3.
- And we want to arrange them in groups of 3, so r = 3.
- Thus, the number of permutations is 3! / (3 – 3)! or 3! / 0!. This is equal to (3)(2)(1)/1 = 6.

- In horse racing, a trifecta is a type of bet. To win a trifecta bet, you need to specify the horses that finish in the top three spots in the exact order in which they finish. If eight horses enter the race, how many different ways can they finish in the top three spots?

Rule 2 tells us that the number of permutations is n! / (n – r)!.

- We have 8 horses in the race. so n = 8.
- And we want to arrange them in groups of 3, so r = 3.
- Thus, the number of permutations is 8! / (8 – 3)! or 8! / 5!.
- This is equal to (8)(7)(6) = 336 distinct trifecta outcomes. With 336 possible permutations, the trifecta is a difficult bet to win.

Sometimes, we want to count all of the possible ways that a single set of objects can be selected – without regard to the order in which they are selected.

A **combination** is a selection of all or part of a set of objects, without regard to the order in which they were selected.

The number of combinations of n objects taken r at a time is denoted by _{n}C_{r}.

Rule 3. The number of Combinations of n objects taken r at a time is _{n}C_{r} = n(n – 1)(n – 2) … (n – r + 1)/r! = n! / r!(n – r)! = _{n}P_{r} / r! |

**Examples**

- How many different ways can you select 2 letters from the set of letters: X, Y, and Z?

One way to solve this problem is to list all of the possible selections of 2 letters from the set of X, Y, and Z.

- They are: XY, XZ, and YZ. Thus, there are 3 possible combinations.

Another approach is to use Rule 3. Rule 3 tells us that the number of combinations is n! / r!(n – r)!.

- We have 3 distinct objects so n = 3.
- And we want to arrange them in groups of 2, so r = 2.
- Thus, the number of combinations is 3! / 2!(3 – 3)! or 3! /2!0!.
- This is equal to (3)(2)(1)/(2)(1)(1) = 3.

- Five-card stud is a poker game, in which a player is dealt 5 cards from an ordinary deck of 52 playing cards. How many distinct poker hands could be dealt?

For this problem, it would be impractical to list all of the possible poker hands. However, the number of possible poker hands can be easily calculated using Rule 3.

Rule 3 tells us that the number of combinations is n! / r!(n – r)!.

- We have 52 cards in the deck so n = 52.
- And we want to arrange them in groups of 5, so r = 5.
- Thus, the number of permutations is 52! / (52 – 5)! or 52! / 5!47!.
- This is equal to 2,598,960 distinct poker hands.

*Multiply or add probabilities*

*Multiply or add probabilities*

The best way to illustrate when to multiply or add is by an example:

There are 3 balls in a bag: red, yellow and blue. One ball is picked out, and not replaced, and then another ball is picked out. The tree diagram looks like this:

The first ball can be red, yellow or blue. The probability is 1/3 for each of these. If a red ball is picked out, there will be two balls left, a yellow and blue. The probability the second ball will be yellow is 1/2 and the probability the second ball will be blue is 1/2. The same logic can be applied to the cases of when a yellow or blue ball is picked out first.

In this example, the question states that the ball is not replaced. If it was, the probability of picking a red ball (etc.) the second time will be the same as the first (i.e. 1/3).

**The AND and OR rules **

In the above example, the probability of picking a red first is 1/3 and a yellow second is 1/2. The probability that a red AND then a yellow will be picked is 1/3 × 1/2 = 1/6 (this is shown at the end of the branch).

The probability of picking a red OR yellow first is 1/3 + 1/3 = 2/3.**When the word ‘and’ is used we multiply. When ‘or’ is used, we add**. On a probability tree, when moving from left to right we multiply and when moving down we add.

**Example:**

What is the probability of getting a yellow and a red in any order?

This is the same as: what is the probability of getting a yellow AND a red OR a red AND a yellow.

P(yellow and red) = 1/3 × 1/2 = 1/6

P(red and yellow) = 1/3 × 1/2 = 1/6

P(yellow and red or red and yellow) = 1/6 + 1/6 = 1/3