# Standard deviation of sample: why $n-1$ instead of $n$?

I'm trying to undertand why we use $n-1$ instead of $n$ while calculating the standard deviation of a sample.

This site says that it is because $\sum{x_i-\overline{x}}=0$, and $\overline{x}$ is aready determined from before. Hence, the sample has $n-1$ degrees of freedom, while the population has $n$.

My question is what does degrees of freedom have to do with calculating the standard deviation? Is the definition of standard deviation $\sqrt{\frac{\sum{(x_i-\overline{x}})^2}{\text{ degrees of freedom}}}$ instead of $\sqrt{\frac{\sum{(x_i-\overline{x}})^2}{n}}$?

• This is known as Bessel's Correction, and a "proof of correctness" is available on the linked page. Sep 11, 2013 at 11:27

The main reason behind that is $\frac{1}{n-1}\sum_{i=1}^n (X_i - \bar{X})^2$ is the unbiased estimator of the population variance. So we divide $\sum_{i=1}^n (X_i - \bar{X})^2$ by $\frac{1}{n-1}$ instead of $\frac{1}{n}$.
• Samprity, my question is where did this formula come from? There must be a proof. If we're just correcting for underestimating, then why can't we have $\frac{1}{n-2}$ instead of $\frac{1}{n-1}$?