# Homework Help: Prove the sample variance formula.

1. Sep 8, 2010

### The_Iceflash

1. The problem statement, all variables and given/known data
Prove that the sample variance of a sample is given by
S2 = $$\frac{\sum^{n}_{j=1}x_j^2 - \frac{1}{n} (\sum^{n}_{j=1}x_j)^2}{n-1}$$

2. Relevant equations

N/A

3. The attempt at a solution

For my purposes it is sufficient to show that:

$$\sum^{n}_{j=1}(x_j -x_j^2) = \sum^{n}_{j=1}x_j^2 - \frac{1}{n}\left(\sum^{n}_{j=1}x_j\right)^2$$

I got as far as this:

$$= \sum^{n}_{j=1}x_j^2 - \sum^{n}_{j=1}2\bar{x}x_j + \sum^{n}_{j=1}\bar{x}^2$$

I need help getting from there to here:

$$= \sum^{n}_{j=1}x_j^2 - \frac{1}{n}\left(\sum^{n}_{j=1}x_j\right)^2$$

Thanks in advance and I apologize for any coding error.

Last edited: Sep 8, 2010
2. Sep 8, 2010

Hint: remember that $\overline x$ is a constant and can be removed from summations.

3. Sep 8, 2010

### The_Iceflash

So if I put the $\overline x$'s in front

$$= \sum^{n}_{j=1}x_j^2 - 2\bar{x}\sum^{n}_{j=1}x_j + \bar{x}^2\sum^{n}_{j=1}$$

and rearrange it I get

$$= \sum^{n}_{j=1}x_j^2 +\bar{x}^2\sum^{n}_{j=1} - 2\bar{x}\sum^{n}_{j=1}x_j$$

My instincts tell me to factor out the $\overline x$ but I don't see how that could help.

4. Sep 8, 2010

Hint:

$$\sum_{i=1}^n \overline x_i = \overline x_i \sum_{i=1}^N 1$$

(you forgot to include the 1: what does the above sum equal?

Hint:

$$\overline x = \frac 1 n \sum_{i=1}^n x_i$$

so what must

$$\sum_{i=1}^n x_i$$

equal?

5. Sep 8, 2010

### The_Iceflash

So, $$\sum_{i=1}^n x_i$$ must be equal to $$n\overline x$$ correct?

The sum from the first sum is n, correct?