Biased random walk hitting probability (source code)

= Biased random walk hitting probability
{title2=$h_i=(q/p)^i,\quad p>q=1-p,\quad i\geq0$}

For a <biased random walk> on the <nonnegative integers> with upward <probability> $p>q=1-p>0$, the <hitting probability> of zero from $i$ is $(q/p)^i$. Indeed, <first-step analysis> gives $h_i=ph_{i+1}+qh_{i-1}$ for $i\geq1$, with $h_0=1$. Its characteristic roots are $1$ and $\beta=q/p$, so any solution is $A+(1-A)\beta^i$. Nonnegativity as $i\to\infty$ forces $A\geq0$ and hence a value at least $\beta^i$. This candidate itself satisfies the recurrence. The theorem on the <minimal nonnegative solution for hitting probabilities> therefore identifies it with $h_i$. A walk on all of $\mathbb Z$ has the same probability until it first reaches zero.