Permutations with Restrictions – A First Look
Imagine you have five friends and you want to seat them in a row of five chairs. That’s easy: 5!=120 ways. But now suppose two of them, say A and B, refuse to sit next to each other. Suddenly the problem feels different — you can’t just count all arrangements; you have to avoid some.
That’s the heart of permutations with restrictions: you still count arrangements of distinct objects, but certain arrangements are forbidden. The trick is to count the total and then subtract the forbidden ones, or to count directly by placing the restricted items first.
The core idea: total minus unwanted
The most powerful tool for restrictions is the complement method:
Count everything, then subtract what you don’t want.
For the "A and B never together" problem:
- Total arrangements of 5 people: 5!=120
- Count arrangements where A and B are together. Treat them as a single block: that block + the other 3 people = 4 items, arranged in 4! ways. Inside the block, A and B can swap: 2! ways. So together: 4!×2!=24×2=48
- Subtract: 120−48=72
The "treat as a block" trick works for any "must be together" restriction. For "must not be together", use the complement.
Another common restriction: fixed positions
Suppose you have 7 books and a specific book must be placed in the middle (position 4). Then:
- Fix that book in position 4: 1 way
- Arrange the remaining 6 books in the other 6 positions: 6! ways
Answer: 6!=720
If instead a book cannot be in the middle, count total (7!) minus arrangements where it is in the middle (6!): 7!−6!=5040−720=4320
When restrictions involve multiple conditions
Sometimes you have two restrictions at once. For example: arrange the letters of the word MATHS such that vowels (A) are never together and consonants (M, T, H, S) are never together. That’s more complex — you’d first arrange the consonants, then place vowels in the gaps.
But for a first meeting, the pattern is always:
Step 1: Identify what is forbidden.
Step 2: Decide: count directly (place restricted items first) or use complement (total – unwanted).
Step 3: Apply the block method for "together" restrictions, or the gap method for "separated" restrictions.
The gap method for "never together"
If you want A and B never adjacent, another direct way:
- Arrange the other n−2 items first: (n−2)! ways
- This creates (n−1) gaps (including ends). Choose 2 gaps for A and B: (2n−1) ways
- A and B can swap in those gaps: 2! ways
So total = (n−2)!×(2n−1)×2!
For 5 people: 3!×(24)×2=6×6×2=72 — same answer.
The gap method is direct and avoids subtraction. Use it when the "together" count is messy.
A quick summary for exams
| Restriction | Method | Formula (for n distinct items) |
|---|
| Two specific items always together | Block method | (n−1)!×2! |
| Two specific items never together | Complement | n!−(n−1)!×2! |
| A specific item in a fixed position | Fix and arrange | (n−1)! |
| A specific item not in a fixed position | Complement | n!−(n−1)! |
| All items distinct, no other restrictions | Straight factorial | n! |
The key is to always start with the restriction — ask yourself: what is forbidden? Then choose the cleanest path. With practice, you’ll see the block or gap instantly.