Salam Academy
Permutations and combinations · Subtopic 2 of 3

Arrangements with Restrictions

"Must be at the end", "must be together", "must not be next to each other": deal with the fussy conditions first, then arrange everything else freely. Glue objects together, or slot them into the gaps.

Cambridge 9709 Paper 5≈ 35 minRevision 5 · updated 2026-10-27
Section 1 of 14

Learning objectives

  • Count arrangements where certain objects are in fixed positions.
  • Count arrangements where certain objects are together, by treating them as one block.
  • Count arrangements where certain objects are apart, by subtraction or by the gap method.
  • Count numbers with conditions on their digits.
Pause and think

Six people line up, and Amir and Bushra insist on standing next to each other. How could you count the arrangements without listing them?

Section 2 of 14

Core idea

Start hereThe friends who must sit together

Six people in a row, but Ali and Bea insist on sitting together. Or must be kept apart. Or the two oldest must sit at the ends. Restrictions change the count, and each kind has its own trick.

The big idea

Deal with restrictions first. Together: glue them into one block, arrange, then multiply by arrangements inside the block. Apart: total − together, or arrange the others and slot them into gaps. Fixed positions: fill those first.

1. Together

Glue A and B together, then arrange the blocks
ABCDEFone block (AB or BA: × 2)5 blocks: 5! ways
6 letters with A and B together: 5!×2!=2405!\times2!=240. Arrange 5 blocks, then the 2 letters inside the glued block.
Worked exampleABCDEF with A and B together

Count arrangements.

Goal
Count.
Strategy
Glue.
  1. [AB],C,D,E,F: 5!=120[AB],C,D,E,F:\ 5!=120
    Five blocks.
  2. ×2!\times2!
    AB or BA inside.
Answer240240.
✓ CheckFraction of all 720720: 13\frac13. Plausible: A has a neighbour-slot for B often ✓.

2. Apart

The gaps method: slot the "apart" items between the others
CDEF^^^^^5 gaps for A and B
Arrange C, D, E, F (4!=244!=24 ways). Put A in one of 5 gaps and B in one of the 4 left: 24×5×4=48024\times5\times4=480. Same answer.
Worked exampleA and B not together

Count arrangements of ABCDEF with A and B apart.

Goal
Count.
Strategy
Two methods for a check.
  1. 720−240=480720-240=480
    Complement.
  2. 4!×5×4=4804!\times5\times4=480
    Gaps: arrange CDEF; 5 gaps; A then B choose different gaps.
Answer480480.
✓ CheckBoth methods agree ✓.

3. Positions and circles

Worked exampleVowels at both ends

Arrangements of ABCDEF starting and ending with a vowel.

Goal
Count.
Strategy
Fill the ends first.
  1. 2×12\times1
    A and E at the ends, either order.
  2. ×4!=48\times4!=48
    Middle four.
Answer4848.
✓ Check48720=115=26×15\frac{48}{720}=\frac1{15}=\frac26\times\frac15: P(vowel first) × P(vowel last) ✓.
Edge caseRound tables Rotations are identical, so fix one person: nn people in (n−1)!(n-1)! ways.
Common misconceptionForgetting inside the block A glued block of kk people can be arranged k!k! ways internally.
Pause and think

BANANA with all A's together?

Summary

  • Together: glue × inside.
  • Apart: complement or gaps.
  • Fixed places first.
Key words
Restriction
A condition on an arrangement.
HistoryRinging the changes. English bell-ringers since the 1600s have rung "changes": every possible order of a set of bells, each order once, with only neighbouring bells swapping place each time. Fabian Stedman's book Campanalogia (1677) describes the methods. Ringing all 7!=50407!=5040 orders of seven bells takes about three hours and is called a peal.
Fun factThe Rubik's cube. A standard Rubik's cube can reach about 4343 quintillion (4.3×10194.3\times10^{19}) arrangements. The count comes from exactly the methods here: arrange the corners and edges, multiply by their orientations, then divide by the arrangements that the restrictions of the mechanism make impossible.
Keep reading for free

Create a free account to read the rest of this lesson: key formulae, worked examples, explore the graph, common mistakes, exam tip, guided practice and more. Your answers are checked and your progress is saved.