Counting Up-Right Paths on a Grid
From (n,n) symmetry to the general (m,n) counting rule
We start with the symmetric version first: from to , moving only right or up.
Each valid path uses exactly right moves and up moves, so every route has Manhattan (taxi-cab) length:
For comparison, the straight-line Euclidean distance to is:
That is the key taxi-cab idea: on city blocks, you count grid steps, not diagonal shortcuts.
The number of distinct paths in the case is:
Square Target: From (0,0) to (n,n)
Each valid route has exactly n right moves and n up moves, so every path has
Manhattan length 2n.
Paths: 924
Taxi-cab view: you travel on grid streets, so you count blocks. Euclidean view: you measure the straight-line diagonal.
Build a Path for (6,6)
Desktop mode: drag from the orange point right or up to place the next move.
Move Ledger (for (6,6))
Right left: 6
Up left: 6
Placed: 0/12
Current point: (0,0)
Sequence
No moves yet.
There are 924 valid step strings with 6 R's and 6 U's.
General Case: From (0,0) to (m,n)
Now you need m rights and n ups, so you count arrangements of two move types in m+n slots.
Paths: 330
Why the binomial coefficient appears
Think of a path as a string of length made of letters and .
- You must place exactly copies of .
- The remaining slots are automatically .
So the count is “choose which of the slots are ”, which is .
In the interactive builder, that means you can place only 9 right steps and 9 up steps total. As each move is placed, the ledger tracks how many of each move type are still available.
General version at the bottom: from to
Now the move totals are not equal:
- right moves:
- up moves:
- total steps:
So the number of valid up-right routes is:
Use the sliders in the final panel of the interactive to change and and see the count update live.