Solution (source code)

= Solution
{c}

The printed update needs a one-step index correction to match its filtration: the draw for the transition from $n$ to $n+1$ must be the fresh variable $U_{n+1}$. Also the trivial initial sigma-algebra is $\{\varnothing,\Omega\}$, rather than the printed $\{\varnothing,\mathcal F\}$. With literal $U_n$, the next increment is already known at time $n$, so $\mathbb E[X_{n+1}\mid\mathcal F_n]=X_{n+1}$; the nontrivial update differs from $X_n$. Thus the stated martingale claim is false with that indexing. The following uses the standard <Pólya urn> described in words.

Put $m=B_0+R_0$, so the total count is $m+n$. Conditional on $\mathcal F_n$, the next blue indicator $I_{n+1}$ has expectation $X_n$. Hence
$$
\mathbb E[X_{n+1}\mid\mathcal F_n]
=\frac{B_n+\mathbb E[I_{n+1}\mid\mathcal F_n]}{m+n+1}
=\frac{B_n+B_n/(m+n)}{m+n+1}=X_n.
$$
Adaptedness and integrability follow from the recursive construction and $0\leq X_n\leq1$. Thus $X_n$ is a bounded <martingale>. The <martingale convergence theorem> gives an almost-sure limit $X_\infty\in[0,1]$. Boundedness and the <dominated convergence theorem> then give $\mathbb E|X_n-X_\infty|^2\to0$, establishing convergence in $L^2$.