Distinct arrangements of objects with repeats: the n! over r1! ... rk! formula and the binary two-type special case
“Count the distinct arrangements of n objects when some are identical: divide n! by the factorial of each repeat count to get n! over r1! r2! ... rk!, and handle the two-type special case where every object is one of two kinds (2^n arrangements in all, or choose the positions of one kind with a combination)”
When some objects are identical, plain overcounts, because swapping identical copies changes nothing. Divide by the factorial of each repeat count: the number of distinct arrangements of objects with alike of each type is , for example for the letters of . When every object is one of just two kinds there are patterns in all, and exactly of one kind number , for example traffic-light patterns and with exactly red; by symmetry is also . Shorter words split into cases over the omitted letter, and "two identical items separated" is the complement , with no on an identical block.
Jump to a section
What this dot point is asking
The multiplication principle and ordered selections page counted arrangements of objects that were all different: distinct objects line up in ways, and you choose and order of them in ways. Every one of those counts quietly assumed the objects were distinguishable, so that swapping any two of them produced a genuinely new arrangement. This page removes that assumption. When some of the objects are identical, swapping two of them produces the same arrangement, and the old counts overcount.
The whole dot point is one idea and one formula. Plain counts every ordering as if the objects were all different; to fix it you divide by the factorial of each repeat count, because the identical copies of one type can be permuted among themselves in that many ways without changing anything. That gives the formula
where are how many there are of each repeated type. The second half of the dot point is the two-type special case, where every object is one of just two kinds (heads or tails, on or off, red or green). It has two faces that are really the same count: there are arrangements in all, and the arrangements with exactly of one kind number . Reading the wording, naming the repeats, and laying the division out so a marker can follow it is the entire skill.
The answer
Why plain n! overcounts, and the dividing-out fix
Take the word . It has letters, so if the letters were all different there would be arrangements. But they are not all different: there are three s and two s. Pick any one arrangement, say itself, and imagine the three s wore tiny labels . Those three labelled s could be permuted among their three positions in ways, and all six labelled versions spell the same word once the labels come off. So the count has counted this one word times over. The same happens with the two s: each word is counted times because the s can swap. The two overcounts are independent and multiply, so every genuine word has been counted times. Dividing it out,
That is the engine of the whole topic: you are not counting fewer things, you are correcting a count that listed each thing too many times. The number you divide by is exactly "how many ways the identical copies can be shuffled without anyone noticing".
The table is the layout to copy into an exam. List every letter type, its repeat count , and the overcount it causes; the bottom row reads off and the divisor . A type that appears once, like and here, contributes and so changes nothing; you can leave it in or out of the divisor, but listing it stops you from miscounting .
The identical-elements formula. If objects consist of alike of one type, alike of another, and so on up to alike of the last type (so ), the number of distinct arrangements of all of them is
Plain would count each arrangement times, once for every way the identical copies could be permuted without changing it; dividing removes the overcount. Any type with contributes and may be omitted from the divisor.
A mix of some distinct and some repeated
The formula does not need every letter to repeat; it just divides by the repeats that exist. Consider arranging the letters of . There are two s and two s, while and appear once each. With and repeat counts and ,
If a question changes one object to make it distinct, the divisor loses a factor and the count grows. Cambridge's wine-glass example is the model: three identical wine glasses and five identical tumblers in a row give patterns, because there are only two types. But if one wine glass becomes clearly chipped and two of the five tumblers are replaced by a matching different pair, the eight objects split into types of sizes (two plain wine glasses, one chipped glass, three original tumblers, two replacement tumblers), and the count rises to
Making objects more distinct always increases the count, because there is less to divide out. The extreme is all eight different, giving the full .
Words that omit or include a letter: split into cases
A common twist asks for words shorter than the full set, for example "how many six-letter words use the letters of ?" Now you are not arranging all seven letters, so you cannot write a single . The clean route is to split into cases by which letter is left out, count each case with the formula, and add. Omitting one letter leaves six letters to arrange, and the available repeats depend on which type you dropped.
- Omit an : the six letters are (two s, two s), giving .
- Omit an : the six letters are (three s), giving .
- Omit the : the six letters are (two s, three s), giving .
- Omit the : by the same shape, .
The cases drop different letters and so cannot overlap, so you add: . (It is a pleasant coincidence that this equals the full seven-letter count; the two questions are different and the equality is not a rule.) The lesson is that a short-word question over a multiset is a cases question: dropping a repeated letter changes the divisor, so you must treat each dropped type separately.
The two-type special case: 2^n and choosing positions
When every object is one of just two kinds, the topic has a particularly clean shape that the next sections of the course lean on heavily. Picture a motorist passing sets of traffic lights, each red or green; or an opinion poll of yes/no questions; or switches each up or down. Each setup is a "word" of length in a two-letter alphabet.
There are two counts to know, and they are two views of the same arrangements.
All patterns: . Each of the positions is filled independently with one of two symbols, so by the multiplication principle the number of patterns is . For the eight lights, .
Exactly of one kind: a combination. Fix how many are red, say , and a pattern is determined entirely by which of the positions are red; the rest are green. That is a selection of positions, . Equivalently it is the identical-elements formula for a word of reds and greens,
For exactly red out of , this is .
Two facts fall straight out of this picture and are worth carrying forward. First, symmetry: choosing the reds is the same as choosing the greens, so . That is why "exactly of red" and "exactly of red" give the same answer, ; a Cambridge exercise asks precisely this. Second, the row adds to : summing the exact- counts over every from to recovers the total, , since every pattern has some number of reds. For the eight-plus-one counts sum to . You meet formally on the combinations page; here it is just "how many words of of one letter and of the other".
The two-type (binary) special case. When each of objects is one of exactly two kinds:
These are one set of arrangements seen two ways: (choosing the of one kind is choosing the of the other), and summing over all gives .
Separating identical items, using the complement
"Must be separated" works exactly as it does for distinct items, with one simplification: an identical pair has no internal order to track. To count arrangements where two identical items are apart, count the total, then subtract the arrangements where they are together (found by gluing them into one block), because "apart" is the complement of "together".
Take , with three times and twice. The total number of arrangements is . For the unwanted "two s together", glue the two s into a single block; the items to arrange are that block plus , that is items with repeated three times, giving . The key subtlety is that the block contributes no internal , because the two s are identical, so swapping them inside the block changes nothing. Subtracting,
arrangements have the s apart. Compare this with the distinct-letter version on the grouping, complement and cases page, where a together-block of two distinct letters does carry a . Identical items drop that factor; distinct items keep it.
Separating identical items. To count arrangements of a multiset with two identical items kept apart, use the complement:
The "together" count glues the identical pair into one block and arranges the resulting smaller multiset; because the pair is identical, the block has internal order, so there is no factor (unlike a block of two distinct items).
How exam questions ask about this dot point
The wording tells you which form of the count to use. Match the phrase to the move:
- "...arrangements of the letters of the word ", "rearrange", "how many distinct words". The base case: write with one factor for each repeated letter.
- "...how many different numbers from the digits ", "patterns of identical and different objects". The same formula; the "letters" are digits or objects, and identical objects are the repeats.
- "...each is red or green / yes or no / on or off", "how many possible answer sheets / patterns". Two-type case, all patterns: .
- "...exactly are red / yes / heads", " of one kind and the rest the other". Two-type case, fixed count: .
- "...what other number gives the same answer", "exactly versus exactly ". Symmetry ; the complementary count is identical.
- "...-letter words from a word of letters" with . Cases by which letter type is omitted; arrange the remaining multiset and add the disjoint cases.
- "...the two s (or two identical items) are separated / not together". Complement: total minus the "together" block count, with no internal on the identical block.
- "...vowels and consonants alternate" with repeats. Fix the alternating slot pattern, then apply the formula to each group separately and multiply.
Count the arrangements of a word with two repeated letters
How many distinct arrangements are there of all seven letters of the word ?
Count the letters and find the repeats. There are letters. The repeats are three times and twice; and appear once each.
Write plain first. If the letters were all different there would be
Divide by each repeat factorial. The three identical s can be permuted in ways and the two identical s in ways without changing the word, so each genuine word was counted times:
Final answer. There are distinct arrangements. The single letters and contribute each, so they do not change the divisor.
Arrange a mix of identical and distinct objects
Eight objects are placed in a row: three identical wine glasses and five identical tumblers. (i) How many distinct patterns are there? (ii) One wine glass is now clearly chipped, and two of the tumblers are replaced by a matching pair different from the other three. How many patterns are there now?
Part (i): two types only. The eight objects are alike of one type and alike of another, so
Part (ii): re-sort into the new types. The chipped glass is now its own type, and the replacement tumblers are a new type. The eight objects split into sizes (plain glasses), (chipped glass), (original tumblers) and (replacement tumblers).
Apply the formula with the new repeats.
Final answer. (i) patterns; (ii) . Making objects more distinct removes factors from the divisor, so the count rises from towards the all-different maximum .
Count shorter words by cases over the omitted letter
How many six-letter words can be formed using six of the seven letters of ?
See that exactly one letter is omitted. A six-letter word uses six of the seven letters, so one letter is left out. The remaining six are then arranged, and the repeats depend on which letter type was dropped, so split into cases.
Case 1, omit an . The remaining letters are (two s, two s):
Case 2, omit an . The remaining letters are (three s):
Case 3, omit the . The remaining letters are (two s, three s):
Case 4, omit the . By the same shape as Case 3, .
Add the disjoint cases. The cases omit different letters and cannot overlap:
Final answer. There are six-letter words. Each case has its own divisor because dropping a repeated letter changes how many repeats remain.
Count a two-type arrangement two ways
A motorist drives through sets of traffic lights, each of which is red or green. (i) In how many ways can the colours come up? (ii) In how many of those is the motorist stopped at exactly red lights? (iii) What other number of red lights gives the same answer as part (ii)?
Part (i): two choices, eight times. Each set is independently red or green, so
Part (ii): choose which positions are red. A pattern with exactly reds is fixed by choosing which of the positions are red:
- Check with the two-type formula
- Reading the lights as a word of reds and greens gives , the same value.
- Part (iii): use symmetry
- Choosing the red positions is the same as choosing the green positions, so . Exactly red lights also gives .
- Final answer
- (i) ; (ii) ; (iii) exactly red lights, also .
Arrange with vowels and consonants alternating
In how many distinct arrangements of the nine letters of do the vowels and consonants alternate?
- Split into vowels and consonants
- The vowels are ( vowels, repeated), and the consonants are ( consonants, repeated).
- Fix the only possible alternating pattern
- With consonants and vowels, the alternation across nine places must start and end on a consonant: . The other start would need vowels, which do not exist, so there is exactly slot pattern.
- Arrange each group with its repeats
- The five consonants (with twice) fill the consonant slots in ways, and the four vowels (with twice) fill the vowel slots in ways.
- Multiply the independent choices
Final answer. There are alternating arrangements. The single slot pattern is what makes this a clean product; if the two groups were equal in size there would be two patterns to add.
Separate two identical letters using the complement
In how many distinct arrangements of the six letters of are the two s separated by at least one other letter?
Recognise "separated" as a complement. Count the total, then subtract the arrangements where the two s are together.
Count the total. With three times and twice,
Count the unwanted (the s together). Glue the two s into one block. The items to arrange are the block plus , that is items with repeated three times. Because the two s are identical, the block has only internal order:
Subtract.
Final answer. There are arrangements with the s apart. The block carries no here, because swapping the two identical s inside it changes nothing; that factor only appears when the paired items are distinct.
- Forgetting to divide by the repeats
- Writing for instead of overcounts by a factor of . Always scan for repeated objects before you commit to .
- Dividing by the wrong factorials
- The divisor uses the repeat counts, not the number of types. For (two s, two s) the divisor is , not and not . List each type with its own .
- Putting a on an identical block
- When two identical items must be together, the block has only one internal order, so there is no . That factor belongs to a block of two distinct items, not identical ones.
- Treating an -letter word as one formula
- If the word is shorter than the full multiset, one or more letters are omitted; the available repeats change with which type you drop. Split into cases by the omitted letter and add.
- Mixing up and
- "How many possible answer sheets" wants every pattern, . "How many with exactly yes" wants . Read whether the count of one kind is fixed.
- Missing the symmetry shortcut
- Exactly of one kind and exactly of that kind give the same count, . A "what other number gives the same answer" question is asking for .
Markers reward seeing , the repeats, and the division laid out so each piece is checkable. Lock in the marks like this:
- State and every repeat count first. Write " letters: , " before the fraction, so the method mark is secured even if the arithmetic slips. A small type/count table is fast and persuasive.
- Show the fraction, not just the answer. Write and then its value ; a bare number earns less and is hard to follow.
- Name the two-type form you are using. Write " for all patterns" or " for exactly ", so it is clear which count the wording asked for.
- For short words, declare the cases. Write "omit each letter type in turn" and list the four sub-counts; state that the cases are disjoint before you add.
- For separation, write the complement line. , then evaluate each piece, and note explicitly that the identical block has no internal .
- Keep one source of truth. If a sub-count (a total, a block count) appears twice, compute it once and reuse it, so a slip cannot creep into only one place.
Practice questions
Original practice questions graded from foundation to exam level, each with a full worked solution. Try them before revealing the solution.
foundation2 marksHow many distinct arrangements are there of all the letters of the word ?Show worked solution →
Count the letters and the repeats. has letters. The repeats are twice, twice and twice; , and appear once each.
Divide by each repeat factorial. With and repeat counts ,
Answer. There are distinct arrangements. Forgetting any one of the three factors would multiply the answer by .
foundation2 marksThe six digits are used to form a six-digit number (every digit used once). How many different numbers can be formed?Show worked solution →
Identify the repeats among the six digits. There are digits, with appearing three times and appearing twice; appears once.
Apply the formula. With and repeat counts and ,
Answer. There are different six-digit numbers. No digit is , so there is no leading-zero case to remove.
core3 marksA row of identical light switches is set up, and each switch is flicked either up or down. (i) In how many ways can the whole row be set? (ii) In how many of those settings are exactly switches up?Show worked solution →
Part (i): two choices at each of ten positions. Each switch is independently up or down, so by the multiplication principle the number of settings is
Part (ii): choose which positions are up. A setting with exactly ups is fixed once you choose which of the positions are up; the rest are down. That is a selection of positions,
Same answer the two-type way. Treating the row as a word of ups and downs gives , the identical count.
Answer. (i) settings; (ii) of them.
core3 marksHow many five-letter words can be formed using five of the six letters of the word ? (A 'word' is any arrangement; it need not be in a dictionary.)Show worked solution →
See that one letter must be left out. has letters three times, twice and once. A five-letter word uses five of the six letters, so exactly one letter is omitted. Split into cases by which letter type is dropped.
Case: omit an . The remaining letters are ( As, Ns),
Case: omit an . The remaining letters are ( As),
Case: omit the . The remaining letters are ( As, Ns),
Add the disjoint cases. The three cases drop different letters, so they cannot overlap:
Answer. There are such five-letter words.
exam4 marksConsider all distinct arrangements of the letters of the word . (i) How many are there in total? (ii) In how many of them are the two s separated (not next to each other)?Show worked solution →
Part (i): divide by the repeats. has letters, with three times and twice,
Part (ii): count the complement (the s together). Counting "separated" directly is awkward, so count the arrangements with the two s together and subtract. Glue the two s into one block. The items to arrange are then the block plus , that is items with repeated three times,
Because the two s are identical, the block has only internal order, so there is no extra factor here.
Subtract from the total.
Answer. (i) arrangements; (ii) with the s apart.
exam5 marksIn how many distinct arrangements of the nine letters of the word do the vowels and consonants alternate?Show worked solution →
- Separate the letters into vowels and consonants
- has letters. The vowels are ( vowels, with repeated), and the consonants are ( consonants, with repeated).
- Fix the alternating pattern
- With consonants and vowels, the only way to alternate across nine places is consonant, vowel, consonant, , consonant, that is . There is exactly such pattern of slots (starting and ending on a consonant); the other start, , would need vowels.
- Arrange the consonants in their five slots
- Five consonants with repeated twice give
Arrange the vowels in their four slots. Four vowels with repeated twice give
Multiply (independent choices).
Answer. There are alternating arrangements.