How many paths from A to B in this specific case?

114 Views Asked by At

So none of my friends know the answer exactly (neither do I). In the given grid and from the given starting point if I can only move up, left and right then how many paths are there till the topmost corner(marked orange). The paths cannot go through the center 4 boxes(marked blue). Our starting point is marked green. I would appreciate logic more than formulas as we are supposed to get the answer without formulas My answer is 224. edit- forgot to mention that you can enter a square only once.sorry

enter image description here

Edit- I got a new answer now: 491. Is it correct?

1

There are 1 best solutions below

1
On

There are infinitely many paths. This is because one can move left and right forever. For example, given any valid path, one can stick the moves left then right anywhere any amount of times.

If you only intended up and right, then there is a finite number of paths. An easy way to find this is to take the total number of paths and subtract the number of paths that go through the center.

Ignoring the center restriction for now, one can find the total number of paths by seeing that one must go up 6 times and right 6 times in any order. This is just ${12 \choose 6}$ (choose where the 6 lefts are and the rest are ups or the other way around).

Now to find how many paths go through the center, let's look at one blue square at a time. Using the same thinking as above, there are ${4 \choose 2}$ paths to the bottom left blue square. Now for each of those paths, there are ${8 \choose 4}$ paths to the orange square. This gives ${4 \choose 2} \cdot {8 \choose 4}$ paths through that blue square.

We can continue this logic for each blue center square except for the top right one because there is no way to reach it without going through another blue square first, so all of those paths are already accounted for.

So the final answer would be: $$ {12 \choose 6} - {4 \choose 2} \cdot {8 \choose 4} - {4 \choose 1} \cdot {7 \choose 3} - {4 \choose 1} \cdot {7 \choose 3} = 224 $$