I have this line in a proof that I do not understand and would like some help understanding please.
$$\sum_{i=1}^{n}x_i^2-n\bar{x}^2 = \sum_{i=1}^{n}(x_i^2-2x_i\bar{x}+\bar{x}^2)$$
Can anybody enlighten me on this transformation please?
Thanks.
I have this line in a proof that I do not understand and would like some help understanding please.
$$\sum_{i=1}^{n}x_i^2-n\bar{x}^2 = \sum_{i=1}^{n}(x_i^2-2x_i\bar{x}+\bar{x}^2)$$
Can anybody enlighten me on this transformation please?
Thanks.
If $\bar x$ is the average $\bar x = \frac1n \sum_{i=1}^n x_i$, then $$\sum_{i=1}^n 2x_i \bar x = 2\bar x \sum_{i=1}^n x_i = 2n \bar x ^2. $$ Furthermore, $$ \sum_{i=1}^n \bar x^2 = \bar x^2 \sum_{i=1}^n 1 = n\bar x ^2 $$