B2. A stone general is a chess piece that moves one square diagonally upward on each move; that is, it may move from the coordinate $(a, b)$ to either of the coordinates $(a-1, b+1)$ or $(a+1, b+1)$. How many ways are there for a stone general to move from $(5,1)$ to $(4,8)$ in seven moves on a standard 8 by 8 chessboard?
Solution 1: Since we are constrained to $8-1=7$ moves, and want to move from $a=5$ to $a=4$, we need to move northwest 4 times and northeast 3 times. Notice that we do not fall off the grid in any sequence of 4 northwest and 3 northeast moves because there are 4 cells to the left of the initial position and there are 3 cells to the right of it.
Thus, every sequence of 4 northwest and 3 northeast moves works, and the answer is $\binom{7}{3}=\binom{7}{4}=35$.
Solution 2: For each square $(i, j)$, let $P(i, j)$ be the number of ways to get to $(i, j)$ from $(5,1)$ using $j-1$ moves. Then we have $P(i, j)=P(i-1, j-1)+P(i+1, j-1)$. Starting with $P(5,1)=1$ and zeroes in all other cells in the first row, we can compute $P(4,8)=35$, as shown below.