counting allowable/admissible paths on a grid with obstacles

1.4k Views Asked by At

I have a grid where some paths are removed.

enter image description here

where the following path is admissible,

enter image description here

but this path

enter image description here

is not.

How can I go about finding how many admissible paths are there on the following 2 grids (separately)

grid 1:

enter image description here?

I am not sure how to go about this, as it's the first I've seen of this type.

grid 2:

enter image description here

2

There are 2 best solutions below

4
On BEST ANSWER

This answer fleshes out a bit the suggestion made by Angina Seng in a comment.

Use coordinates so that the bottom left vertex is $(0,0)$ and the top right is $(6,6)$.

In Grid 2, the paths that avoid the center square are precisely those that avoid the vertex $(3,3)$. So you can simply subtract the number of paths that pass through $(3,3)$ from the total number of paths: $$ \binom{12}{6}-\binom{6}{3}\binom{6}{3}. $$

For Grid 1, a path uses the edge joining $(2,1)$ to $(2,2)$ if and only if it passes through both of these vertices. The number of such paths is $\binom{3}{2}\binom{1}{1}\binom{8}{4}$. There are similar expressions for the number of paths using each of the other three missing edges. Subtracting all four resulting expressions from the total number of paths is over subtracting, because there are paths that pass through two of the disallowed edges. So add back the number of paths using two of the disallowed edges. There are similar product-of-binomial expressions for the numbers of such paths. No path uses three or more of the disallowed edges, so no additional adjustments need to be made.

0
On

I’m assuming that each step must be up or to the right.

Recursively label each vertex with the number of ways to reach it starting from the vertex in the lower lefthand corner. Start by noting that each vertex on the left edge and each vertex on the bottom edge can be reached in only one way. Now work gradually up and to the right: the number of ways to reach any vertex is the sum of the number of ways to reach the one immediately below it (if there is one) and the number of ways to reach the one immediately to its left (if there is one).