Permutations & Combinations

The fundamental counting principle tells us to multiply the number of ways at each stage. Two very common counting problems have their own names and their own tidy formulas: a permutation (an ordered selection) and a combination (an unordered selection). The whole topic turns on one question: does the order matter?

First, a shorthand for arrangements. Lining up n different things in a row uses n for the first slot, then n-1 for the next, and so on down to 1. That product is so common it gets a symbol, the factorial n!:

n! = n \times (n-1) \times (n-2) \times \dots \times 2 \times 1.

So three different books can be arranged in 3! = 3 \times 2 \times 1 = 6 orders, and five books in 5! = 120. By convention 0! = 1 (there is exactly one way to arrange nothing).

Permutations: order matters

A permutation counts ordered selections of r things from n. Because we stop after r picks instead of arranging all n, we chop off the tail of the factorial:

{}^{n}P_{r} = \frac{n!}{(n-r)!} = \underbrace{n \times (n-1) \times \dots}_{r \text{ factors}}.

Awarding gold, silver and bronze to the top 3 of 5 runners is a permutation, because swapping who gets gold and silver gives a different result:

{}^{5}P_{3} = \frac{5!}{2!} = 5 \times 4 \times 3 = 60. a medal star

Think of a race podium. Coming first, second or third are three different prizes, so the order of the names absolutely matters. If Ana, Ben and Cy finish in the top three, then Ana-Ben-Cy is a different podium from Cy-Ben-Ana. That is why a PIN, a race result and a seating order are all permutations: rearranging the same people makes a genuinely new outcome.

Combinations: order does not matter

A combination counts unordered selections. Now Ana-Ben and Ben-Ana are the same choice, so a permutation over-counts by exactly the r! ways of shuffling each chosen group. Divide that surplus out:

{}^{n}C_{r} = \frac{{}^{n}P_{r}}{r!} = \frac{n!}{r!\,(n-r)!}.

Choosing 2 friends from 5 to form a team is a combination, because a team of Ana and Ben is the same as a team of Ben and Ana:

{}^{5}C_{2} = \frac{5 \times 4}{2 \times 1} = \frac{20}{2} = 10.

The same {}^{n}C_{r} counts lottery tickets, pizza toppings and handshakes — anything where you grab a group and the pick order is forgotten.

a cat an owl

Suppose a cat, an owl and a frog want to send two of themselves on a trip. There is no first or second seat — they all go in one basket — so choosing the cat and the owl is the very same choice as choosing the owl and the cat. The three possible pairs are just cat & owl, cat & frog and owl & frog: {}^{3}C_{2} = 3. A permutation would have counted {}^{3}P_{2} = 6, double the number, because it would treat cat-then-owl as different from owl-then-cat.

See it: every ordered pair, then every unordered pair

Lay out the choices as a grid. Rows are the first pick, columns the second. Step through it: the off-diagonal cells are all the ordered pairs (the permutations), and the shaded triangle keeps just one copy of each unordered pair (the combinations). Press Refresh for a different number of items.

Which one is it?

Every problem reduces to one decision. If rearranging the same chosen items counts as a new answer, you want a permutation. If it does not, you want a combination — the smaller number, because it has divided out the r! reorderings.