Counting paths across a semi-infinite grid
May 22nd, 2008 ~ Posted in: MathematicsLet’s assume you’re walking across a cobblestone pavement laid out in an
grid. You’re currently standing on point
and you want to make your way to point 
while constraining yourself to moving up a step at a time, either straight up, to the left, or to the right. Assume
how many such paths go from your starting point to your destination?
Note that each path is identical to a
tuple of ones, negative ones, and zeros, with the constraint that the sum of the tuple should be
so what we’re looking for is the number of all such tuples. Let
be respectively the number of ones, negative ones, and zeros in a tuple, then we can solve for
in terms of
: 
Let
be respectively the minimum number of moves to the right, and the maximum number of moves to the right you can take in any allowable path from your origin to your destination; using multinomial coefficients, the number of paths is given by
Clearly
but determining
is a little trickier. To find it, note that
and
, so
. This gives two equations for
:
and
; solving them gives
Putting it all together, the number of paths is
A much harder problem would be to attempt this for a
grid, because (in a combinatorial approach like this) you would only count the tuples where consecutive stretches of moves to either the left or right are not excessively long. I suspect it would be more productive to find a probabilistic approach in that case.

This entry was posted on Thursday, May 22nd, 2008 at 11:19 pm and is filed under Mathematics. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply