..

Grid Path Problems in Combinatorics

Problem 1

Consider an m×n m \times n grid where you can only move right or down. There is an obstacle at (a,b) (a, b) . Find the number of ways to reach the bottom-right corner from the top-left corner while avoiding the obstacle.

Solution

  1. Compute the number of paths ignoring the obstacle: (m+nm)=(m+n)!m!n!\binom{m+n}{m} = \frac{(m+n)!}{m! n!}

  2. Compute the number of paths reaching (a,b) (a, b) : (a+ba)\binom{a+b}{a}

  3. Compute the number of paths from (a,b) (a, b) to (m,n) (m, n) : ((ma)+(nb)ma)\binom{(m-a)+(n-b)}{m-a}

  4. By removing the paths that pass through the obstacle, the final count is:

    (m+nm)((a+ba)×((ma)+(nb)ma))\binom{m+n}{m} - \left(\binom{a+b}{a} \times \binom{(m-a)+(n-b)}{m-a} \right)

Problem 2

Consider an n×n n \times n grid where you can only move right or up. However, you are not allowed to step on any point (i,j) (i, j) where either i i or j j is odd. Find the total number of ways to reach the top-right corner from the bottom-left corner.

Solution

Since movement is restricted, we can only step on coordinates where both i i and j j are even. Effectively, the grid reduces to an n2×n2 \frac{n}{2} \times \frac{n}{2} grid where each move corresponds to a move in the smaller grid.

In the reduced grid, we must make exactly n2 \frac{n}{2} right moves and n2 \frac{n}{2} up moves to reach the top-right corner. The number of such paths is given by the binomial coefficient:

(nn/2)=n!(n/2)!(n/2)!\binom{n}{n/2} = \frac{n!}{(n/2)! (n/2)!}

which represents the number of ways to choose n/2 n/2 right moves out of n n total moves.