Bernoulli polarization martingale (source code)

= Bernoulli polarization martingale
{c}
{title2=$X_{n+1}=X_n+\alpha(B_{n+1}-X_n)$}

Let $0<\alpha<1$, $X_0=x\in[0,1]$, and let $B_{n+1}$ be a binary <random variable> satisfying $\mathbb E[B_{n+1}\mid\mathcal F_n]=X_n$. Suppose $X_n$ is $\mathcal F_n$-<measurable> and $B_{n+1}$ is $\mathcal F_{n+1}$-<measurable>. The update
$$
X_{n+1}=(1-\alpha)X_n+\alpha B_{n+1}
$$
remains in $[0,1]$ and defines a bounded <martingale>. For example, take <independent> <uniform random variables> $U_{n+1}$ independent of the current <filtration> and set $B_{n+1}=\mathbf1_{\{U_{n+1}\leq X_n\}}$.

The binary identity $B_{n+1}^2=B_{n+1}$ gives
$$
\mathbb E[(X_{n+1}-X_n)^2\mid\mathcal F_n]
=\alpha^2X_n(1-X_n),
$$
and hence
$$
\mathbb E[X_{n+1}(1-X_{n+1})\mid\mathcal F_n]
=(1-\alpha^2)X_n(1-X_n).
$$
The <L2-bounded martingale convergence theorem> gives a terminal <random variable> $X_\infty$ with <almost sure convergence> and <convergence in L2>. Iteration followed by the <bounded convergence theorem> yields
$$
\mathbb E[X_\infty(1-X_\infty)]
=\lim_n x(1-x)(1-\alpha^2)^n=0.
$$
Thus $X_\infty$ takes only $0$ and $1$, and preservation of its <expected value> gives a <Bernoulli distribution> with parameter $x$. The terminal <conditional expectation> representation gives the exact <mean squared error>
$$
\mathbb E[(X_\infty-X_n)^2]=x(1-x)(1-\alpha^2)^n.
$$
The finite-time paths can stay strictly inside $(0,1)$ while their limit lies entirely at the endpoints. The positive conditional <variance> in the interior makes permanent convergence to an interior value impossible.