Prove that the expected value of the training error is equal to generalization error for a class of binary clasiffiers
Let us call $L=L_{(D,f)}(h) = \mathbb{P}_{x \sim D} [h(x) \neq f(x)]$.

We know that $L_S(h)= \frac{1}{m}|\{x\in S : h(x) \neq f(x)\}|$, where $m$ is the size of $S$. 
Then $L_S(h)$ has values of the form $\frac{i}{m}$ with $0 \leq i \leq m$.

Also $\mathbb{P}[L_S(h)=\frac{i}{m}] = {m \choose i} L^i(1-L)^{m-i} $.

(Not sure why, but make sense since the probablility of taken $i$ $x$'s such that $h(x) \neq f(x)$ is precisely $L^i$, same thing with $(1-L)^{m-i}$ when $h(x) = f(x)$. Additionaly,
\begin{equation}
\label{1}
1=\sum_{i=0}^m {m \choose i} L^i(1-L)^{m-i} 
\end{equation} 

In this way:
\begin{align}
\mathbb{E}[L_S(h)] &amp;= \sum_{i=0}^m {m \choose i} L^i(1-L)^{m-i}*\frac{i}{m} \\
                   &amp;= \sum_{i=1}^m {m-1 \choose i-1} L^i(1-L)^{m-i}\\
                   &amp;= L \sum_{i=0}^{m-1} {m-1 \choose i} L^i(1-L)^{m-1-i}\\
&amp;=L
\end{align}