How $\frac{1}{n}\sum_{i=1}^n X_i^2 - \bar X^2 = \frac{\sum_{i=1}^n (X_i - \bar X)^2}{n}$ How 
$\frac{1}{n}\sum_{i=1}^n X_i^2 - \bar X^2 = \frac{\sum_{i=1}^n (X_i - \bar X)^2}{n}$ 
i have tried to do that by the following procedure:
$\frac{1}{n}\sum_{i=1}^n X_i^2 - \bar X^2$
=$\frac{1}{n}(\sum_{i=1}^n X_i^2 - n\bar X^2)$
=$\frac{1}{n}(\sum_{i=1}^n X_i^2 - \sum_{i=1}^n\bar X^2)$
=$\frac{1}{n} \sum_{i=1}^n (X_i^2 - \bar X^2)$
Then i have stumbled.

Expand the square and use that $\sum\limits_{k=1}^nX_k=n\bar{X}$:
$$
\begin{align}
\frac1n\sum_{k=1}^n(X_k-\bar{X})^2
&=\frac1n\sum_{k=1}^n(X_k^2-2X_k\bar{X}+\bar{X}^2)\\
&=\frac1n\left(\sum_{k=1}^nX_k^2-2n\bar{X}\bar{X}+n\bar{X}^2\right)\\
&=\frac1n\sum_{k=1}^nX_k^2-\bar{X}^2\\
\end{align}
$$
