Solution (source code)

= Solution

The <Skorokhod embedding theorem> states that if $\mu$ is a centered probability law on $\mathbb R$ with finite second moment, there is a Brownian stopping time $T$ such that $B_T\sim\mu$, the stopped process $(B_{t\wedge T})$ is uniformly integrable, and $\mathbb ET=\int x^2\mu(dx)$.