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.

Since you tagged it under statistics, note that the LHS is simply $E[X^2] - E[X]^2$, and the RHS is $E[(X-\bar{X})^2]$. Both of these are ways to write Variance of $X$, hence they are equal.
