Math Core

Lesson 12.5 · Probability

Permutations and combinations

Listing every outcome works for two dice. It does not work for dealing a 55-card hand, where there are over 2.52.5 million possibilities. To find probabilities in big sample spaces, you need to count without listing. This lesson gives you three tools: the fundamental counting principle, permutations and combinations.

The fundamental counting principle

Fundamental counting principle

If one choice can be made in mm ways and a second choice can then be made in nn ways, the two choices together can be made in m⋅nm \cdot n ways. This extends to any number of choices: multiply the number of options at each step.

You've already used this: two number cubes give 6⋅6=366 \cdot 6 = 36 outcomes.

Worked example: Codes

A locker code is 33 letters followed by 22 digits, and letters and digits may repeat. How many codes are possible?

There are 2626 choices for each letter and 1010 for each digit:

26⋅26⋅26⋅10⋅10=1,757,600.26 \cdot 26 \cdot 26 \cdot 10 \cdot 10 = 1{,}757{,}600.

Factorials and arrangements

How many ways can 55 books be lined up on a shelf? There are 55 choices for the first spot, then 44 left for the second, then 33, 22 and 11:

5⋅4⋅3⋅2⋅1=120.5 \cdot 4 \cdot 3 \cdot 2 \cdot 1 = 120.

This product has a name.

Definition

Factorial

For a positive integer nn, nn factorial is n!=n⋅(n−1)⋅(n−2)⋯2⋅1n! = n \cdot (n-1) \cdot (n-2) \cdots 2 \cdot 1. By definition, 0!=10! = 1. There are n!n! ways to arrange nn different objects in a row.

Permutations: order matters

Now suppose only some of the objects are used. A club of 1010 members elects a president, a vice president and a secretary. There are 1010 choices for president, then 99 for vice president, then 88 for secretary: 10⋅9⋅8=72010 \cdot 9 \cdot 8 = 720 ways. Each result is a permutation, an arrangement in which order (here, which office) matters. Electing Ana president and Ben secretary is different from the reverse.

Permutations

The number of permutations of nn objects taken rr at a time is

nPr=n!(n−r)!=n(n−1)(n−2)⋯(n−r+1).{}_nP_r = \frac{n!}{(n-r)!} = n(n-1)(n-2)\cdots(n-r+1).

That last form is rr factors, counting down from nn.

Check with the club: 10P3=10!7!=10⋅9⋅8=720{}_{10}P_3 = \dfrac{10!}{7!} = 10 \cdot 9 \cdot 8 = 720. The 7!7! cancels the part of 10!10! you don't use.

Combinations: order doesn't matter

Now the club picks a committee of 33 with no titles. The committee {Ana, Ben, Cy} is the same committee however you list the names. The 720720 permutations count each committee several times, once for each of the 3!=63! = 6 ways to order its members. So the number of committees is

7206=120.\frac{720}{6} = 120.

A selection in which order doesn't matter is a combination.

Combinations

The number of combinations of nn objects taken rr at a time is

nCr=nPrr!=n!r! (n−r)!.{}_nC_r = \frac{{}_nP_r}{r!} = \frac{n!}{r!\,(n-r)!}.

It is also written (nr)\dbinom{n}{r} and read "nn choose rr."

Common mistake

Before you use a formula, ask: if I swap two of the chosen items, is it a different result? If yes (offices, finishing places, a code, a seating order), use permutations. If no (a committee, a hand of cards, pizza toppings), use combinations. Using nPr{}_nP_r for a committee overcounts by a factor of r!r!.

Worked example: Permutation or combination?

  1. In how many ways can gold, silver and bronze medals be awarded to 33 of 88 runners?

  2. In how many ways can a coach choose 33 of 88 runners for a relay pool, with no order?

  3. Medals are different, so order matters: 8P3=8⋅7⋅6=336{}_8P_3 = 8 \cdot 7 \cdot 6 = 336.

  4. A group without roles, so order doesn't matter: 8C3=3363!=3366=56{}_8C_3 = \dfrac{336}{3!} = \dfrac{336}{6} = 56.

Counting to find probabilities

When outcomes are equally likely, P(event)=favorable outcomestotal outcomesP(\text{event}) = \dfrac{\text{favorable outcomes}}{\text{total outcomes}}, and now you can count both with combinations or permutations.

Worked example: Choosing a committee at random

A committee of 33 is chosen at random from 55 girls and 44 boys. What is the probability that the committee is all girls? What is the probability that it has exactly 22 girls?

Total committees: 9C3=9⋅8⋅73⋅2⋅1=84{}_9C_3 = \dfrac{9 \cdot 8 \cdot 7}{3 \cdot 2 \cdot 1} = 84.

All girls: choose 33 of the 55 girls: 5C3=10{}_5C_3 = 10.

P(all girls)=1084=542.P(\text{all girls}) = \frac{10}{84} = \frac{5}{42}.

Exactly 22 girls: choose 22 of 55 girls and 11 of 44 boys. By the counting principle, that's 5C2⋅4C1=10⋅4=40{}_5C_2 \cdot {}_4C_1 = 10 \cdot 4 = 40 committees.

P(exactly 2 girls)=4084=1021.P(\text{exactly 2 girls}) = \frac{40}{84} = \frac{10}{21}.

Tip

nCr=nCn−r{}_nC_r = {}_nC_{n-r}. Choosing 33 people to be on a committee from 1010 is the same as choosing 77 to leave off, so 10C3=10C7=120{}_{10}C_3 = {}_{10}C_7 = 120. Use whichever is quicker to compute.

Practice

Practice 1

In how many different orders can 55 students line up for a photo?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

Evaluate 7C3{}_7C_3.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

A 44-digit PIN uses the digits 00 through 99, and no digit may be repeated. How many PINs are possible?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

A pizza shop offers 1212 toppings. How many different pizzas with exactly 33 different toppings can you order?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Which situation should be counted with a permutation?

Practice 6

Ten people enter a drawing, and 22 of them are chosen at random to win identical prizes. What is the probability that Ana and Ben are the two winners?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

Five people, including Ana and Ben, sit in a row of 55 chairs in a random order. What is the probability that Ana sits in the first chair and Ben sits in the last chair?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

A bag has 66 red and 44 blue marbles. You grab 33 marbles at random. What is the probability that exactly 22 of them are red?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.