Combinatorics
The art of counting without listing. The rule of product, factorials, permutations, arrangements and combinations all answer one question — in how many ways can this be done — and the whole difficulty comes down to two decisions: does order matter, and may items repeat.
Before you start
This topic builds on earlier ideas. Before you start, it's worth working through the lessons below — they'll make everything click:
- MultiplicationMultiplication is repeated addition of the same number. Learn the names of the factors and the product, the laws of multiplication (commutativity, associativity, distributivity), the times tables and column multiplication.
- PowersA power is shorthand for multiplying the same factor by itself. Learn the base and the exponent, the laws of exponents, zero and negative exponents, and scientific notation.
All formulas
Rule of product
a choice made in several independent steps — multiply the counts
Factorial
the product of the first n naturals; 0! equals 1 by definition
Permutations
the number of orderings of all n items
Arrangements without repetition
choose k out of n, order matters, nothing repeats
Arrangements with repetition
k times over, we choose from the same n options
Combinations
choose k out of n, order does NOT matter
Symmetry of combinations
choosing k items is the same as discarding the other n − k
Combinatorics answers the question "in how many ways?" before anyone can start listing cases. It is also a prerequisite for classical probability: to divide the number of favourable outcomes by the number of all of them, you first have to be able to count both.
The rule of product
All of combinatorics grows out of a single observation. If a choice is made in several independent steps offering options, then the number of outcomes is:
The counts are multiplied, not added — because every decision in the first step can be paired with every decision in the second.
Factorials
The product of the first few naturals turns up so often in counting that it has its own symbol:
It is read "n factorial". The first few values are worth knowing by heart:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | |
|---|---|---|---|---|---|---|---|---|
| 1 | 1 | 2 | 6 | 24 | 120 | 720 | 5040 |
Mind the first column: , by definition. An empty sequence can be arranged in exactly one way — by doing nothing — and besides, without that convention the combination formula would divide by zero.
That growth is a practical hint: if ten people can be ordered in ways, solving a problem by listing cases is out of the question.
Permutations
A permutation is an ordering of all items. The first position can be filled in ways, the second in (one item is already used), and so on:
Arrangements without repetition
When only of the items are chosen but order matters, we are counting arrangements without repetition:
The second form is the handier one to compute: it is simply decreasing factors starting at .
Arrangements with repetition
If items may repeat, each of the steps has the full options, so the rule of product gives directly:
Combinations
When items are chosen out of and order does not matter, we have combinations:
Where does the in the denominator come from? From the fact that the arrangements counted every -element set times over — once for each ordering of the same items. So we divide by the number of those orderings:
Symmetry
Combinations have a property that saves a great deal of arithmetic:
Choosing items is, after all, the same as naming the items left behind. So is computed like , rather than by writing out eighteen factors.
The bars add up to — the number of subsets of a six-element set, because every item is decided independently: take it or leave it.
Which formula to use
The whole difficulty comes down to two questions about the problem:
| does order matter? | may items repeat? | formula |
|---|---|---|
| yes, all items are used | — | |
| yes, out of | no | |
| yes, out of | yes | |
| no, out of | no |
A practical test for the first question: swap two of the chosen items. If that gives a different situation, order matters.
Exercises
The five kinds of question match the five formulas in this lesson. A prompt with an exclamation mark asks straight for a factorial — mind . Permutations for a given is also , only phrased in words. Arrangements without repetition and arrangements with repetition both come with and ; they differ only in whether items may be taken more than once. Combinations ask for a choice of out of with order ignored — and here the symmetry is worth remembering. Every answer is a whole number.
Practice
Work through a set of exercises — they get harder as you go. At the end you'll see your score and the mistakes worth reviewing.
Common mistakes
- Adding instead of multiplying — successive steps of a choice multiply the counts.
- Confusing arrangements with combinations — if order does not matter, the result still has to be divided by .
- Forgetting — especially in the edge cases of the combination formula.
- Cancelling factorials by eye — is , not and not .
- Assuming repetition — whether items may repeat is decided by the problem, not by which formula is more convenient.
- Listing the cases — beyond there are usually far too many to get through without a slip.
Formula card
Topic: Combinatorics
Rule of product
a choice made in several independent steps — multiply the counts
Factorial
the product of the first n naturals; 0! equals 1 by definition
Permutations
the number of orderings of all n items
Arrangements without repetition
choose k out of n, order matters, nothing repeats
Arrangements with repetition
k times over, we choose from the same n options
Combinations
choose k out of n, order does NOT matter
Symmetry of combinations
choosing k items is the same as discarding the other n − k
