Expected game duration – gambler’s ruin

markov chainsprobability

A gambler with initial capacity k units plays against an opponent with initial capital a-k units. At each game the gambler either wins one unit or loses one unit with probability 1/2. Whenever the opponent loses the game, the gambler returns one unit so that the game may continue. Show that the expected duration of the game is k(2a – 1 – k).

My approach is the following:

$$E_{k} = 1 + \frac{1}{2} E_{k-1} + \frac{1}{2}E_{k+1}$$
$$E_{k+1} – 2E_{k} + E_{k-1} + 2 = 0$$

Guess: $E_{k} = Am^{k}$ so the equation becomes:
$$Am^{k-1}(m^2 – 2m + 1) + 2 = 0$$

Solving the inhomogeneous difference equation, I get that:

$$E_{k} = (A_{1} + A_{2}k) – k^2$$
The boundary conditions are $E_{a} = 0$ and $E_{0} = E_{1}$.
Second boundary condition is equivalent to:
$E_{0} = a(a-1)$ that can be done by expanding $E_{k}$ starting from $k = 0$ to $k=a$ and writing every term as a function of $E_{0}$ ($E_{a} = E_{0} – a(a-1)$).

Solving for A1 and A2, given the boundary conditions I get that A1 = a(a-1) and A2 = 1, which gives $E_{k} = a(a-1) + k – k^2$. I don't know what I'm doing wrong but there's clearly a mistake somewhere, given that the result that I should get is somewhat different. Could somebody point it out please ?

Best Answer

Your approach is correct, mistake is in initial or boundary condition. $P_a=0$ means that game stops when $k=a$. According to the problem text, game stops when $k=0$.

You can save your solution if you will mean $k$ is opponent capital. Then answer is $E_{a-k}$ of your solution which is equal to $k(2a-1-k)$.

Related Question