Number of ways to go to goal vertex from start vertex

39 Views Asked by At

I want to find out the number of ways to reach out to goal vertex from start vertex. The problem scenario is depicted as in the picture :

enter image description here

Here I want to go G vertex from S vertex. The only condition here is I can go up and right direction. DIrection diagonally/left/down is not allowed.

So keeping this condition in mind, what is the number of ways to go G vertex from S vertex?

My trying :

I have figured out the no of ways are, $1^2+2^2+3^3+\ldots+(n-2)^2$. Is this correct?

1

There are 1 best solutions below

3
On

In your case there is a direct counting approach. Your path is a sequence of $n$ right steps (R's) and $m$ up steps (U's), with $m=n=3$. So you are asking how many strings can be made from 3 R's and 3 U's, which should be $\binom{6}{3}$.