logo
Interesting Math Problem   Math Problems Home  |  Home  |  Send Feedback

Graph Theory - Number of Paths

On the accompanying diagram, how many paths are there
from A to B, if we are only allowed to move to the right,
down, or down and to the right diagonally ?



Let's label the diagram as if it were a street map.

Let's call the 4 vertical "avenues" a, b, c, d from left to right.
Let's call the 4 horizontal "streets" 1, 2, 3, 4 from bottom to top.

So A is at a1 and B is at d4.

Since we can never double back,
each point on the graph as 1, 2, or 3 predecessors.
The number of ways of reaching it is the sum
of the number of ways of reaching the predecessors.

There is just 1 way to reach a1, a2 and b1.
Then we can number the rest of it by adding.
So that means 3 ways to reach b2.
1 way to reach a3, so 5 ways to reach b3.
and so on.

And we end up with these numbers

1..1.. 1...1
1..3.. 5...7
1..5..13..25
1..7..25..63

So there are 63 ways to go from A to B.

If you are ambitious, you can try to find a
similar formula for the number of such paths
in an (m x n) grid of this type.

Without the diagonals, we have a situation such as depicted here:


In this case we have a grid m x n (in this case 3 x 4),
and the number of "taxicab" paths is (m+n)Cm = (m+n)Cn.

We have a total of m+n steps to take,
and we choose either m "downs", indicated by a D,
or n "rights", indicated by an R.

Or we can use the Pascal's Triangle approach and
see that the number of paths to each point is
the sum of the number of paths to its predecessors.

Rotating the diagram by 45 degrees produces Pascal's Triangle.