Example (hitting probability in simple random walk on non-negative integers)

Consider a Markov chain on $I = \set{0,1,2,\ldots}$ with transition probabilities $$ \begin{align*} \begin{cases} P(i,i+1) = p, &i\geq 1, \\ P(i,i-1) = q \equiv 1-p, &i\geq 1, \\ P(0,1) = 1. \end{cases} \end{align*} $$ Let $A = \set{0}$. We want to find $h_i^A$.

From the previous theorem, $h_0^A = 1$ and $h_i^A$ is the minimal non-negative solution to the recurrence relation $$ \begin{align*} h_i^A = p\,h_{i+1}^A + q\,h_{i-1}^A, \qquad i\geq 1. \end{align*} $$ There are several cases: