Permutations and Combinations
Four distinct objects , , , arranged in a row: . That number is right.
Now three questions that still feel like "arranging four things", each of which the reflex answers .
| Question | Reflex | Correct | Each object was counted |
|---|---|---|---|
| Seat around a round table | times, once per rotation | ||
| Arrange the letters of | times, swapping the two O's | ||
| Pick of the for a team | times, once per ordering |
Three different answers from one starting number, and nothing was wrong with the . What differed was how many times each real object appeared inside it: four, two and six.
Build the object one decision at a time, then divide out every way you counted the same object more than once.
That is the whole chapter. The building gives the multiplication principle and every permutation count. The dividing gives combinations, repeated letters and circular arrangements, which are the same correction applied to three different overcounts.
You do not choose between five similar formulas. You build, then correct.
1. The Fundamental Principle of Counting
Multiplication principle. If one decision has outcomes and an independent second has , the pair has .
Addition principle. If the cases are mutually exclusive, add their counts.
| Word in the question | Principle |
|---|---|
| "and", "then", "followed by" | multiply |
| "or", "either", separate cases | add |
Trap. The multiplication principle needs the second count to be the same whichever way the first went. If the first choice changes how many options the second has, split into cases and add.
Start with the most constrained decision. A slot that forbids something must be filled first, or you will not know how many options the later slots have.
Illustration 1
Using the digits without repetition, how many three-digit numbers can be formed, and how many of those are even?
For any three-digit number the leading digit cannot be , which is the constraint, so fill that slot first.
Five choices lead (everything but ), then five remain for the second slot ( is available again), then four.
For the even ones there are now two constrained slots, the first and the last, and they interact. Split into cases.
Last digit : the leading slot is no longer restricted, since is spent. That gives .
Last digit or : two ways to choose it, then the leading digit avoids both and that digit, leaving , then remain.
Multiplying blindly would give , counting numbers like . The cases were needed because whether is still available in the leading slot depends on what the last slot took.
2. Permutations: Arrangements Without Repetition
Permutation. An arrangement, in which order matters.
That is the multiplication principle with the options shrinking by one each time: for the first slot, for the next, down to for the last.
| Special case | Value |
|---|---|
| , by definition, so the formulas stay consistent |
With repetition allowed, nothing shrinks and the count is .
3. Combinations: Dividing Out the Order
Combination. A selection, in which order does not matter.
Build the ordered version, then divide by the number of orderings of each selection.
| Identity | Reading |
|---|---|
| choosing who is in is choosing who is out | |
| one way to take none, one way to take all | |
| every subset, counted by size | |
| Pascal's identity |
Illustration 2
Prove Pascal's identity without any algebra.
Single out one particular object, say the first. Every selection of objects either contains it or does not, and never both, so the two cases are exclusive and their counts add.
It is in. The remaining places are filled from the other objects: ways.
It is out. All places are filled from the other objects: ways.
The factorial proof takes half a page of common denominators and tells you nothing. This one takes two lines and explains why Pascal's triangle has each entry as the sum of the two above it.
Illustration 3
If , find all possible values of .
The instinct is to equate the lower indices and stop. That misses half the answer, because means two different lower indices can give the same value.
Case 1, the indices are equal.
Case 2, the indices are complementary.
Both must be checked against , and both survive: gives , and gives .
The symmetry that makes this question possible is the same one that makes easy: rewrite it as and the arithmetic collapses from seventeen factors to three.
4. Permutations with Repeated Objects
Identical objects create the second kind of overcount: swapping two identical letters produces a different-looking arrangement that is really the same one.
where are the counts of each repeated object.
Illustration 4
How many arrangements are there of the letters of , and in how many of them are the two L's together?
Seven letters, with L twice and O twice.
For the L's together, glue them into one block. That block plus makes six items to arrange, still with O twice.
No extra factor for arranging inside the block, because the two L's are identical: swapping them within the block changes nothing. Had the block been two different letters, the answer would have been doubled.
As a check, , and that is exactly the chance that two specified positions out of seven are adjacent in the sense required, so the fraction is plausible rather than merely arithmetic.
5. Circular Permutations
Around a circle there is no first seat. Fixing one person removes the rotational overcount, which is the third kind.
| Situation | Count |
|---|---|
| Distinct seats round a table | |
| Necklace or garland, flipping allowed | |
| Beads on a line |
Illustration 5
How many different garlands can be made from distinct flowers?
Round a circle, the rotational overcount gives .
But a garland can be picked up and turned over, and the reversed arrangement is the same physical garland. That is a second overcount, of exactly .
The same correction applies to necklaces and to any circular object with no fixed face. It does not apply to people at a round table, because a table cannot be flipped and the person on your left stays on your left.
Trap. Decide first whether reflections are genuinely indistinguishable. Garland and necklace mean divide by two; seating and round-table questions do not.
6. Restrictions and the Standard Devices
Objects that must be together
Glue them into a single block, arrange the blocks, then arrange inside the block.
Objects that must not be together
Arrange the others first, then drop the restricted ones into the gaps. With objects in a row there are gaps, including the two ends.
At least and at most
Count the complement when the phrase is "at least one". The opposite of "at least one" is "none", which is a single easy count.
For "at least two of five", the complement is two cases rather than one, so direct case-counting is usually faster. Compare the number of cases each way before committing.
Illustration 6
From men and women, a committee of is to contain at least men. Count it both ways and see which is shorter.
Directly, by number of men.
By complement, subtracting the committees with at most men.
The committee with no men at all would need five women and only four exist, so that case contributes nothing and the complement needs two terms against the direct route's three.
Agreement between the two routes is also the best available check, since an arithmetic slip is very unlikely to survive both.
Illustration 7
In how many ways can the letters of be arranged so that no two S's are adjacent?
Seven letters: three times, twice, plus and .
Gap method. Arrange the four non-S letters first, remembering the repeated C.
Those four letters create gaps. Choosing any of them for the S's guarantees a letter stands between each pair.
No factor for arranging the S's among themselves, since they are identical.
The two overcount corrections appear in the same line and do different jobs: removes the duplicate C's, and using rather than removes the ordering of identical S's.
Illustration 8
A basket holds identical apples, identical oranges and identical pears. In how many ways can a non-empty selection be made?
Because the fruits of each kind are identical, a selection is entirely described by how many of each kind it contains, not which ones.
That count includes taking nothing at all, so remove it.
Contrast with distinct fruits, where each is independently in or out and the answer would be . Identical objects collapse the choices from "which" to "how many", and that is the entire difference.
7. Selections from Groups and Integer Solutions
For selections drawn from several groups, choose from each group and multiply, then add over the allowed splits.
The number of non-negative integer solutions of is a stars-and-bars count.
Illustration 9
Find the number of positive integer solutions of , and compare with the non-negative count.
Positive means every variable is at least , so the bars must not share a gap and none may sit at an end. Twelve stars leave gaps, and two bars occupy two of them.
For non-negative solutions, zeros are allowed, so bars may sit together or at the ends. Substituting and so on converts one problem to the other.
Those are exactly the solutions with at least one zero, which you can verify: after correcting for the three double-zero cases counted twice.
Trap. Read whether the variables may be zero before choosing the formula. The two answers here differ by nearly a factor of two.
8. Dividing Objects into Groups
Dividing objects into groups of stated sizes uses the repeated-object formula, with one extra correction that catches almost everyone.
If some groups have equal size and are unlabelled, divide again by the factorial of the number of equal groups, because swapping two identical-sized unlabelled groups produces the same division.
Illustration 10
Divide people into groups of , and . Then divide people into three groups of . Explain why only the second needs the extra division.
No further correction. The groups have different sizes, so they are already distinguishable, and swapping them would change which group is which.
Here the three groups are indistinguishable. Any one division has been counted times, once for each way of labelling the three pairs as "first", "second", "third".
If the question had named the groups, calling them rooms or teams , , , the answer would be , since the labels make the groups distinguishable again.
9. Two Standard Applications
Counting divisors
Write in prime factorisation. Each prime's exponent is chosen independently, from up to its maximum.
Illustration 11
For , how many divisors are there in total, and how many are perfect squares?
A divisor is a perfect square exactly when every exponent in it is even, so count the even choices for each prime separately.
The structure never changed; only the menu at each prime shrank. The same method counts divisors that are perfect cubes, or divisible by , by restricting the exponent lists accordingly.
Points, lines and triangles
Every line needs two points and every triangle needs three, so the counts are combinations, with a correction wherever points are collinear.
| From points, no three collinear | Count |
|---|---|
| Lines | |
| Triangles | |
| Diagonals of an -gon |
Illustration 12
Ten points lie in a plane, of which exactly four are collinear. How many lines and how many triangles do they determine?
Start from the unrestricted counts, then repair the damage the collinear four cause.
Lines. The four collinear points would have given separate lines, but they all lie on one line.
Triangles. Any three of the collinear four give no triangle at all, so those selections are simply deleted.
Note the difference between the two repairs. Lines lost six and regained one, because a line still exists; triangles lost four and regained nothing, because a degenerate triangle is not a triangle.
The diagonal formula comes from the same idea: a polygon's point pairs include the sides, which are not diagonals, so a decagon has diagonals.
Rank of a word
List all arrangements in dictionary order and find the position of a given word. Work letter by letter: at each position, count the arrangements that start with a smaller letter, then move on.
Illustration 13
Find the rank of among the arrangements of .
Position 1. Words beginning with a letter before C: that is A or B, two choices, each followed by arrangements.
Position 2. Among the words beginning with C, those with a second letter before A: none, since A is smallest.
Position 3. Nothing is left to choose.
Check by listing: ABC, ACB, BAC, BCA, CAB, CBA. The final is what turns "how many come before it" into "what position is it".
Summary
Build the object one decision at a time, then divide out every way you counted the same object twice.
Three overcounts, one correction: ordering gives , identical objects give , rotation gives .
Multiply for independent decisions, add for exclusive cases, and fill the most constrained slot first. If the second count depends on the first choice, split into cases.
with order, with repetition allowed, and without order.
Pascal's identity is one sentence: the singled-out object is either in or out.
Repeated letters divide by the factorial of each repeat count. Gluing objects into a block needs an internal factor only if the glued objects are distinct.
Circular arrangements are ; garlands and necklaces divide again by for flipping, tables do not.
Together means glue; not together means arrange the rest and use the gaps; at least one usually means take the complement.
Identical objects turn "which" into "how many", so selections come to , less one for the empty choice.
Non-negative solutions of a sum equation are ; positive solutions are , and the wording decides which.
Groups of unequal size need no extra division; equal-sized unlabelled groups need division by the factorial of how many are equal.
Two lower indices give the same combination when they are equal or complementary, so identity equations have two cases.
Lines and triangles from points are and ; collinear points cost a line six and give one back, and cost a triangle its whole selection.
Divisor counts multiply over the prime exponents, and restricting the exponent menus counts special divisors such as perfect squares.
Rank of a word is a positional count of everything alphabetically before it, plus one.
