# Random walk with weighted probabilities

Taking a walk on $\mathbb{N}$, starting at 1, I need to find out how many steps I expect to take before returning to the origin, as a fraction. For each step, I either walk forward, backward, or stay still (+1, -1, or 0 respectively) with probabilities $a, b, c$. Walking forward and staying still have a small probability, while walking backwards has a high probability. Is there a general method I can use?

• What are the transition probabilities from state 1? Do you stay at 1 with probability $b+c$ (and transition to 2 with probability $a$), or perhaps with probability $c/(a+c)$ (and transition to 2 with probability $a/(a+c)$)? Such probabilities do not be specified if you mean $\mathbb{N}$ to include 0 and you mean that the origin is 0. Can you please remove the ambiguity? Commented Jan 19, 2014 at 12:05

I'm not sure I got the 'as a fraction' part, but the rest can be handled by standard MC machinery. Since $a+b+c=1$ you need to solve a recurrent equation: $$m_{k,1}=1+a m_{k,1}+b m_{k,1} + c m_{k+1,1}$$
• Hmm, do you maybe mean with $m_0 = 0$, solve for $k>0$ the recurrence $m_k = 1+a m_{k+1}+b m_{k-1} + c m_k$, where $m_1$ is the expected time to go from 1 to 0? It seems you have mixed up the roles of $a,b,c$, but I think there may be a more fundamental issue as well, as I do not see the need for two indices. Commented Jan 19, 2014 at 0:18
• You are right: the OP needs $m_{k,1}$ which is the mean first hitting time of state $s_1$ starting out in state $k$, which is the same as $m_k$. Note the origin is in fact $1$ because the rw is defined on $\mathbb{N}$