# Math Help - Expanded variance formula

1. ## Expanded variance formula

Textbook says that
we can convert $\sigma^2=\frac{1}{N}\sum_{i=1}^{N} (x_i-\mu)^2$ into less cumbersome $\sigma^2=\frac{1}{N}\sum_{i=1}^{N}x_i^2 -\mu^2$. ( $\mu$ is arithmetic mean.)

$\sigma^2=\frac{1}{N}\sum_{i=1}^{N} (x_i-\mu)^2=\frac{1}{N}\Big[\sum_{i=1}^{N}x_i^2+\sum_{i=1}^{N} (-2x_i\mu)+\sum_{i=1}^{N}\mu^2\Big]=\frac{1}{N}\Big[\sum_{i=1}^{N}x_i^2-2\mu\sum_{i=1}^{N} x_i+\mu^2\Big]$ $=\frac{1}{N}\Big[\sum_{i=1}^{N}x_i^2-2\mu(\mu*N)+\mu^2\Big]=\frac{1}{N}\sum_{i=1}^{N}x_i^2-2\mu^2+\frac{\mu^2}{N}$

How come I get $\frac{\mu^2}{N}$?

2. Originally Posted by courteous

$\sigma^2=\frac{1}{N}\sum_{i=1}^{N} (x_i-\mu)^2=\frac{1}{N}\Big[\sum_{i=1}^{N}x_i^2+\sum_{i=1}^{N} (-2x_i\mu)+\sum_{i=1}^{N}\mu^2\Big]=\frac{1}{N}\Big[\sum_{i=1}^{N}x_i^2-2\mu\sum_{i=1}^{N} x_i+\mu^2\Big]$ $=\frac{1}{N}\Big[\sum_{i=1}^{N}x_i^2-2\mu(\mu*N)+\mu^2\Big]=\frac{1}{N}\sum_{i=1}^{N}x_i^2-2\mu^2+\frac{\mu^2}{N}$

How come I get $\frac{\mu^2}{N}$?
You missed one factor.
$\sigma^2=\frac{1}{N}\sum_{i=1}^{N} (x_i-\mu)^2=\frac{1}{N}\Big[\sum_{i=1}^{N}x_i^2+\sum_{i=1}^{N} (-2x_i\mu)+\sum_{i=1}^{N}\mu^2\Big]=\frac{1}{N}$ $\Big[\sum_{i=1}^{N}x_i^2-2\mu(\mu*N)+\color{blue}N\mu^2\Big]$

3. Originally Posted by courteous
$\sigma^2=\frac{1}{N}\sum_{i=1}^{N} (x_i-\mu)^2=\frac{1}{N}\Big[\sum_{i=1}^{N}x_i^2+\sum_{i=1}^{N} (-2x_i\mu)+\sum_{i=1}^{N}\mu^2\Big]=\frac{1}{N}\Big[\sum_{i=1}^{N}x_i^2-2\mu\sum_{i=1}^{N} x_i+\mu^2\Big]$ $=\frac{1}{N}\Big[\sum_{i=1}^{N}x_i^2-2\mu(\mu*N)+\mu^2\Big]=\frac{1}{N}\sum_{i=1}^{N}x_i^2-2\mu^2+\frac{\mu^2}{N}$
How come I get $\frac{\mu^2}{N}$?