Calculate the number of ways for random walk

50 Views Asked by At

Suppose there are $N$ nodes. A man starts at node 1. When he is at node $i$, he can either move forwards to $i+1$ or backwards to $i-1$. He get to node N at step T. The question is how many ways are there?

My thinkings: If $T=N$, obviously there are only one way to get to N. If $T=N+2k+1$, the problem is infeasible; But how to calculate if $T=N+2k$?

Besides, I think this is a very classical problem, could any give the name of this problem?