PUZZLE 0015
Lattice Paths
Project Euler · Problem 15
Starting at the top-left corner of a grid, you may move only one step right or one step down at a time.
There are 6 such routes through a
How many routes are there through a
Hints
Open one at a timeEvery route uses the same number of right and down moves.
Choose which positions in the move sequence are right moves.
Solution
Best opened after a real attemptEncode a path as a word
Every valid route consists of exactly 20 right moves and 20 down moves, in some order. So each route is a length-40 word containing 20 copies of
Choose the 20 positions occupied by the right moves:
The picture suggests exploration; the move sequence reveals a standard combinatorial object.