Show these two are the same (statistics) Show that $$\sum_{i=0}^n(x_i-\bar x)^2=\sum_{i=0}^n(x_i-\bar x)x_i$$
This is what I have done. Expanded the square $$\sum_{i=0}^n(x_i-\bar x)^2=\sum_{i=0}^n(x_i-\bar x)\times\sum_{i=0}^n(x_i-\bar x)$$ Not sure how to continue...
 A: Show that 
$$\sum_{i=0}^n(x_i-\bar x)^2=\sum_{i=0}^n(x_i-\bar x)x_i- \bar x\sum_{i=0}^n(x_i-\bar x)
$$
and use $$\sum_{i=0}^n(x_i-\bar x)= 0$$
Added: As requested in the comment, here is a more detailed derivation (editors please note that there are $n+1$ values $x_i, i=0\dots n$!)
$$\sum_{i=0}^n(x_i-\bar x)^2 =\sum_{i=0}^n(x_i-\bar x)(x_i-\bar x)
=\sum_{i=0}^n\Big((x_i-\bar x)x_i-(x_i-\bar x)\bar x)\Big)\\
=\sum_{i=0}^n(x_i-\bar x)x_i- \left(\sum_{i=0}^n(x_i-\bar x)\right)\bar x
=\sum_{i=0}^n(x_i-\bar x)x_i- \bar x\sum_{i=0}^n(x_i-\bar x)
$$
and from the definition of the mean you have: 
$$\bar x = \frac{1}{n+1}\sum_{i=0}^n x_i, \quad \text{i.e.} \quad (n+1) \bar x =\sum_{i=0}^n x_i$$
and therefore
$$\sum_{i=0}^n(x_i-\bar x)= \sum_{i=0}^n x_i-\sum_{i=0}^n \bar x = (n+1) \bar x - (n+1) \bar x = 0$$
A: Based on $\sum_{i=0}^{n}x_{i}=\left(n+1\right)\bar{x}$ you find:
$\sum_{i=0}^{n}\left(x_{i}-\bar{x}\right)^{2}=\sum_{i=0}^{n}\left(x_{i}^{2}-2\bar{x}x_{i}+\bar{x}^{2}\right)=\sum_{i=0}^{n}x_{i}^{2}-2\bar{x}\sum_{i=0}^{n}x_{i}+\left(n+1\right)\bar{x}^{2}=\sum_{i=0}^{n}x_{i}^{2}-2\left(n+1\right)\bar{x}^{2}+\left(n+1\right)\bar{x}^{2}=\sum_{i=0}^{n}x_{i}^{2}-\left(n+1\right)\bar{x}^{2}$
and
$\sum_{i=0}^{n}\left(x_{i}-\bar{x}\right)x_{i}=\sum_{i=0}^{n}\left(x_{i}^{2}-\bar{x}x_{i}\right)=\sum_{i=0}^{n}x_{i}^{2}-\bar{x}\sum_{i=0}^{n}x_{i}=\sum_{i=0}^{n}x_{i}^{2}-\left(n+1\right)\bar{x}^{2}$
so the expressions are equal.
A: The LHS is the the sum of squared deviations = nVar(X) = $n\{E[x^2] - E[x]^2\} = \sum x_{i}^2 - n\overline{x} = \sum (x_{i}-\overline{x})x_{i}$
