1

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...

user95087
  • 629

3 Answers3

6

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$$

gammatester
  • 18,827
  • your answer is better than mine. – drhab Oct 08 '13 at 14:09
  • Can you elaborate how to you got $$\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) ?$$ – user95087 Oct 09 '13 at 01:26
  • Just edit-in some intermediate steps – gammatester Oct 09 '13 at 07:02
  • @drhab I disagree: your answer is more straightforward, as it just expands the inside of each $;\sum;$ into separate terms, then separates into different $;\sum;$s, and then simplifies each part. This answer is more difficult to follow for me: it is not clear why each of the steps is taken. Your answer pulls no rabbits out of high hats. – MarnixKlooster ReinstateMonica Oct 09 '13 at 15:18
  • @user95087 It seems you have edited in something which is wrong. There are $n+1$ terms, not $n$ in the average. – Macavity Oct 25 '13 at 04:50
2

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.

drhab
  • 151,093
0

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}$