Grid paths and reflectionAbout 6 min · Untimed

Discover

The move playlist

A monotone lattice path from (0, 0) to (m, n) is fully described by the order of its m right steps and n up steps, so the path count is C(m + n, m). On a 2 by 2 grid there are C(4, 2) = 6 paths; exactly 4 of them stray above the diagonal, matching the reflection count C(4, 1) = 4, leaving 2 valid paths.

Words you need

Combinations (n choose k)
The number of ways to pick k items from n when order does not matter.e.g. 5 choose 2 = 10.
Why it works

Each path is a distinct sequence of R and U moves, and each such sequence draws exactly one valid path.

Paths(m, n) = C(m + n, m) = C(m + n, n)

Spot it: Movement is restricted to right and up (or any two monotone directions).

Technique reference and sources

Write every path as a playlist of R and U moves in travel order. A 3 by 2 trip needs 3 Rs and 2 Us; counting paths is counting playlists, which is choosing the R positions among 5 slots.

When this method fits

  • Movement is restricted to right and up (or any two monotone directions).
  • You need paths through an intermediate point: multiply the two leg counts.
  • A barrier forbids crossing a diagonal: reflect bad paths to count them.
  • An interviewer asks for ballot, queue, or lattice counting.
  1. Count total moves. From (0, 0) to (m, n) you need exactly m right and n up moves: m + n steps.
  2. Choose positions. Pick which of the m + n slots hold the m right moves: C(m + n, m).
  3. Split at waypoints. For a forced waypoint (a, b), multiply C(a + b, a) by C(m - a + n - b, m - a).
  4. Reflect over barriers. On a square n by n grid, paths straying above the diagonal reflect bijectively, giving C(2n, n - 1) bad paths.
Rectangle grids: Paths from (0, 0) to (m, n) moving only right and up: C(m + n, m).
  • 3 by 2 grid: C(5, 3) = 10
  • 2 by 3 grid: C(5, 2) = 10
  • 5 by 5 grid: C(10, 5) = 252
Diagonal barrier on square grids: On an n by n grid, C(2n, n - 1) paths stray above the diagonal and the Catalan number C(2n, n) - C(2n, n - 1) never do.
  • 2 by 2: 4 bad, 2 good (6 - 4 = 2)
  • 3 by 3: 15 bad, 5 good (20 - 15 = 5)
Catalan division shortcut: On a square n by n grid with the standard weak diagonal constraint, good paths = C(2n, n) / (n + 1). Use it when the central binomial is already known; it loses when the boundary or endpoint differs from the standard constraint.
  • 3 by 3: C(6, 3) = 20, good = 20 / 4 = 5, bad = 20 - 5 = 15

Common traps

Counting C(m + n, m) when backtracking or detours are allowed. The binomial count needs monotone moves only. Extra directions need a different model, such as random-walk states.

Adding leg counts instead of multiplying for waypoint problems. Each first leg pairs with every second leg, so multiply: C(3, 1) * C(3, 2) = 3 * 3 = 9.

Treating reflection as an estimate rather than an exact bijection. Reflecting the initial segment through the first visit to y = x + 1 pairs each bad path with exactly one counted path, so C(2n, n - 1) is exact. The 2 by 2 enumeration (4 bad of 6) confirms it.

Another example: 3 by 3 paths through (1, 2)
  1. Leg 1 from (0, 0) to (1, 2): C(3, 1) = 3
  2. Leg 2 from (1, 2) to (3, 3): needs 2 right and 1 up, C(3, 2) = 3
  3. Multiply independent legs: 3 * 3 = 9

Source notes

These explanations and questions are written for QuantArc. Links show the underlying mathematics and learning design.

Harvard Stat 110: Probability (Joe Blitzstein)
Free course site with videos and the open companion book Introduction to Probability; the topic spine for counting, Bayes, and linearity. Lesson examples and questions are original.

MIT OCW 6.042J: Mathematics for Computer Science
Course page checked: undergraduate discrete mathematics covering permutations and combinations plus counting principles. Topic spine for stars and bars, lattice paths, and derangements. Lesson examples and questions are original.

IES: Organizing Instruction and Study to Improve Student Learning
Supports worked examples, retrieval, explanations and spaced study. Does not establish QuantArc's exact lesson length, mastery threshold or review intervals.