Calculating the variance of speed measurements Some speed measurements (km/h) outside Furutåskolan has been
observed. They are supposed to be outcomes from a random variable
with expectation . Result:
$29, 31, 36, 34, 33$
(a) Construct a condence interval for  at the condence level 0.05.
Write down the assumptions you made in your calculations.
When my teacher calculates the variance he does this:
$$
\bar x = (29 + 31 + 36 + 34 + 33)/5 = 32.6
$$
$$ s
2 = ((29 − 32.6)^2 + (31 − 32.6)^2 +
(36 − 32.6)^2 + (34 − 32.6)^2 + (33 − 32.6)^2
)/(5 − 1) = 7.3
$$
Why does my teacher divide by $(5-1)$ to calculate the variance rather than $5$?
 A: Using $n-1$ in the denominator instead of $n$ eliminates the bias in the estimate caused by the fact that $\bar x$ is being estimated from the same sample.
See here
A: You can calculate the expected value of $s^2$ and you will see, that $s^2$ is a unbiased estimator for $\sigma^2$,
$E(s^2)=E\left[\frac{1}{n-1}\sum_{i=1}^n (X_i-\overline X )^2\right]$
$=\frac{1}{n-1}E\left[\sum_{i=1}^n (X_i-\overline X)^2 \right] \quad | \pm \mu$
$=\frac{1}{n-1}E\left[\sum_{i=1}^n \left[(X_i-\mu)-(\overline X-\mu) \right]^2 \right] \quad$
multipliying out
$=\frac{1}{n-1}E\left[\sum_{i=1}^n \left[(X_i-\mu)^2-2(\overline X-\mu)(X_i-\mu)+(\overline X-\mu)^2 \right]\right] \quad$
writing for each summand a sigma sign
$=\frac{1}{n-1}E\left[\sum_{i=1}^n (X_i-\mu)^2-2(\overline X-\mu)\sum_{i=1}^n(X_i-\mu)+\sum_{i=1}^n(\overline X-\mu)^2 \right] \quad$
$=\frac{1}{n-1}E\left[\sum_{i=1}^n (X_i-\mu)^2-2(\overline X-\mu)\color{blue}{\sum_{i=1}^n(X_i-\mu)}+n(\overline X-\mu)^2 \right] \quad$

transforming the blue term
$\sum_{i=1}^n(X_i-\mu)=n\cdot \overline X-n\cdot \mu$
Thus $2(\overline X-\mu)\color{blue}{\sum_{i=1}^n(X_i-\mu)}=2(\overline X-\mu)\cdot (n\cdot \overline X-n\cdot \mu)=2n( \overline X- \mu)^2$

$=\frac{1}{n-1}E\left[\sum_{i=1}^n (X_i-\mu)^2-2n( \overline X- \mu)^2+n(\overline X-\mu)^2 \right] \quad$
$=\frac{1}{n-1}E\left[\sum_{i=1}^n (X_i-\mu)^2-n( \overline X- \mu)^2\right] \quad$
$=\frac{1}{n-1}\left[\sum_{i=1}^n E\left[(X_i-\mu)^2\right]-nE\left[( \overline X- \mu)^2\right]\right] \quad$
We know, that $E\left[(X_i-\mu)^2\right]=\sigma^2$ and $E\left[( \overline X- \mu)^2\right]=\sigma_{\overline x}^2=\frac{\sigma^2}{n}$ Thus we get 
$=\frac{1}{n-1}\left[n \cdot \sigma ^2-n \frac{\sigma ^2}{n}\right]=\frac{1}{n-1} \sigma^2 \cdot (n-1)=\boxed{\sigma ^2=E(s^2)}$
Thus $s^2$ is an unbiased estimator for $\sigma^2$.
