$$
Expanding the square, we get:
$$ \sum_{i=1}^n\left(X_i^2 - 2X_i\bar{X} + \bar{X}^2\right). $$
Distribute the summation over the terms:
$$ \sum_{i=1}^n X_i^2 - 2\bar{X}\sum_{i=1}^n X_i + \sum_{i=1}^n \bar{X}^2. $$
Since \(\bar{X}\) is the mean of \(X_i\), we
Show more…