# Thread: Showing equality of two expressions for calculating variance.

1. ## Showing equality of two expressions for calculating variance.

2. Originally Posted by gaidd
$\displaystyle \frac{1}{n-1} \sum_{i=1}^n (x_i - \overline{x})^2 = \frac{1}{n-1} \sum_{i=1}^n x_i^2 - \frac{2 \overline{x}}{n-1} \sum_{i=1}^n x_i + \frac{1}{n-1} \sum_{i=1}^n \overline{x}^2$

$\displaystyle = \frac{1}{n-1} \sum_{i=1}^n x_i^2 - \frac{2 n \overline{x}}{(n-1)} \cdot \frac{1}{n} \sum_{i=1}^n x_i + \frac{n}{n-1} \overline{x}^2$

$\displaystyle \frac{1}{n-1} \sum_{i=1}^n x_i^2 - \frac{2 n \overline{x}^2}{n-1} + \frac{n}{n-1} \overline{x}^2$

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

3. Hello, gaidd!

Show that: . $\displaystyle{\tfrac{1}{n-1}\sum^n_{i=1}(x_i - \overline x)^2 \;=\;\tfrac{1}{n-1}\sum^n_{i=1} x_i^2 - \tfrac{n}{n-1}\,\overline{x}^2 }$

All sums are from $i = 1\text{ to }n$.

Recall that $\overline{x}$ is a constant.

$\frac{1}{n-1}\sum(x_i - \overline x)^2$

. . $= \;\frac{1}{n-1}\sum\left(x_i^2 - 2x_i\overline{x} + \overline{x}^2\right)$

. . $=\; \frac{1}{n-1}\bigg[\sum x_i^2 - \sum 2x_i\overline{x} + \sum \overline{x}^2\bigg]$

. . $=\; \frac{1}{n-1}\bigg[\sum x_i^2 - 2\overline{x}\sum x_i + \overline{x}^2\sum 1 \bigg]$

Multiply the middle term by $\frac{n}{n}$
Note that: . $\sum 1 \,=\,n$

. . . . $\frac{1}{n-1}\left[\sum x_i^2 - 2\overline{x}\,n\underbrace{\left(\frac{\sum x_i}{n}\right)} + \;\overline{x}^2\!\cdot\!n \right]$
. . . . . . . . . . . . . . . . This is $\overline{x}$

. . $=\; \frac{1}{n-1}\bigg[\sum x_i^2 - 2\overline{x}n\!\cdot\!\overline{x} + n\overline{x}^2\bigg]$

. . $=\;\frac{1}{n-1}\bigg[\sum x_i^2 - 2n\overline{x}^2 + n\overline{x}^2\bigg]$

. . $=\;\frac{1}{n-1}\bigg[\sum x_i^2 - n\overline{x}^2\bigg]$

. . $=\;\frac{1}{n-1}\sum x_i^2 - \frac{n}{n-1}\,\overline{x}^2$

Edit: Too slow . . . again!

4. Originally Posted by mr fantastic
$\displaystyle \frac{1}{n-1} \sum_{i=1}^n (x_i - \overline{x})^2 = \frac{1}{n-1} \sum_{i=1}^n x_i^2 - \frac{2 \overline{x}}{n-1} \sum_{i=1}^n x_i + \frac{1}{n-1} \sum_{i=1}^n \overline{x}^2$

$\displaystyle = \frac{1}{n-1} \sum_{i=1}^n x_i^2 - \frac{2 n \overline{x}}{(n-1)} \cdot \frac{1}{n} \sum_{i=1}^n x_i + \frac{n}{n-1} \overline{x}^2$

$\displaystyle \frac{1}{n-1} \sum_{i=1}^n x_i^2 - \frac{2 n \overline{x}^2}{n-1} + \frac{n}{n-1} \overline{x}^2$

$\displaystyle \frac{1}{n-1} \sum_{i=1}^n x_i^2 - \frac{n \overline{x}^2}{n-1}$
thank you mr fantastic,,, and i m sorry for the mistake i v done,,,"_*

5. Originally Posted by Soroban
Hello, gaidd!

All sums are from $i = 1\text{ to }n$.

Recall that $\overline{x}$ is a constant.

$\frac{1}{n-1}\sum(x_i - \overline x)^2$

. . $= \;\frac{1}{n-1}\sum\left(x_i^2 - 2x_i\overline{x} + \overline{x}^2\right)$

. . $=\; \frac{1}{n-1}\bigg[\sum x_i^2 - \sum 2x_i\overline{x} + \sum \overline{x}^2\bigg]$

. . $=\; \frac{1}{n-1}\bigg[\sum x_i^2 - 2\overline{x}\sum x_i + \overline{x}^2\sum 1 \bigg]$

Multiply the middle term by $\frac{n}{n}$
Note that: . $\sum 1 \,=\,n$

. . . . $\frac{1}{n-1}\left[\sum x_i^2 - 2\overline{x}\,n\underbrace{\left(\frac{\sum x_i}{n}\right)} + \;\overline{x}^2\!\cdot\!n \right]$
. . . . . . . . . . . . . . . . This is $\overline{x}$

. . $=\; \frac{1}{n-1}\bigg[\sum x_i^2 - 2\overline{x}n\!\cdot\!\overline{x} + n\overline{x}^2\bigg]$

. . $=\;\frac{1}{n-1}\bigg[\sum x_i^2 - 2n\overline{x}^2 + n\overline{x}^2\bigg]$

. . $=\;\frac{1}{n-1}\bigg[\sum x_i^2 - n\overline{x}^2\bigg]$

. . $=\;\frac{1}{n-1}\sum x_i^2 - \frac{n}{n-1}\,\overline{x}^2$

Edit: Too slow . . . again!
thank you Sir/ Soroban.....
you are really amazing,,,"_"