[Math] How many paths possible in this grid given this specific conditions

permutations

In a grid, There is a bottom-left point i, with co-ordinate (0,0) and top-right point j with co-ordinate (10,10). A person is standing at point i, He can go up (1 unit), right (1 unit) and diagonally (1 unit diagonally) given that person don't cross the grid limits.
I have two questions here,

  1. How many ways, He can go to i to j?
  2. What if we say, all moves sould have the following sequence of moves, up,up,down,down,up,down then how many ways are there?

Best Answer

Let $d$ be the number of diagonal moves; clearly $0\le d\le 10$. The $d$ diagonal moves account altogether for $d$ steps to the right and $d$ steps up, so he must also make $10-d$ moves to the right and $10-d$ moves up. That’s a total of $20-2d$ orthogonal moves, half to the right and half up, which may be taken in any order, for a grand total of $20-2d+d=20-d$ moves.

There are $\binom{20-d}d$ ways to choose which moves are diagonal, and then there are $\binom{20-2d}{10-d}$ ways to choose which of the remaining moves are up, so there are $\binom{20-d}d\binom{20-2d}{10-d}$ paths with $d$ diagonal moves and a grand total of

$$\sum_{d=0}^{10}\binom{20-d}d\binom{20-2d}{10-d}=\sum_{k=0}^{10}\binom{10+k}{10-k}\binom{2k}k\;.$$

You could calculate this longhand, or you could calculate the corresponding figure for smaller numbers than $10$: for $0$ I get $1$, for $1$ I get $\binom11\binom00+\binom20\binom21=3$, for $2$ I get $$\binom22\binom00+\binom31\binom21+\binom40\binom42=13\;,$$ and for $3$ I get $$\binom33\binom00+\binom42\binom21+\binom51\binom42+\binom60\binom63=1+12+30+20=63\;,$$ which is enough to justify trying the On-Line Encyclopedia of Integer Sequences. It reports $14$ matches, of which the first, A001850, gives the central Delannoy numbers, described as the number of paths from $(0,0)$ to $(n,n)$ in an $n\times n$ grid using only steps North, Northeast and East, which is exactly what you want. The tenth number is listed as $8,097,453$.

Added: The sequence UUDDUD, which I’ll call $S$, has no net effect and may be inserted at any point before the last two moves that increase the $y$-coordinate. As before, suppose that there are $d$ diagonal moves, so that there are $10-d$ up and $10-d$ right moves, not including $S$. Still not counting $S$, there are $10$ moves that increase the $y$-coordinate; call them $m_1,\dots,m_{10}$ in order. They may come in any order, and there are $\binom{10}d$ ways to choose which of them are the diagonal moves. $S$ may come before $m_1$ or between $m_k$ and $m_{k+1}$ for $k=1,\dots,8$, so there are $9$ places to insert $S$ into any of those $\binom{10}d$ possible sequences, for a total of $9\binom{10}d$ sequences of $S$ and the $10$ moves that increase the $y$-coordinate.

The remaining $10-d$ moves may be placed anywhere in the string. This is a standard stars and bars problem: there are $12$ possible places to put the moves, and $10-d$ indistinguishable moves to be placed, for a total of $\binom{10-d+11}{11}=\binom{21-d}{11}$ arrangements. The grand total is therefore

$$9\sum_{d=0}^{10}\binom{10}d\binom{21-d}{11}$$

paths. If I did the arithmetic correctly, this comes to $119,574,387$ paths.

Related Question