Solution (source code)

= Solution

Apply the bounded-differences inequality with every
$L_i=2\beta+M/n$. With probability at least $1-\delta$,
$$
F(D)\leq\mathbb EF(D)
+\left(2\beta+\frac Mn\right)
\sqrt{\frac{n\log(1/\delta)}2}.
$$
Using part (c) and substituting the definition of $F$ gives
$$
\boxed{
\frac1n\sum_{i=1}^n\ell(H_D(X_i),Y_i)
+\beta+(2n\beta+M)\sqrt{\frac{\log(1/\delta)}{2n}}
\geq\mathbb E\ell(H_D(X),Y)}.
$$