Solution (source code)

= Solution

The discrete-time <Doob L2 maximal inequality> states that a <square-integrable> <martingale> satisfies
$$
\boxed{\mathbb E\!\left[\max_{0\leq k\leq n}|M_k|^2\right]\leq4\mathbb E|M_n|^2.}
$$
Equivalently, the <Lp norm> of the maximum at $p=2$ is at most $2\|M_n\|_2$. The same assertion holds for a nonnegative <square-integrable> <submartingale>. No assumption $M_0=0$ is required; for a bound in terms of fluctuations from the initial value, apply it to $(M_k-M_0)$.