Three counting principles for restricted arrangements: grouping into blocks, counting the complement, and splitting into cases with inclusion-exclusion
“Apply three reusable counting principles to ordered arrangements with restrictions: keep tied items together by grouping them into a block and ordering inside it, count an unwanted condition and subtract it from the total (the complement), and split an 'or' count into non-overlapping cases, subtracting the overlap by inclusion-exclusion when the cases meet”
Three moves handle restricted ordered arrangements. Grouping (the block method): when items must be together, glue them into a block, order the groups, then multiply by for the inside of each block, for example a couple with a block of three girls gives . The complement: count "at least one", "not all" or "separated" as , for example two vowels apart is . Cases: split a hard "or" into cases and add, subtracting the overlap once when the cases meet, by inclusion-exclusion , for example . A fourth shortcut is symmetry: one item "somewhere to the left of" another distinct item happens in exactly half the arrangements, for example for left of in .
Jump to a section
What this dot point is asking
The multiplication principle and ordered selections page gave you the engine for counting in stages, the powers and permutations , and the first two restriction moves: deal with the hardest box first, and fix a forced position. This page is about the three principles that handle the harder restrictions, the ones that decide most of the marks on a counting question. Each is a way of reshaping a question you cannot box directly into one you can.
The three moves are grouping, the complement, and cases. Grouping handles "must be together": glue the tied items into a single block, order the blocks, then order inside each block. The complement handles "at least one", "not all" and "must be separated": count the unwanted arrangements and subtract them from the total. Cases handle a genuine "or" that no single box diagram captures: split into separate cases and add, and if the cases overlap, subtract the overlap so nothing is counted twice. That last subtraction is the inclusion-exclusion principle, the same you met in set theory. The whole skill is reading the wording, picking the move, and laying the working out so a marker can follow it.
The answer
Principle 1: grouping (the block method)
When certain items must stay together, you cannot order them as if they were free, because the arrangement has to keep them adjacent. The fix is to glue the tied items into a single block and treat that block as one item. The arrangement now has fewer items, the block plus everything else, and you order those in the usual way. Then, because the items inside a block can still be shuffled among themselves while staying adjacent, you separately order the inside of each block and multiply. In short: order the groups, then order within each group.
A group can even be a single item, which orders in way and so contributes nothing, but it is worth listing the groups explicitly so you do not miscount how many there are. The classic question stacks two groups at once. Four boys and four girls form a queue; one couple (one boy and one girl) want to stand together, and three particular girls also want to stand together, while the remaining three boys do not mind where they go. Count the groups: the couple is one group, the three girls are one group, and each of the three free boys is a group of one, giving groups in all. Order the groups in ways, order the couple internally in ways, and order the three girls internally in ways:
The slot diagram shows the idea exactly. The eight people collapse into five group-slots, two of them glued blocks drawn with a heavier outline, and you order those five in . The two tails on the right, and , are the internal orders of the couple and the girls. The single boys add no tail because .
The grouping (block) principle. If certain items must stay together, glue them into a single block and count
If the items split into groups (a block of items counts as one group, a lone item as a group of one), order the groups in ways and multiply by for the inside of each block. A block of contributes ; a lone item contributes .
Principle 2: the complement (count the unwanted and subtract)
Some conditions are awkward to count head-on but easy to count in reverse. "At least one" is the signature example, because counting it directly forces you to add the cases exactly one, exactly two, and so on. The escape is the complement: count the arrangements that fail the condition, the ones with none of the wanted feature, and subtract from the total.
The complement is also the fastest way to count "must be separated", which is the exact mirror of grouping. To separate two items, count every arrangement, then subtract the arrangements where they are together (which you get from the block method). Take seven-letter words formed from the letters , with the two vowels and required to be separated by at least one consonant. The total number of arrangements of seven distinct letters is . The unwanted arrangements are those with and together; glue them into a block, leaving items in ways with internal orders, so the together count is . Therefore
words have the vowels apart. The "" is just ; it is the whole unwanted block count, not a stray factor.
The complement principle. When the wanted condition splits into many cases but its negation is a single clean count, use
"At least one" subtracts the "none" count. "Must be separated" subtracts the "together" count, and "together" is itself a block-method count. The trigger words are at least one, at most, not all, and must be apart.
Principle 3: cases (split, add, and subtract any overlap)
Sometimes the conditions are so awkward that no single box diagram can capture them, and the honest thing is to split the problem into cases, count each separately, and add. The one rule that makes this safe is about overlap. If the cases are genuinely disjoint, that is, no arrangement belongs to two of them at once, you simply add the case counts. If the cases overlap, an arrangement in the overlap gets counted once in each case, so you must subtract the overlap once to correct the double count. For two overlapping cases this is the inclusion-exclusion principle:
the same identity you met for sets. It says: add the sizes of the two cases, then take back the shared part you counted twice.
Here is the contrast in one breath. First a disjoint count. How many whole numbers below are odd and greater than , or are a multiple of and less than ? There are odd numbers from to , and there are multiples of below (counting ). No number can be both greater than and less than , so the cases cannot overlap and you add: .
Now an overlapping count, which is where inclusion-exclusion earns its keep. How many three-digit numbers (from to ) are odd and greater than , or a multiple of and less than ? Let be the odd numbers above and the multiples of below . There are numbers in (the odd numbers to ) and numbers in (the multiples of from to ). This time the cases overlap: an odd multiple of between and lies in both. Those are the numbers , of which there are . So
The Venn picture makes the bookkeeping obvious. The left circle holds , the right holds , but the lens where they meet holds counted in both. Adding counts that lens twice, so subtracting once leaves each region counted exactly once: the three regions hold , and , totalling .
The cases principle (and inclusion-exclusion). Split a hard "or" into cases, count each, and add. First ask whether the cases can overlap.
If an item could satisfy two cases at once, the cases overlap and you must subtract the overlap once. Always minimise the number of cases, and check disjointness before you add.
A fourth trick: counting by symmetry
A few questions reward a one-line symmetry argument instead of any of the three principles. The standard one is " is somewhere to the left of " in a row of distinct items, where and need not be adjacent. In any arrangement, exactly one of two things is true: is left of , or is left of . Reversing the row, or just swapping the two labels, pairs each " left of " arrangement with exactly one " left of " arrangement, so the two outcomes are equally likely. Neither is special, so exactly half of all arrangements have to the left of .
For example, in arrangements of the six distinct letters of , the number with somewhere to the left of is half of the total:
The same halving works for any single "left of" condition on two distinguishable items, because the swap is a perfect pairing. It does not extend naively to three or more items in a fixed order, where the fraction is , nor to items that might be identical, where the swap is not a genuine pairing.
How exam questions ask about this dot point
The wording points straight at the move. Match the phrase to the principle:
- "...must sit together / be next to each other / as a group", "kept together", "the vowels are together". Grouping: glue the tied items into a block, order the groups, then multiply by for the inside of each block.
- "...two groups must each be together", "the boys together and the girls together". Grouping with several blocks: order the groups, then multiply by the internal of every block.
- "...at least one...", "at most...", "not all...". Complement: count the total, subtract the "none" count.
- "...must be separated / not next to each other / no two together". Complement of grouping: total minus the "together" block count.
- "... or ..." where no single slot diagram fits. Cases: split, count each, add. Check overlap first.
- "... or ..." where an item can satisfy both. Inclusion-exclusion: , subtracting the overlap once.
- "... somewhere to the left of / before ", two distinguishable items. Symmetry: halve the total, .
Arrange a queue with two separate groups kept together
Four boys and four girls form a queue. One couple, made of one boy and one girl, want to stand together; three particular girls also want to stand together; the remaining three boys do not mind where they stand. How many acceptable queues are there?
List the groups. The couple is one group, the three tied girls are one group, and each of the three free boys is a group of one. That is groups in total.
Order the groups. The groups can be arranged in
Order inside each block. The couple has internal orders and the three girls have internal orders. The single boys contribute each, so nothing extra. Multiply:
Final answer. There are acceptable queues. Counting only and forgetting the internal and is the usual slip; it undercounts by a factor of .
Separate two vowels using the complement
Seven-letter words are formed using each of the letters once. In how many of them are the two vowels, and , separated by at least one consonant?
Recognise "separated" as a complement. Counting the separated arrangements directly is awkward, so count the total and subtract the arrangements where and are together.
Count all arrangements. Seven distinct letters in a row give
Count the unwanted (vowels together) by the block method. Glue and into one block, leaving items in ways with internal orders:
Subtract.
Final answer. There are words with the vowels apart. "Separated" is just the complement of "together", so the block count is exactly what you take away.
Count an "or" with overlapping cases by inclusion-exclusion
How many three-digit whole numbers (from to ) are odd and greater than , or are a multiple of and less than ?
Name the two cases and test for overlap. Let be the odd numbers greater than and the multiples of less than . A number can be both (an odd multiple of between and ), so the cases overlap and inclusion-exclusion is needed.
Count case . The odd numbers from to are , which number
Count case . The multiples of from to are , which number
Count the overlap . These are the odd multiples of from to , namely (every second multiple of ), which number
Apply inclusion-exclusion.
Final answer. There are such numbers. Adding without removing the overlap double-counts the shared numbers.
Count an arrangement by symmetry
In how many arrangements of the six distinct letters of the word does appear somewhere to the left of ? The letters need not be next to each other.
Set up the symmetry pairing. In every arrangement either is left of or is left of . Swapping the positions of and turns one type into the other and back, a perfect one-to-one pairing, so the two types are equally numerous.
Count all arrangements. Six distinct letters give
Halve. Exactly half have to the left of :
Final answer. In arrangements is somewhere to the left of . The same halving works for any single "left of" condition on two distinct items, because the swap pairs the arrangements exactly.
Combine grouping and the complement
Eight people, including three friends , and , sit in a row of eight seats. In how many arrangements are no two of , , all together as a single block, that is, the three friends do NOT occupy three consecutive seats?
Choose the complement. "Not all three consecutive" is the complement of "all three consecutive", so count the total and subtract the arrangements where , , form one solid block.
Count all arrangements. Eight distinct people give
Count the unwanted (the three in one block) by grouping. Glue , , into one block, leaving items in ways, with internal orders of the block:
Subtract.
Final answer. There are arrangements in which , , are not all three consecutive. Grouping supplies the unwanted count; the complement turns it into the answer.
- Forgetting the internal orders of a block
- Grouping is two stages, not one: order the groups AND order inside each block. A couple together gives , not ; two blocks of sizes and give , not .
- Counting "at least one" or "separated" directly
- Both fragment into overlapping cases. Use the complement: "at least one" is total minus "none"; "separated" is total minus "together".
- Adding overlapping cases without subtracting
- If an item can satisfy two cases at once, adding the case counts double-counts the overlap. Always test disjointness; if the cases meet, subtract once.
- Subtracting an overlap that is empty (or assuming one that is not)
- Inclusion-exclusion needs the real overlap. If no item can be in both cases, the overlap is and you just add; check it rather than guessing.
- Halving when the items can be identical or the order is over three items
- The "left of" symmetry halves only for two distinguishable items. For three items in a fixed order the fraction is , and identical items break the swap pairing entirely.
- Mislabelling
- In the vowel example, is , the full "together" block count, not with a stray . Write it as a block count so the logic is visible.
Markers reward seeing the principle named and the working laid out so each stage is checkable. Lock in the marks like this:
- Say which principle you are using. Write "block method", "complement: total minus together", or "cases with inclusion-exclusion" before the arithmetic. The statement often earns the method mark even if a number slips.
- For grouping, show both stages. Write the group ordering and every internal factor, for example , never a bare final number. Count and state how many groups there are.
- For the complement, write the subtraction line explicitly: , then evaluate each piece. For "separated", show that the unwanted piece is the block count.
- For cases, test overlap first. State "the cases are disjoint" and add, or "the cases overlap by " and subtract once. A quick Venn sketch with the three region counts is persuasive and guards against double counting.
- For a "left of" condition, justify the halving in one line ("by symmetry, left of in exactly half"), then write .
- Keep one source of truth. If a sub-count (like a block total) 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 marksThree different mathematics books and four different science books are arranged in a row on a shelf, with all the books on each subject kept together. In how many ways can this be done?Show worked solution →
- Treat each subject as one block
- Glue the three maths books into one block and the four science books into another. There are then blocks to arrange in the row.
- Order the blocks
- The blocks can be placed in orders (maths block then science block, or the reverse).
- Order inside each block
- The maths books rearrange among themselves in ways and the science books in ways. By the multiplication principle,
Answer. There are arrangements.
foundation3 marksFive people stand in a row. Two of them, and , refuse to stand next to each other. In how many ways can the row be formed?Show worked solution →
Choose the complement. Counting "not next to each other" directly is fiddly, so count the arrangements where and ARE together and subtract from the total.
Count all arrangements. Five distinct people in a row give
Count the unwanted (together) by the block method. Glue and into one block, leaving items to arrange in ways, with internal orders:
Subtract. The arrangements with and apart are
Answer. There are acceptable arrangements.
core3 marksHow many three-digit whole numbers (from to ) are even or divisible by ?Show worked solution →
Spot the overlap and reach for inclusion-exclusion. "Even" and "divisible by " can both hold at once (a number divisible by ), so the two cases overlap. Use .
Count the even three-digit numbers. From to inclusive, stepping by , there are
Count those divisible by . From to inclusive, stepping by ,
Count the overlap (divisible by ). From to inclusive, stepping by ,
Apply inclusion-exclusion.
Answer. There are such numbers.
core2 marksSeven different people stand in a row. In how many of the arrangements is a particular person, , standing somewhere to the left of another particular person, ? (They need not be adjacent.)Show worked solution →
Use the symmetry argument. In any arrangement either is left of or is left of , and reversing the roles pairs the two situations one-to-one. Neither is special, so exactly half of all arrangements have to the left of .
Count all arrangements. Seven distinct people in a row give
Halve.
Answer. In arrangements is somewhere to the left of .
exam4 marksEight different books, including a trilogy of three volumes, are arranged in a row. (i) In how many arrangements do the three trilogy volumes stand together (in any order)? (ii) In how many arrangements do they stand together and in the correct series order (volume 1, then 2, then 3)?Show worked solution →
Part (i): glue the trilogy into a block. Treat the three volumes as one block, leaving items (the block plus the other books) to arrange.
Order the items, then inside the block. The items go in ways and the block has internal orders:
Part (ii): fix the internal order. "Together and in series order" means the block is still item, but now its three volumes have only acceptable internal order instead of :
Sanity check. Of the internal orders, exactly is the correct series order, so part (ii) should be of part (i): , which agrees.
Answer. (i) ; (ii) .
exam4 marksA five-digit string is formed from the digits to with repetition allowed (a leading is permitted, so any of to may occur). How many such strings contain at least one or at least one (or both)?Show worked solution →
Read it as a union of two 'at least one' conditions. Let be the strings with at least one and those with at least one ; the question asks for . The cleanest route is the complement of the union.
Count the total. Five positions, each any of digits:
Count the strings in neither set (no and no ). Each position avoids both and , leaving digits:
Subtract: at least one or one is everything except neither.
Confirm with inclusion-exclusion. and . The overlap, at least one AND at least one , is . Then , the same value.
Answer. strings.