= Solution
If there are $i$ balls in box A, a ball currently in B is selected with probability $(k-i)/k$, increasing the count, and a ball in A is selected with probability $i/k$, decreasing it. For $k\geq1$,
$$
\boxed{P_{i,i+1}=\frac{k-i}{k}\ (0\leq i<k),\qquad P_{i,i-1}=\frac{i}{k}\ (0<i\leq k),}
$$
with every other transition zero. This is the <Ehrenfest urn model>.
The <stationary distribution> is
$$
\boxed{\pi_i=2^{-k}\binom ki,\qquad 0\leq i\leq k.}
$$
It is normalized by the <binomial theorem>, and it obeys the <detailed balance>:
$$
\pi_iP_{i,i+1}=2^{-k}\binom ki\frac{k-i}{k}=2^{-k}\binom k{i+1}\frac{i+1}{k}=\pi_{i+1}P_{i+1,i}.
$$
All other pairs have zero flux in both directions. These identities prove stationarity and show that this is a <reversible Markov chain> in equilibrium. The finite chain is irreducible and has period two; reversibility does not require aperiodicity.
Back to article page