Skip to main content
NSWMaths Extension 1Syllabus dot point

When an ordered arrangement carries a restriction, how do you choose between grouping items into a block, counting the complement, and splitting into cases with an overlap correction?

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

The three restriction moves the HSC Extension 1 counting dot point keeps testing. Group tied items into a block and order inside it, count the unwanted and subtract it (the complement), and split an 'or' count into cases, subtracting the overlap by inclusion-exclusion. Includes a symmetry shortcut, slot diagrams and a Venn picture.

Generated by Claude Opus 4.817 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. How exam questions ask about this dot point

What this dot point is asking

The multiplication principle and ordered selections page gave you the engine for counting in stages, the powers nrn^r and permutations nPr^{n}P_{r}, 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 AB=A+BAB|A \cup B| = |A| + |B| - |A \cap B| 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 1!=11! = 1 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 55 groups in all. Order the 55 groups in 5!5! ways, order the couple internally in 2!2! ways, and order the three girls internally in 3!3! ways:

5!×2!×3!=120×2×6=1440.5! \times 2! \times 3! = 120 \times 2 \times 6 = 1440.

The block method: collapse each tied group into one slotEight people in a queue: a couple and a block of three girls must each stay together, with three free boys. Glue the couple and the three girls so each becomes a single block, leaving five groups. Order the five groups in five factorial ways, then order inside the couple in two factorial and inside the girls in three factorial. The total is five factorial times two factorial times three factorial, which equals 1440.The block method: glue each tied group into one slotCCGGGbbbstay togetherstay togetherglue each tied group ↓ one block5[CC] block×4[GGG] block×3×2×1order the 5 groups× 2!in couple× 3!in girls5! × 2! × 3! = 120 × 2 × 6 = 1440

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 5×4×3×2×1=5!5 \times 4 \times 3 \times 2 \times 1 = 5!. The two tails on the right, ×2!\times 2! and ×3!\times 3!, are the internal orders of the couple and the girls. The single boys add no tail because 1!=11! = 1.

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.

(wanted)=(total)(unwanted).(\text{wanted}) = (\text{total}) - (\text{unwanted}).

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 A,B,C,D,E,F,GA, B, C, D, E, F, G, with the two vowels AA and EE required to be separated by at least one consonant. The total number of arrangements of seven distinct letters is 7!=50407! = 5040. The unwanted arrangements are those with AA and EE together; glue them into a block, leaving 66 items in 6!6! ways with 2!2! internal orders, so the together count is 2!×6!=14402! \times 6! = 1440. Therefore

7!2!×6!=50401440=36007! - 2! \times 6! = 5040 - 1440 = 3600

words have the vowels apart. The "2×6!2 \times 6!" is just 2!×6!2! \times 6!; it is the whole unwanted block count, not a stray factor.

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:

AB=A+BAB,|A \cup B| = |A| + |B| - |A \cap B|,

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 10001000 are odd and greater than 500500, or are a multiple of 55 and less than 200200? There are 250250 odd numbers from 501501 to 999999, and there are 4040 multiples of 55 below 200200 (counting 00). No number can be both greater than 500500 and less than 200200, so the cases cannot overlap and you add: 250+40=290250 + 40 = 290.

Now an overlapping count, which is where inclusion-exclusion earns its keep. How many three-digit numbers (from 100100 to 999999) are odd and greater than 500500, or a multiple of 55 and less than 700700? Let AA be the odd numbers above 500500 and BB the multiples of 55 below 700700. There are 250250 numbers in AA (the odd numbers 501501 to 999999) and 120120 numbers in BB (the multiples of 55 from 100100 to 695695). This time the cases overlap: an odd multiple of 55 between 501501 and 699699 lies in both. Those are the numbers 505,515,,695505, 515, \dots, 695, of which there are 2020. So

AB=250+12020=350.|A \cup B| = 250 + 120 - 20 = 350.

Two overlapping cases: add, then subtract the overlapTwo overlapping sets A and B. The size of A or B equals the size of A plus the size of B minus the size of the overlap A and B, so that the shared region is not counted twice. With A of size 250, B of size 120 and overlap 20, the union is 250 plus 120 minus 20, which is 350.Overlapping cases: add them, then subtract the overlapAB230A only20both100B only|A ∪ B| = 250 + 120 − 20 = 350

The Venn picture makes the bookkeeping obvious. The left circle holds 250250, the right holds 120120, but the lens where they meet holds 2020 counted in both. Adding 250+120250 + 120 counts that lens twice, so subtracting 2020 once leaves each region counted exactly once: the three regions hold 230230, 2020 and 100100, totalling 350350.

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 "AA is somewhere to the left of BB" in a row of distinct items, where AA and BB need not be adjacent. In any arrangement, exactly one of two things is true: AA is left of BB, or BB is left of AA. Reversing the row, or just swapping the two labels, pairs each "AA left of BB" arrangement with exactly one "BB left of AA" arrangement, so the two outcomes are equally likely. Neither is special, so exactly half of all arrangements have AA to the left of BB.

For example, in arrangements of the six distinct letters of NUMBER\text{NUMBER}, the number with NN somewhere to the left of UU is half of the total:

