Solution (source code)

= Solution

Use the natural urn <filtration>. At stage $n$, put $s=X_n+Y_n=n+2$ and $d=X_n-Y_n$. The difference becomes $d-1$ with probability $X_n/s$ and $d+1$ with probability $Y_n/s$. Hence its conditional next mean is $d+(Y_n-X_n)/s=d(1-1/s)$. Since the next total is $s+1$,
$$
E[M_{n+1}\mid\mathcal F_n]=s\,d(1-1/s)=d(s-1)=M_n.
$$
Adaptedness is immediate, and every $M_n$ is bounded by a deterministic finite number, so integrable. This proves the <martingale> property.

Nevertheless \b[it does not converge to a finite limit on any sample path]. The increments are $d+s$ or $d-s$, because $M_{n+1}=s(d\pm1)$ and $M_n=(s-1)d$. Both colours remain present, so $|d|\leq s-2$ and $|M_{n+1}-M_n|\geq2$. Convergence of a real sequence would force its increments to tend to zero. There is therefore no almost-sure finite convergence, illustrating why the boundedness condition in the preceding part matters.