Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

On wikipedia I read that the expected number of steps till a 1D simple random walk hits either $a$ or $-b$ is equal to $ab$. (I have seen this result also on other websites.) However, no proof or further reference is given. Could someone please explain how they arrived at this result?

Thanks in advance, Claus

share|cite|improve this question

marked as duplicate by Did probability Oct 31 '15 at 12:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Have a look at… – coffeemath Feb 18 '13 at 16:16

The expected time $t_x$ to hit either boundary starting at $x$ satisfies the recurrence

$$ t_x=1+\frac12\left(t_{x-1}+t_{x+1}\right)\;. $$

The general solution of this second-order linear recurrence is $t_x=-x^2+mx+n$, and you can easily check that $t_x=(a-x)(x+b)$ is of this form and satisfies the boundary conditions $t_a=t_{-b}=0$; thus $t_0=(a-0)(0+b)=ab$.

share|cite|improve this answer
The recurrence is second order. – vonbrand Oct 30 '15 at 14:54
@vonbrand: Quite right, thanks, I've fixed it. – joriki Oct 31 '15 at 12:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.