Cambridge International AS & A Level · Topic 5.2
A-Level Maths 9709 / Topic 5.2 / AS & A Level

Order matters.

How many ways can people stand in a line, or letters be arranged, when some letters repeat, some people must stay together and others must be kept apart? Four techniques cover every Paper 5 arrangement question.

The key idea

\(n\) different objects can be arranged in a line in \(n!\) ways. Divide by \(p!\) for each group of \(p\) identical objects. Glue objects that must be together into one unit; for objects that must be apart, subtract the 'together' count from the total or slot them into gaps.

Arrange the 4 boys first: 4! ways BBBB 12345 Then put the 3 girls into 3 of the 5 gaps: 5 × 4 × 3 ways
Fig. 1: the gaps method. No two girls can be next to each other if each girl takes a different gap between or beside the boys: 4! × 5 × 4 × 3 = 1440 arrangements
Section 01

Factorials and repeats.

Fill the places one at a time: \(n\) choices for the first place, \(n - 1\) for the next, and so on, giving \(n! = n(n-1)\cdots 2 \times 1\). If only \(r\) of the \(n\) places are filled, the count is \({}^{n}P_{r} = \dfrac{n!}{(n-r)!}\). Identical objects can swap places without making a new arrangement, so divide by the factorial of each repeat.

Worked example Repeated letters
Find the number of different arrangements of the 8 letters of the word NEEDLESS.
  1. The letters are N, E, E, E, D, L, S, S: three Es and two Ss.
  2. If all were different there would be \(8! = 40\,320\) arrangements.
  3. Swapping the Es among themselves (\(3!\) ways) or the Ss (\(2!\) ways) gives the same word, so divide.
  4. \(\dfrac{8!}{3!\,2!} = \dfrac{40\,320}{12}\).
Answer: 3360
Worked example Filling only some places
Gold, silver and bronze medals are awarded to 3 of 6 runners. In how many ways can this be done?
  1. Gold: 6 choices; silver: 5; bronze: 4.
  2. \({}^{6}P_{3} = 6 \times 5 \times 4\).
Answer: 120
Your turn
Find the number of arrangements of the letters of STATISTICS.
Examiner trap

Dividing by \(3! + 2!\) instead of \(3! \times 2!\). Each repeated group contributes its own factorial to the product in the denominator.

Section 02

Keeping things together.

Glue the objects that must be together into a single block. Arrange the blocks and the remaining objects, then multiply by the number of ways of arranging the objects INSIDE the block.

Worked example Two people together
Seven people stand in a line. In how many ways can they stand if Amir and Bea must be next to each other?
  1. Treat Amir and Bea as one block: there are now 6 units to arrange, in \(6! = 720\) ways.
  2. Inside the block they can stand AB or BA: \(2!\) ways.
  3. \(720 \times 2\).
Answer: 1440
Worked example Letters together, with repeats
In how many arrangements of NEEDLESS are the three Es together?
  1. Glue EEE into one unit. Units: N, EEE, D, L, S, S: 6 units with the two Ss identical.
  2. Arrangements of the units: \(\dfrac{6!}{2!} = 360\).
  3. The three Es are identical, so the block has only 1 internal arrangement.
Answer: 360
Worked example All the vowels together
In how many arrangements of the letters of EQUATION are the five vowels together?
  1. Vowels E, U, A, I, O form one block; with Q, T, N that makes 4 units: \(4! = 24\) ways.
  2. The five different vowels can be arranged inside the block in \(5! = 120\) ways.
  3. \(24 \times 120\).
Answer: 2880
Examiner trap

Forgetting the internal arrangements of the block. With different objects inside, multiply by their factorial; with identical objects inside (EEE), there is nothing to multiply.

Stage 1 · Learn

Check your understanding

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

In how many ways can 5 different books be arranged on a shelf?

Quick check+10 XP

How many arrangements are there of the letters of PEPPER?

Quick check+10 XP

Five people stand in a line. In how many ways can they stand if two particular people must be together?

Quick check+10 XP

In how many ways can gold, silver and bronze be awarded among 6 runners?

Section 03

Keeping things apart.

For two objects that must not be together, take the total and subtract the arrangements where they ARE together. When several objects must all be separated, use the gaps method in Fig. 1: arrange the others first, then drop the separated objects into different gaps.

Worked example Two people apart
Seven people stand in a line. In how many ways can they stand if Amir and Bea must NOT be next to each other?
  1. Total: \(7! = 5040\).
  2. Together (previous section): 1440.
  3. \(5040 - 1440\).
Answer: 3600
Worked example No two girls together
Four boys and three girls stand in a line. In how many ways can they stand if no two girls are next to each other?
  1. Arrange the 4 boys: \(4! = 24\) ways.
  2. This creates 5 gaps (two ends and three between). Each girl must go into a different gap.
  3. The girls are different, so the first girl has 5 gaps, the second 4, the third 3: \(5 \times 4 \times 3 = 60\).
  4. \(24 \times 60\).
Answer: 1440
Worked example Repeated letters apart
In how many arrangements of NEEDLESS are the two Ss not next to each other?
  1. Total: 3360.
  2. Ss together: glue SS, giving 7 units with three Es: \(\dfrac{7!}{3!} = 840\).
  3. \(3360 - 840\).
Answer: 2520
Examiner trap

Using 'total minus together' for three or more people who must all be apart. Subtracting 'all three together' leaves arrangements where two of them are still next to each other. Use the gaps method instead.

Section 04

Fixed places and rows.

Deal with the restricted places first, then fill the rest freely. For people in two (or more) rows, think of the seats as one long list of places: the rows matter only for the restriction.

Worked example Numbers from digits
Four-digit numbers are formed from the digits 1, 2, 3, 4, 5, 6, with no digit repeated. How many are greater than 4000?
  1. The first digit must be 4, 5 or 6: 3 choices.
  2. The remaining three places are filled from the 5 unused digits: \(5 \times 4 \times 3 = 60\).
  3. \(3 \times 60\).
Answer: 180
Worked example Two rows
Ten people sit in two rows of 5. In how many ways can they sit if Chen and Dina must both be in the front row?
  1. Chen has 5 front seats to choose from, then Dina has 4.
  2. The other 8 people fill the remaining 8 seats in \(8! = 40\,320\) ways.
  3. \(5 \times 4 \times 40\,320\).
Answer: 806 400
Worked example Fixed ends
How many arrangements of NEEDLESS begin and end with S?
  1. Both Ss are used at the ends (1 way, since they are identical).
  2. Arrange N, E, E, E, D, L in the middle: \(\dfrac{6!}{3!} = 120\).
Answer: 120
Your turn
How many four-digit numbers greater than 4000 and even can be made from 1, 2, 3, 4, 5, 6 with no repeats?
Examiner trap

When two restrictions overlap (first digit and last digit both even), split into cases. A single product \(3 \times 3 \times 4 \times 3\) double-uses digits like 4 and 6.

Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to AS & A Level Paper 1 to 6 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

Find the number of arrangements of the letters of NEEDLESS in which the three Es are together.

Exam style+20 XP

Seven people stand in a line. In how many ways can they stand if Amir and Bea are not next to each other?

Exam style+20 XP

Four boys and three girls stand in a line. How many arrangements have no two girls next to each other?

Exam style+20 XP

Ten people sit in two rows of 5. In how many ways can they sit if two particular people must both be in the front row?

Skill unlocked

Arrangements, sorted.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
Repeated letters, together and apart, fixed ends, digits with conditions, the gaps method and seating in two rows.