How are these terms derived using recurrence relations in the Gambler's ruin example?

108 Views Asked by At

I have an example in my Stochastic processes book where we find the general probability of the hitting time with intial point $i$ . I'm not sure about one thing though. Here's the example:

(Gambler’s ruin on $0, . . . , N$). Asymmetric random walk on the integers $0, 1, . . . , N$, with absorption at $0$ and $N$. $0 < p = 1 − q < 1$.

enter image description here

Let $h_i=P_i( \text{hit $0$})$. So $h_0=1, h_N=0$ and $h_i=qh_{i-1}+ph_{i+1}$ , $1 \leq i \leq N-1$.

Characteristic equation is $px^2-x+q=(x-1)(px-q)$ [I understand how this is solved].

So roots are $\{1, {q \over p}\}$ and if $p \neq q$ general solution is $h_i=A+B({q \over p})^i$. [This I don't understand- what is A and B here?]

Using boundary conditions we find

$$h_i=\frac{(\frac{q}{p})^i - (\frac{q}{p})^N}{1 - (\frac{q}{p})^N}$$ [How is this derived??]

If $p = q $ general solution is $h_i = A + B_i$ and using boundary conditions we get $h_i = 1 − i/N$.[why?]

My understanding of recurrence relation isn't that deep so maybe that's why I don't understand this. If someone could explain how these things are derived that would be really helpful!