Start in the lower left corner of a 5x10 unit grid. You may only move to the right and upward along the edges to get to the top right corner. The area of a path between the corners is the amount of area beneath the line in square units. For example:
On a 5x10 grid, how many different paths from the lower left corner to the upper right corner have an area congruent to 1 mod 5?
Bonus: Choose any prime and positive integers , and and generalize this solution to the number of paths with an area congruent to mod on a by grid.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
(Generalized formula and proof by Bill Kuszmaul)
Let j and k be positive integers and let p be prime. Consider a path w containing j p vertical steps and k p side steps. Suppose there exists a r such that the steps w p r + 1 , … , w p ( r + 1 ) are not all either just ups or just rights. Let r be the smallest such r . Then, we can "cancel out" the area of w with the area of the paths reached by taking w and cyclicly shifting the steps w p r + 1 , … , w p ( r + 1 ) within w . The paths we have "cancelled out" with each other have areas equidistributed modulo p . Now let us consider the remaining paths. Each such path consists of chunks of p side steps and p vertical steps appended together. Each such path, as a consequence, has area 0 mod p , and there are exactly ( j j + k ) such paths. Hence, the number of paths on a j p × k p grid with area 0 mod p is:
p ( j p j p + k p ) − ( j j + k ) + ( j j + k )
And the number of paths with area i mod p for i not congruent to zero is
p ( j p j p + k p ) − ( j j + k )
=================
Therefore, for p = 5 ; j = 1 ; k = 2 , the answer is 5 ( 1 ( 5 ) 1 ( 5 ) + 2 ( 5 ) ) − ( 1 1 + 2 ) = 5 ( 5 1 5 ) − ( 1 3 ) = 5 3 0 0 3 − 3 = 6 0 0