Counting Principles, Permutations, and Combinations
Learning goals
- Multiply stage counts that stay fixed no matter the earlier choices, or add across non-overlapping cases
- Ask whether order matters and whether repeats are allowed before choosing a formula
- Compute as a product of exactly factors
- Divide by to forget the order, giving
- Correct for repeated objects by dividing out their type factorials, to count arrangements like MISSISSIPPI
- Count the unwanted and subtract, for at least one
The multiplication principle
Start with a small case. A diner offers soups and sandwiches, and a lunch is one soup with one sandwich. Pick a soup any of ways. Whichever one you pick, all sandwiches are still on offer, so that choice leads to lunches, and the same is true for every soup. Four soups, each starting lunches of its own, and no lunch started twice, gives
Now add a third stage, drinks. Whichever soup and sandwich you already picked, both drinks are still on offer, so each of the soup-and-sandwich combinations leads to full lunches. The same move that turned into now turns into , because the number of drinks on offer never depends on which soup or sandwich came before it. Add a fourth stage and the same move repeats again. That repeated stacking, one stage at a time, is the whole idea behind counting by stages. State it precisely enough to use in harder cases, because the precision is what lets it survive when a careless version fails.
The multiplication principle. Suppose each object you want to count is built by a sequence of decisions. Suppose decision can be made in ways no matter how the earlier decisions came out. Suppose finally that different sequences of decisions build different objects, and that every object is built by exactly one sequence. Then the number of objects is
Read the hypothesis carefully, because the whole lesson leans on it. It says the number of options at each stage must not depend on the earlier choices. It does not say the options themselves must stay the same. When you seat people in chairs, which people remain for the second chair depends entirely on who took the first. But how many remain does not change with who took the first: it is always one fewer. That distinction is what makes permutations legal, and it is why “the choices are independent” undersells the rule: the choices themselves can depend on the past, as long as their number does not.
One companion rule handles problems that break into cases instead of stages. If the objects you want split into groups that overlap nowhere and leave nothing out, then the total is the sum of the group counts. That is the addition principle. A sequence of decisions multiplies (“this and then that”), while a split into separate cases adds (“either this kind or that kind”). Splitting a -digit number’s tens digit into ” through ” or ” through ” is one addition-principle split; if the cases instead shared a value, such as “even” and “under ” (both true of ), simply adding their counts would count that shared value twice.
Check your understanding
A school offers elective classes in the morning session and elective classes in the afternoon session, and no elective meets in both sessions. A student picks exactly one elective. How many electives can the student choose from?
The morning electives and the afternoon electives share no classes, so picking a morning elective and picking an afternoon elective are two cases that overlap nowhere and together cover every choice. That is the addition principle: add the case counts.
Multiplying to get would count a pair of one morning and one afternoon elective, which answers a different question, not the single elective this question asks for.
The simplest use of the multiplication principle is the one where nothing changes between stages. Suppose you fill slots, and each slot freely takes any of values, with repetition allowed. Then every stage offers the same options, and the product collapses to a power:
A four-digit PIN has settings, and a string of letters drawn from a -letter alphabet has possibilities. In both cases a digit or a letter can be reused as often as you like.
Permutations, or filling slots without repetition
Now forbid repetition. An arrangement, or permutation, of objects chosen from distinct objects is a way of filling ordered slots using each object at most once. Write for how many there are.
Fill the slots left to right. The first slot accepts any of the objects. Whatever you put there is gone, so the second slot accepts any of the remaining . The third accepts , and so on. The counts shrink by one at every step, and the multiplication principle applies because the number remaining is the same no matter which particular objects were used up. By the time you reach the -th slot you have already placed objects, so it accepts of them:
Count the factors, since this is where the formula is usually mangled. There is one factor per slot, so there are of them, and they run down to . For that is four factors, , stopping at and not at .
What the factorial counts. Set and you are arranging all objects, using every one of them:
You met in the binomial theorem lesson as a piece of notation. This is what it counts: the number of ways to put distinct objects in a row. Five books have orders, and ten books have of them.
The closed form. The product is the top of a factorial with its tail chopped off, so put the tail back by multiplying and dividing by :
The numerator is now the full factorial , and the denominator cancels precisely the factors you did not want. So
Why is forced. The cancellation above needs the tail to be an honest product of positive whole numbers, so it only works for . The case , arranging every object, is the one it misses. The slot count there is not in doubt: . If one closed form is to cover that case too, it must return there as well, and the closed form reads at . Setting the two equal, , leaves exactly one possible value:
The value is not picked for convenience: it is the only one under which the formula and the slot count agree. It also matches what a factorial means. Since counts the arrangements of objects, should count the arrangements of objects, and there is exactly one, the empty arrangement in which you place nothing. (The binomial theorem lesson used for the same reason, to keep its own formula correct at the edges.)
Worked example 1 Count the license plates
A plate shows three letters followed by three digits. The letters must all be different, but the digits may repeat. How many plates are possible?
Treat the six characters as six stages and watch which counts shrink. The letters cannot repeat, so the letter stages offer , then , then options. The digits may repeat, so every digit stage keeps all options.
The letters contribute and the digits contribute , so
There are plates. The single question that decided every stage count was whether a character may be reused. Shrink the count when it may not, hold it fixed when it may.
Worked example 2 Line up 4 of 9 books
Nine different books sit in a box, and four of them will stand in a row on a shelf. How many different shelves are possible?
The shelf is ordered, since swapping two books produces a visibly different shelf, and no book can appear twice. That is a permutation of objects chosen from , so fill four slots with shrinking counts:
The closed form gives the same number, and it is worth seeing the cancellation once:
In practice never expand in full. Cancel first and only four factors survive, which is the shrinking product you started with.
Check your understanding
A club of members elects a president, a secretary, and a treasurer, and no member may hold two offices. In how many ways can the three offices be filled?
The three offices are different, so the order of the picks matters: choosing Ana as president and Ben as secretary is not the same outcome as the reverse. Nobody may repeat, so this is a permutation of people chosen from .
Fill the offices as three stages with shrinking counts, then then .
Answering counts the sets of three officers without saying who holds which office, and would let one person hold all three.
Combinations, or forgetting the order
A permutation cares about order. Very often you do not. A committee of three is the same committee however you list its members, and a hand of cards is the same hand however it was dealt. A set of three chosen factors is the same set however you name them. What you want to count then is not an ordered list but a set.
Notation. For , the symbol , read ” choose ”, is the number of -element subsets of an -element set. This is not a new symbol. In the binomial theorem lesson it counted the ways to choose which of the factors of donate their . And a choice of factors is nothing more than a set of factors picked out of . Same act, same count, same number. What is new here is a way to compute it directly.
The tool that computes it directly is the mirror image of the multiplication principle: start from a count you already know, then divide away the overcounting.
Start from a small case. Choose letters from , filling ordered slots without repeats: there are ordered lists. But the six lists ABC, ACB, BAC, BCA, CAB, and CBA all name the same set, : they differ only in the order the letters were written down. The same is true of every -letter set drawn from these four letters, so the ordered lists split evenly into groups of .
That is the pattern behind every combination count: build the ordered version first, since you already know how to count that, then divide by however many orders share one unordered result.
The division principle. Suppose a procedure produces outputs in total, and suppose every output is produced by exactly one object. Suppose also that every object you actually want to count is produced exactly times, with the same for every object. Then the number of objects is .
Why an even overcount can simply be divided away#
Sort the outputs into piles, putting two outputs in the same pile exactly when they came from the same object. Every output lands in exactly one pile, since it came from exactly one object, so the piles overlap nowhere and together hold all outputs.
By hypothesis each object is produced exactly times, so each pile holds exactly outputs. Let be the number of piles, which is the number of objects. Counting the outputs pile by pile gives groups of , so , and therefore .
The requirement that be the same for every object is the whole content of the rule. If some objects were produced twice and others three times, the piles would be uneven and no single division could repair the count.
Now count in general, the same way the -letter example did it: count the ordered lists two different ways.
The direct count of #
Fix and with , and count the ordered lists of distinct objects drawn from the available, twice.
First count: fill the slots. A list is ordered slots filled without repetition, so by the shrinking slot argument there are lists in all.
Second count: choose, then order. Build the same list in two stages instead. First choose the set of objects that will appear in it, which by definition can be done in ways. Then choose the order in which to write that set out, which is an arrangement of distinct objects in slots, so it can be done in ways.
The multiplication principle applies to these two stages, because the second stage offers orders no matter which set the first stage produced. And the two stages build every list exactly once. Each list determines its own set (its entries) and its own order (how they are written), so no list is built twice and none is missed. Hence the number of lists is also .
Equate the two counts. The same lists were counted both times, so
and dividing by isolates the number we wanted:
Look at what the division did. Every set of objects was built times, once for each order in which its members could be listed. Dividing by collapses those lists back into the single set they all describe. Dividing by is the act of forgetting the order. That sentence is the difference between a permutation and a combination, and there is nothing else to it. It is exactly what the -letter example above did by hand: ordered lists, divided by the orders each set was written in, giving sets.
Two facts drop out for free. Choosing which objects to take is the same act as choosing which objects to leave, so . The formula agrees because swapping with just swaps the two factorials in the denominator. And at the edges, , since there is one way to take nothing and one way to take everything. The formula produces those ‘s only because , which is the same forcing you saw a moment ago.
Here is the whole scheme on one page. Suppose you make picks from objects.
| The picks are | Repetition | How many ways |
|---|---|---|
| ordered | allowed | |
| ordered | not allowed | |
| unordered | not allowed |
The missing fourth row, unordered picks with repetition allowed, needs a tool this lesson does not build, so leave it for a later course. The three rows above answer nearly everything. The two questions you must answer before choosing a row are whether rearranging your picks changes the outcome, and whether an object may be used twice. Neither question settles the row by itself. The first two rows are both ordered, so the order question alone leaves you stuck between them, and only the repetition question tells them apart.
Worked example 3 Choose a delegation of 5 from a club of 12
A club of members sends delegates to a conference. The delegates have no titles and no ranks, so the delegation is just a set of five people. How many delegations are possible?
Rearranging the same five people gives the same delegation, so order does not matter and this is . Use the closed form, canceling against the tail of before multiplying anything:
Five factors on top counting down from , and underneath. The numerator is and the denominator is :
There are delegations. Had the five delegates instead been given five distinct jobs, the answer would have been , which is exactly times larger. That factor of is one for each of the ways to hand out the jobs to a fixed set of five people.
Check your understanding
The same club of members instead sends a committee of members, with no offices and no ranks. How many committees are possible?
Now the three people have no titles, so the committee is a set and rearranging it changes nothing. Count the ordered choices first, then forget the order by dividing by .
There are ordered choices, and every committee of three was counted once for each of the orders of its members.
The number answers the earlier question, where the three jobs were different. The single word that separates the two questions is whether the roles are distinguishable.
Worked example 4 Build a committee with a required mix
A department has women and men, and it must form a committee of women and men. How many committees are possible?
Break the build into two stages, choosing the women and then the men. Neither group is ordered, so each stage is a combination:
The multiplication principle now applies, because whichever three women are chosen, there are still ways to choose the men:
There are committees. Notice that the two stages multiply even though each stage was itself computed by a division. Combinations are ordinary numbers once you have them, and they slot into the multiplication principle like any other stage count.
Arranging objects that are not all distinct
The permutation formula assumed every object was distinguishable. Real problems break that assumption constantly, and the repair is the division principle again.
How many distinguishable arrangements does the word BANANA have? If the six letters were all different the answer would be , but they are not. There are three A’s and two N’s, and swapping two A’s produces the identical string. So is an overcount, and the question is by how much.
Arrangements of objects with repeats#
Suppose objects come in types, with copies of the first type, of the second, and so on up to , where . Copies of the same type are identical. We count the distinguishable arrangements.
Tag the copies to make them temporarily distinct: call the three A’s of BANANA . All tagged objects are now different, so they have arrangements.
Group those tagged arrangements by the untagged word they produce. Two tagged arrangements produce the same word exactly when they place the same type in the same positions. Two arrangements that produce the same word differ only in how the tags are distributed among the positions of each type. For a fixed word, the tags of type can be scattered over its positions in ways. The tags of type can be scattered over the word’s positions in ways, and so on. Placing one type’s tags does not change how many ways the next type’s tags can be placed, so by the multiplication principle each word arises from exactly
tagged arrangements. That number is the same for every word, since it depends only on the type counts.
The division principle now applies with and , so the number of distinguishable arrangements is
For BANANA, with three A’s, two N’s, and one B:
Sixty arrangements, not . Divide by the factorials of the repeat counts, not by the repeat counts themselves: the three A’s contribute , not .
This formula quietly contains the binomial coefficient. Take just two types, objects of one kind and of the other, say letters Y and letters X. The count of arrangements is
which is no coincidence at all. Arranging Y’s and X’s in a row is precisely choosing which of the positions hold a Y. Back in the binomial theorem those positions were the factors of that donate their . The same number keeps answering the same question in different clothes.
Worked example 5 Arrange the letters of MISSISSIPPI
The word MISSISSIPPI has letters. How many distinguishable arrangements are there?
Count the letters by type first, and check that the counts add to :
Had all letters been different there would be arrangements. Each actual word is produced times by the tagged letters, so divide:
Carry out the division:
There are arrangements. The for the single M is harmless, since , but writing it down is a cheap way to make sure the type counts really do add up to .
Check your understanding
How many distinguishable arrangements are there of the letters in the word LETTER?
LETTER has letters, but the two E's are identical and so are the two T's. If all six letters were different there would be arrangements, and each actual word is produced times over by those two repeated pairs.
Dividing by only one of the two repeated pairs, , forgets that both letters repeat, not just one.
Complementary counting
Some sets are far easier to count by counting what you do not want. If every object either has a property or fails to have it, then those two cases overlap nowhere and cover everything. So the addition principle says the two counts add to the total. Rearranged, that is complementary counting:
The flagship case is at least one. The opposite of “at least one” is “none”. And “none” is usually a single clean count, while “at least one” splits into a pile of cases (exactly one, exactly two, exactly three, and so on). Counting the total and subtracting the “none” case replaces all of that work with one subtraction.
It is also a guard against a specific and very common error. Faced with “at least one woman on the committee”, the tempting move is to appoint one woman first, then fill the rest of the committee freely. That method builds a committee with two women twice, once for each woman it could have appointed first. The division principle cannot repair the damage, because committees with three women are built three times and the overcount is uneven. The next example shows the two answers side by side.
Worked example 6 At least one woman on the committee
A committee of is chosen from men and women. How many committees contain at least one woman?
The group has people in total, and a committee is an unordered set of , so there are
committees in all. The committees without a woman are made entirely of the men:
Every committee either has at least one woman or has none, never both, so subtract:
There are committees with at least one woman.
Now watch the tempting method fail. Appoint one of the women, then fill the remaining seats from the other people, giving . That is nearly double the truth, because a committee holding the women Ana and Bea is produced twice. That committee is produced once by appointing Ana first and once by appointing Bea first, while a committee holding three women is produced three times. The overcount is uneven, so no single division fixes it. Subtracting the complement never runs into this problem.
Check your understanding
A coin is flipped times, giving possible sequences of heads and tails. In how many of them does at least one head appear?
Counting the sequences with at least one head directly would mean adding up the cases with exactly one head, exactly two heads, and so on, up to six. Count the opposite instead.
The sequences with no head are the ones that are all tails, and there is exactly of those. Subtract it from the total.
So sequences contain at least one head. Answering counts only the sequences with exactly one head, which is a different and much smaller set.