Consider a random walker who moves on the integers 0, 1, …, N, moving one step to the right with probability p and one step to the left with probability q =1 − p. If the walker ever reaches 0 or N he stays there. (This is the Gambler’s Ruin problem of Exercise 23.) If p = q show that the function
f(i)= i
is a harmonic function (see Exercise 27), and if p ≠ q then
f(i)= \left(\frac{q}{p} \right)^i
is a harmonic function. Use this and the result of Exercise 27 to show that the probability biN of being absorbed in state N starting in state i is
b_{iN}=\begin{cases} \frac{i}{N}, & if ~p = q,\\ \frac{(\frac{q}{p} )^i-1}{(\frac{q}{p} )^N-1}, & if ~p ≠ q.\end{cases}
For an alternative derivation of these results see Exercise 24.
In each case Exercise 27 shows that
f(i) = biNf(N) + (1 − biN)f(0) .
Thus
b_{iN}= \frac{f(i)-f(0)}{f(N)-f(0)}.
Substituting the values of f in the two cases gives the desired results.