๐Ÿ”€ Combinations & Permutations

Count the ways โ€” and ask: does the order matter?

โ† Back to Math Topics โฌ‡ Assignment (PDF)

1. The counting principle

If one choice can be made in \(a\) ways and a second choice in \(b\) ways, the two together can be made in \(a \times b\) ways. It works for any number of choices: just keep multiplying.

Example. 3 T-shirts and 4 pairs of shorts make \(3 \times 4 = 12\) outfits.
Example. A 3-digit lock code (digits 0โ€“9, repeats allowed) has \(10 \times 10 \times 10 = 1000\) possibilities.

2. Factorials

How many ways can 4 friends stand in a line? 4 can go first, then 3 are left for second place, 2 for third, and 1 for last: \(4 \times 3 \times 2 \times 1 = 24\). This product has a name and a symbol:

\(n! = n \times (n-1) \times (n-2) \times \cdots \times 2 \times 1\)
\(n\)012345678
\(n!\)112624120720504040320
\(n!\) is the number of ways to arrange \(n\) different things in a row. By agreement \(0! = 1\) (there is exactly one way to arrange nothing).

3. Permutations: order matters

A permutation is an arrangement where the order counts. Choosing a president and a secretary from 5 people: \(5\) choices for president, then \(4\) for secretary, \(5 \times 4 = 20\) ways.

\({}_{n}P_{r} = \dfrac{n!}{(n-r)!} = \underbrace{n \times (n-1) \times \cdots}_{r \text{ numbers}}\)

\({}_{n}P_{r}\) counts the ways to choose \(r\) things from \(n\) and put them in order. For example \({}_{8}P_{3} = 8 \times 7 \times 6 = 336\).

4. Combinations: order does not matter

A combination is a selection where only who is chosen counts, not the order. Picking 2 people from 5 to go on a trip: the 20 ordered pairs count every pair twice (Annโ€“Ben and Benโ€“Ann are the same trip), so there are \(20 \div 2 = 10\) ways.

\({}_{n}C_{r} = \dfrac{{}_{n}P_{r}}{r!} = \dfrac{n!}{r!\,(n-r)!}\)

We divide by \(r!\) because each group of \(r\) can be put in order in \(r!\) ways. For example \({}_{8}C_{3} = \dfrac{8 \times 7 \times 6}{3 \times 2 \times 1} = 56\). You will also see it written \(\binom{n}{r}\), read "\(n\) choose \(r\)".

5. Which one do I use?

Ask: if I swap two of the chosen items, do I get something different?

Permutation \({}_{n}P_{r}\)Combination \({}_{n}C_{r}\)
Ordermattersdoes not matter
Key wordsarrange, order, line up, ranking,
1st/2nd/3rd, president & secretary, code
choose, select, team, group,
committee, hand of cards, toppings
Examplegold, silver, bronze from 10 runners:
\({}_{10}P_{3} = 720\)
a team of 3 from 10 runners:
\({}_{10}C_{3} = 120\)

Repeats allowed

\(n^r\)
Codes where digits can repeat: each of the \(r\) places has \(n\) choices.

Letters that repeat

\(\dfrac{n!}{a!\,b!\cdots}\)
BANANA: \(\dfrac{6!}{3!\,2!} = 60\) โ€” divide by the ways to swap identical letters.

Choosing from two groups

\({}_{b}C_{x} \times {}_{g}C_{y}\)
2 boys from 6 and 1 girl from 5: \(15 \times 5 = 75\).

Taking or leaving

\({}_{n}C_{r} = {}_{n}C_{n-r}\)
Choosing 8 of 10 to go is the same as choosing 2 to stay: \({}_{10}C_{8} = {}_{10}C_{2} = 45\).

6. Tricks for harder problems

  • Must be together? Bind them into one block, arrange the blocks, then multiply by the ways to order inside the block. 5 people with Ann and Ben together: \(4! \times 2! = 48\).
  • Must be apart? Count everything and subtract the "together" cases: \(5! - 48 = 72\).
  • At least one? Count all choices and subtract the ones with none.
  • A restricted place (no leading zero, must be even)? Fill that place first.

7. Pascal's triangle

Each number is the sum of the two above it, and row \(n\) lists \({}_{n}C_{0}, {}_{n}C_{1}, \ldots, {}_{n}C_{n}\). Row 5 shows \({}_{5}C_{2} = 10\).

Common mistakes. Using \({}_{n}P_{r}\) for a team or a group (order doesn't matter!), forgetting to divide by \(r!\), and forgetting the inside order of a bound block.