Counting Principles, Permutations, and Combinations
Learning goals
- Multiply the stage counts when each is independent of the past
- Add case counts that overlap nowhere and miss nothing
- Ask whether order matters and whether repeats are allowed
- Compute as a product of exactly factors
- Divide by to forget the order, giving
- Count the unwanted and subtract, for at least one
The multiplication principle
Start with the rule you already trust and state it precisely enough to prove, because the precision is what lets you use it in cases where 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
Why a sequence of independent decisions multiplies#
Add the stages one at a time. With a single decision the count is , which is the claim for .
Now suppose the first decisions produce exactly different partial objects, and bring in the last decision. Each of those partial objects can be finished in exactly ways, since that is the hypothesis. The hypothesis says the number of options at the last stage does not depend on what came before it.
Those completions are all different, and for two separate reasons. Two completions of the same partial object differ in the final decision, so they are different. Two completions of different partial objects already differed before the final decision was made, so they are different too. And nothing is missed: any finished object comes from exactly one partial object, namely its own first decisions, followed by one last decision.
So the finished objects fall into groups of , one group per partial object, and the total is . Since each new stage multiplies the running total by its own option count, the product formula holds for every .
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 exactly what makes permutations legal, and it is why “the choices are independent” is a sloppy way to state the rule.
One companion rule handles the problems that break into cases. 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, and in practice the two rules divide the work like this. A sequence of decisions multiplies (“this and then that”), while a split into separate cases adds (“either this kind or that kind”).
The simplest use of the multiplication principle is the one where nothing changes between stages. Suppose you fill slots, and each slot independently 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. Look closely at what that cancellation is allowed to say. The tail is an honest product of positive whole numbers only when , so the derivation above establishes the closed form for and reaches no further. The case is precisely the one it misses, and it is the case where would have to mean something. So do not pretend the formula already covers it. Ask instead what value would let one formula cover it.
The slot count is not in doubt: arranging all objects gives . If the single closed form is to serve the edge case as well, it must return that same number, and there it reads . Setting the two equal, , leaves exactly one possible value:
That is what “forced” means here. The value is not picked for convenience; it is the only one under which the formula and the count do not contradict each other. The binomial theorem lesson took as the convention that made its formula come out right at the edges, and this is the reason the convention had no choice. It also agrees with what the factorial means, since counts the arrangements of objects. And there is exactly one way to arrange no objects at all, the empty arrangement in which you do nothing.
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 is the mirror image of the multiplication principle.
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 by deliberately overcounting it. The trick is to count something you already know how to count, the ordered lists, in two different ways.
The direct count of #
Fix and with , and let be the collection of ordered lists of distinct objects drawn from the available. We count 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
Equate the two counts. The same collection was counted both times, so
and dividing by isolates the number we wanted:
That is the second, independent proof of the closed form that the binomial theorem lesson promised you. There the formula was verified indirectly, by showing that obeys Pascal’s rule and matches at the ends of each row, so it had to agree with the triangle everywhere. Here it came straight out of counting, with no recurrence anywhere in sight. The two arguments meet at the same formula from opposite directions.
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.
The picture is the proof in miniature. Choosing letters from gives ordered lists, they fall into columns of that differ only by rearrangement, and so the number of sets is
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, cancelling 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. These choices are independent, 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 .
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.