# Gamblers ruin difference equation

I'm not sure where my mistake is in the following.

Gambler starting with k dollars and playing a $50/50$ game where he increases in wealth by one dollar or decreases by one dollar until achieving $N > k$ or going bankrupt. If $p_k$ denotes the probability of eventually going bankrupt starting with $k$ then $p_N = 0$ and $p_0 = 1$. And we have the difference equation $p_k = \frac{1}{2} (p_{k+1} + p_{k-1})$. All this I agree with (it's from Grimmets probability text book). I then tried solving this on my own using a second order difference equation as follows:

The characteristic polynomial is $x^2-x+1$ which has roots $1/2 \pm \sqrt{3}/2$. This complex number is $e^{\tan^{-1}(\sqrt{3})i}$ and so the solution of the recurrence with constants $c_1, c_2$ ought to be (letting $\theta = \tan^{-1}(\sqrt{3})$:

$$p_k = c_1 \cos (k*\theta) + c_2 \sin (k*\theta)$$

where the boundary conditions imply $c_1 = 1$ and $c_2 = -\frac{\cos (N*\theta)}{\sin (N* \theta)}$.

This, however, gives me bogus numbers. Where did I go wrong?

Thanks

-
Where are you getting that the characteristic polynomial is $x^2 - x + 1$? Aren't you forgetting about the $1/2$s? –  Craig Oct 10 '11 at 1:56
$p_k = \frac12 (p_{k+1} + p_{k-1})$ rearranges to $p_{k+1}-2p_k+p_{k-1}=0$. Now, how did you obtain your characteristic polynomial? –  Ｊ. Ｍ. Oct 10 '11 at 1:59
Oh man, what a silly mistake! I got it now! Thanks for pointing it out. –  Palace Chan Oct 10 '11 at 3:03