Think Academy
Day 3: Non-Adjacent Permutations (The Gap Method)
Demonstrator: Alex Yuan
Think Academy

Non-Adjacent Permutations

The Gap Method
Scan to Follow

📸 Warm-Up: The Photo Line-Up Puzzle

Year 5 Permutations & Combinations
đŸŽ¯ The Class Photo Dilemma
7 students (A, B, C and D, E, F, G) line up in a single row for a class photo.
âš ī¸ Teacher's Strict Condition:
No two of A, B, and C may stand adjacent to each other!
STUDENT ROSTER:
Quiet Crew (Unrestricted)
D
E
F
G
Chatterbox Trio (Must Separate)
A
B
C
🚨 The Intuitive Trap: Complementary Counting?
Can we just calculate: Total − (All 3 Together)?
7! − (3! × 5!) = 5040 − 720 = 4320 ?   ❌ WRONG!
Why? Subtracting "all 3 together" still leaves cases where exactly two chatterboxes are adjacent (e.g., A & B together, C separated)!
💡 The Breakthrough: The Gap Method
Instead of fixing bad arrangements, construct valid ones directly!
🌟 Golden Law of Non-Adjacent Permutations:
"Arrange the unrestricted students first, then insert the restricted students into the gaps!"

🧩 The 3-Phase Strategy: Step-by-Step Breakdown

Constructive Permutation
Line-Up Stage Visualiser
LINE-UP TRACK (FRONT OF CLASS) Gap ① Gap ② Gap â‘ĸ Gap â‘Ŗ Gap ⑤ D Quiet 1 E Quiet 2 F Quiet 3 G Quiet 4 A Chatter 1 B Chatter 2 C Chatter 3 Line up the 4 Quiet students first (D, E, F, G)
Key Insight: Each gap can hold at most 1 chatterbox. Since quiet students stand between the gaps, chatterboxes are guaranteed never to touch!
PHASE 1: Arrange Quiet Crew STEP 1
Permute the 4 unrestricted students (D, E, F, G):
4! = 4 × 3 × 2 × 1 = 24 ways
PHASE 2: Count Available Gaps STEP 2
4 students create 2 ends + 3 in-between spaces:
4 + 1 = 5 available gaps (N items → N + 1 gaps)
PHASE 3: Insert Chatterbox Trio STEP 3
Pick 3 distinct gaps from 5 for students A, B, and C:
P(5, 3) = 5 × 4 × 3 = 60 ways

🏆 Final Assembly & Multiplication Principle

Connecting the Independent Steps
âš™ī¸ The Multiplication Principle
Because the line-up is completed through two sequential, independent stages, we multiply the possibilities:
Stage 1: Arrange Quiet Crew (D, E, F, G) 24 ways
Stage 2: Insert Chatterboxes (A, B, C) 60 ways
TOTAL VALID PHOTO LINE-UPS
24 × 60 = ? 1,440 ways
Mental math tip: 24 × 6 = 144 → 144 × 10 = 1,440
📋 Master Recipe: Non-Adjacent Problems
1
Classify: Identify the unrestricted elements vs restricted (non-adjacent) elements.
2
Base Line: Arrange the M unrestricted elements first (M!).
3
Count Gaps: M elements create exactly (M + 1) available gaps.
4
Insert & Multiply: Insert K elements into gaps (P(M+1, K)) and multiply!
General Formula: Total = M! × P(M + 1, K)
🏅 Mission Accomplished!
You have mastered Non-Adjacent Permutations & The Gap Method!

🚀 After-Class Mastery: Test Your Superpowers!

Independent Challenges â€ĸ No Answers Revealed
⭐ 4 Practice Challenges for Home — Apply the Gap Method on Your Own!
Challenge 1: Photo Line-Up
6 students line up for a photo. Two students, Sam and Leo, must not stand next to each other.
Valid ways:
Challenge 2: Car Parking
5 distinct cars (3 silver, 2 red) park in a row of 5 spaces. The 2 red cars cannot be parked in adjacent spaces.
Valid ways:
Challenge 3: Bookshelf Order
6 distinct books on a shelf: 4 maths textbooks and 2 science textbooks. The 2 science books must never sit side-by-side.
Valid ways:
Challenge 4: Running Lanes (Bonus)
7 sprinters compete in 7 lanes. Runner X and Runner Y must not be assigned to adjacent lanes.
Valid ways: