Solution (source code)

= Solution

For $a>0$ the chain is irreducible, and the normalized <stationary distribution> in (i) makes it <positive recurrent>. The <mean recurrence time>[mean-return-time formula] gives
$$
\boxed{\mathbb E_0[T_0^+]=\frac1{\pi_0}=\frac b{b-a}.}
$$
Here $T_0^+=\inf\{n\ge1:X_n=0\}$ includes a return at time one when the chain stays at zero. This convention is essential. Equivalently the mean hitting time of zero from one is $1/(b-a)$, so a first-step decomposition gives $1+a/(b-a)$, the same result. For $a=0$ the population remains zero and the next zero is at time one, also agreeing with the formula.