Combinatorics
Intermediate
6 min

The Gap Method

Count selections or arrangements that forbid adjacency by placing items into the gaps between fixed elements.

1. The idea

The gap method solves 'no two chosen items are adjacent' problems by first placing the unchosen items in a row, which creates gaps (including the two ends) between them, then choosing which gaps receive a selected item so that no two selected items land in the same gap.

For choosing non-adjacent items from arranged in a row, this technique yields the compact formula : after removing items, there are remaining items creating gaps (including ends), and you choose of those gaps.

The gap method also extends to problems with additional constraints, such as circular arrangements (where there is no 'end,' changing the gap count) or minimum spacing greater than one.

2. Why it matters

"No two adjacent" is a very common constraint in interview counting problems, and the gap method turns a seemingly complex adjacency restriction into a single, clean combination formula.

3. Core mathematics

Non-adjacent selection in a row

Ways to choose k non-adjacent items from n arranged in a line.

Non-adjacent selection in a circle

Ways to choose k non-adjacent items from n arranged in a circle.

4. How to recognize it

Think of this when…

  • "No two selected items can be adjacent" or "at least one gap between chosen items" language.
  • Scheduling problems where consecutive time slots cannot both be chosen.
  • Seating problems where no two people from a restricted group can sit next to each other.
  • The setup asks you to choose items from in a row or circle under a spacing constraint.

5. Worked example

Worked example

How many ways can you choose 4 numbers from such that no two chosen numbers are consecutive?

  1. 1

    Use the direct gap-method formula with , .

  2. 2

    Compute the binomial coefficient.

  3. Answer: 35 ways.

6. Common mistakes

  • Using the linear formula for a circular arrangement, where the end effects differ.
  • Off-by-one errors in computing , especially forgetting the '+1' for the two end gaps.
  • Confusing 'no two adjacent' (gap ≥ 2 apart) with 'exactly one apart' or other spacing requirements, which need a modified substitution.
  • Applying the gap method to unordered/unlabeled positions where adjacency isn't well defined.

7. Quick check

How many ways to choose 3 non-consecutive numbers from 1 to 8?

Which quantity does the gap method rely on choosing from?

8. Practice

20 QuantSolve questions use this concept.

Practice this concept

9. Related methods