To estimate the [[Variance]] of a $n$ samples we divide by $(n-1)$ instead of $n$. This adjustment is called Bessel’s correction and ensures that the estimator of the variance [[Properties of an Estimator#Key Properties of an Estimator|unbiased]].
The corrected sample variance is given by:
$ S_n^2= \frac{1}{n-1}\sum_{i=1}^n(X_i - \mu)^2 $
Since the population mean $\mu$ is typically unknown, we replace it with the sample mean $\bar{X}_n$, leading to the formula:
$ S_n^2= \frac{1}{n-1}\sum_{i=1}^n(X_i - \bar X_n)^2 $
However, using $\bar X_n$ introduces a downward bias, because $\bar X_n$ will lead to the smallest possible squared differences, as the $X_i$ are perfectly centered around $\bar X_n$.
**Degrees of freedom:** The denominator $(n-1)$ is called the “degrees of freedom”. It represents the number of independent values in the sample, that are free to vary, when estimating statistical parameters (in this case the sample mean).