6!2=7202=360.\frac{6!}{2} = \frac{720}{2} = 360.

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 13!\tfrac{1}{3!}, 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 k!k! 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 ki!k_i! 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.
  • "...XX or YY..." where no single slot diagram fits. Cases: split, count each, add. Check overlap first.
  • "...XX or YY..." where an item can satisfy both. Inclusion-exclusion: A+BAB|A| + |B| - |A \cap B|, subtracting the overlap once.
  • "...XX somewhere to the left of / before YY", two distinguishable items. Symmetry: halve the total, 12×(total)\tfrac{1}{2} \times (\text{total}).

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 22 blocks to arrange in the row.
Order the blocks
The 22 blocks can be placed in 2!=22! = 2 orders (maths block then science block, or the reverse).
Order inside each block
The maths books rearrange among themselves in 3!=63! = 6 ways and the science books in 4!=244! = 24 ways. By the multiplication principle,

2!×3!×4!=2×6×24=288.2! \times 3! \times 4! = 2 \times 6 \times 24 = 288.

Answer. There are 288288 arrangements.

foundation3 marksFive people stand in a row. Two of them, PP and QQ, 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 PP and QQ ARE together and subtract from the total.

Count all arrangements. Five distinct people in a row give

5!=120.5! = 120.

Count the unwanted (together) by the block method. Glue PP and QQ into one block, leaving 44 items to arrange in 4!4! ways, with 2!2! internal orders:

4!×2!=24×2=48.4! \times 2! = 24 \times 2 = 48.

Subtract. The arrangements with PP and QQ apart are

12048=72.120 - 48 = 72.

Answer. There are 7272 acceptable arrangements.

core3 marksHow many three-digit whole numbers (from 100100 to 999999) are even or divisible by 55?
Show worked solution →

Spot the overlap and reach for inclusion-exclusion. "Even" and "divisible by 55" can both hold at once (a number divisible by 1010), so the two cases overlap. Use AB=A+BAB|A \cup B| = |A| + |B| - |A \cap B|.

Count the even three-digit numbers. From 100100 to 998998 inclusive, stepping by 22, there are

9981002+1=450.\frac{998 - 100}{2} + 1 = 450.

Count those divisible by 55. From 100100 to 995995 inclusive, stepping by 55,

9951005+1=180.\frac{995 - 100}{5} + 1 = 180.

Count the overlap (divisible by 1010). From 100100 to 990990 inclusive, stepping by 1010,

99010010+1=90.\frac{990 - 100}{10} + 1 = 90.

Apply inclusion-exclusion.

450+18090=540.450 + 180 - 90 = 540.

Answer. There are 540540 such numbers.

core2 marksSeven different people stand in a row. In how many of the arrangements is a particular person, XX, standing somewhere to the left of another particular person, YY? (They need not be adjacent.)
Show worked solution →

Use the symmetry argument. In any arrangement either XX is left of YY or YY is left of XX, and reversing the roles pairs the two situations one-to-one. Neither is special, so exactly half of all arrangements have XX to the left of YY.

Count all arrangements. Seven distinct people in a row give

7!=5040.7! = 5040.

Halve.

7!2=50402=2520.\frac{7!}{2} = \frac{5040}{2} = 2520.

Answer. In 25202520 arrangements XX is somewhere to the left of YY.

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 66 items (the block plus the other 55 books) to arrange.

Order the items, then inside the block. The 66 items go in 6!6! ways and the block has 3!3! internal orders:

6!×3!=720×6=4320.6! \times 3! = 720 \times 6 = 4320.

Part (ii): fix the internal order. "Together and in series order" means the block is still 11 item, but now its three volumes have only 11 acceptable internal order instead of 3!3!:

6!×1=720.6! \times 1 = 720.

Sanity check. Of the 3!=63! = 6 internal orders, exactly 11 is the correct series order, so part (ii) should be 16\tfrac{1}{6} of part (i): 16×4320=720\tfrac{1}{6} \times 4320 = 720, which agrees.

Answer. (i) 43204320; (ii) 720720.

exam4 marksA five-digit string is formed from the digits 00 to 99 with repetition allowed (a leading 00 is permitted, so any of 0000000000 to 9999999999 may occur). How many such strings contain at least one 33 or at least one 77 (or both)?
Show worked solution →

Read it as a union of two 'at least one' conditions. Let AA be the strings with at least one 33 and BB those with at least one 77; the question asks for AB|A \cup B|. The cleanest route is the complement of the union.

Count the total. Five positions, each any of 1010 digits:

105=100000.10^5 = 100\,000.

Count the strings in neither set (no 33 and no 77). Each position avoids both 33 and 77, leaving 88 digits:

85=32768.8^5 = 32\,768.

Subtract: at least one 33 or one 77 is everything except neither.

10000032768=67232.100\,000 - 32\,768 = 67\,232.

Confirm with inclusion-exclusion. A=10595=40951|A| = 10^5 - 9^5 = 40\,951 and B=40951|B| = 40\,951. The overlap, at least one 33 AND at least one 77, is AB=1052(95)+85=14670|A \cap B| = 10^5 - 2(9^5) + 8^5 = 14\,670. Then AB=40951+4095114670=67232|A \cup B| = 40\,951 + 40\,951 - 14\,670 = 67\,232, the same value.

Answer. 6723267\,232 strings.

Related dot points