= Solution
Let $I_n$ count immigration events during the first $n$ transitions, and let $A_n$ count upward steps during those transitions. Write $h(k)=\theta/(k+\theta)$ for the conditional immigration probability. If $J_m$ is the indicator that transition $m$ to $m+1$ is immigration, then $J_m-h(X_m)$ is a bounded <martingale difference> with respect to the history that records event types as well as population sizes. The <strong law for martingales with bounded increments> implies
$$
\frac{I_n}{n}-\frac1n\sum_{m=0}^{n-1}h(X_m)\longrightarrow0\quad\text{almost surely}.
$$
Since $h$ is bounded, the <countable-state Markov chain ergodic theorem> gives
$$
\frac{I_n}{n}\longrightarrow\sum_{k=0}^\infty\pi_k\frac{\theta}{k+\theta}\quad\text{almost surely}.
$$
Applying the same argument to upward-step indicators gives $A_n/n\to\sum_k\pi_ku_k$ <almost surely>. To evaluate this denominator, sum <detailed balance> over all neighboring edges:
$$
\sum_{k=0}^\infty\pi_ku_k=\sum_{k=0}^\infty\pi_{k+1}d_{k+1}=\sum_{k=0}^\infty\pi_kd_k.
$$
Since $u_k+d_k=1$ and $\sum_k\pi_k=1$, both sums equal $1/2$. The denominator limit is positive, so division is valid and the <immigration fraction among upward steps> is
$$
\boxed{\frac{I_n}{A_n}\longrightarrow2\sum_{k=0}^\infty\pi_k\frac{\theta}{k+\theta}\quad\text{almost surely}.}
$$
This is the requested answer in terms of $\pi$. Substituting part (iii) additionally gives $\sum_k\pi_k\theta/(k+\theta)=(1-r)/2$, so the fraction simplifies to $1-r=(1-2p)/(1-p)$.
Back to article page