# Can you help me understand why the two equations are equivalent?

I have this equation:

$$-\frac{n-1}{n-2}\left\{ \frac{b\sum_{i=1}^{n}x_i^2\left[ x_i^2-\left( \frac{\sum_{j=1}^{n}x_j^2}{n}\right)\right]}{\left( \sum_{i=1}^{n}x_i^2 \right)^2} \right\} [1]$$

and he transforms it into: $$-\frac{n-1}{n-2}\left\{\frac{b\sum_{i=1}^{n}\left[x_i^2-\frac{\sum_{j=1}^{2}x_j^2}{n}\right]\left[x_i^2-\frac{\sum_{j=1}^{2}x_j^2}{n}\right]}{\left(\sum_{i=1}^{n}x_i^2\right)^2} \right\} +\frac{n-1}{n-2}\left\{\frac{\frac{b*\sum_{j=1}^{n}x_j^2}{n}\sum_{i=1}^{n}\left(x_i^2-\frac{\sum_{j=1}^{n}x_j^2}{n}\right)}{\left(\sum_{i=1}^{n}x_i^2\right)^2}\right\} [2]$$

I do not understand why equation [1] is equal to equation [2]. Also, how can someone come up with this. I would have never thought of doing this in an exam if that equation would have been given to me for the first time? Should I just memorize the process of doing this? I mean in an exam I don't have a few hours to just try and see what works. (this equation is part of demonstrating that that that the expected value of a term understimate the variance of another term)

• It isn't clear what equation you say is equal to zero – machazthegamer Apr 23 '17 at 19:39
• Also, is the second part(below "he transforms it into") one long equation or two equations equal to each other? – machazthegamer Apr 23 '17 at 19:40
• the equation on the bottom [2] is just one long equation. I just realized that the title was wrong. I had difficulty understanding why the second part is zero but I understood why while writing the question. So I changed the description of the questions but I forgot to change the title – Alex Apr 23 '17 at 20:03

Because $$\sum_{i=1}^n (z_i - \bar z)^2 = \sum_{i=1}^n z_i^2 - 2\bar z\sum_{i=1}^n z_i + \sum_{i=1}^n\bar z^2\\ = \sum_{i=1}^nz_i^2 - 2\bar z\frac{n}{n}\sum_{i=1}^nz_i + n\bar z^2\\ = \sum_{i=1}^nz_i^2 - 2n\bar z^2 + n\bar z^2\\ = \sum_{i=1}^nz_i^2 - n\bar z^2\\ = \overline{z^2} - \bar z^2\\$$ with $\overline{ z^k} = \frac{1}{n}\sum_{i=1}^n z_i^k$
Actually, only the first term in the second equation is relevant (you get it from equation 1 by the above described). Let $z_i = x_i^2$. Then note that in the second term in equation 2 that $\sum_{i=1}^n(z_i - \bar z) = \frac{n}{n}\sum_{i=1}^n z_i - n\bar z = n\bar z - n\bar z = 0$ so the second term vanishes.
And to answer your questions: actually this is very simple. The only thing is that it is written down very complicated... First, replace all $x_i^2$ by $z_i$. Then it already looks easier. Second step: replace all $\frac{1}{n}\sum_{i=1}^nz_i$ with $\bar z$. Then you are almost done -- provided you know this formula (well, you don't even have to memorize it since you can easily derive it, as shown above).