Solution (source code)

= Solution

Let $N=a+b$ and measure Lionel's fortune in unit stakes. This is <gambler's ruin>: the fortune moves by $+1$ with probability $p$ and $-1$ with probability $q$, stopping at $0$ or $N$. Let $m_i$ be the <expected value> of the absorption time starting at $i$. It is finite: from any interior state, a run of $N$ wins or losses has a fixed positive probability of absorption within $N$ steps, giving a geometric bound on survival over successive blocks. <First-step analysis> therefore gives
$$
m_i=1+pm_{i+1}+qm_{i-1},\qquad m_0=m_N=0.
$$
For $p\ne q$, the <homogeneous solution> of the recurrence is $A+B(q/p)^i$, and a <particular solution> is $-i/(p-q)$. Put $\rho=q/p$. Imposing the two endpoint <boundary conditions> gives the <expected duration of biased gambler's ruin>
$$
m_i=\frac{N(1-\rho^i)/(1-\rho^N)-i}{p-q}.
$$
Consequently \b[the expected number of games is]
$$
\boxed{\mathbb E[T]=\frac{(a+b)\dfrac{1-(q/p)^a}{1-(q/p)^{a+b}}-a}{p-q}.}
$$
The denominator and numerator have matching signs, so this is positive. As a check its continuous limit at $p=q=1/2$ is $a b$, the <expected duration of symmetric gambler's ruin>.