Intuitive explanation for dividing by $n-1$ when calculating standard deviation? I was asked today in class why you divide the sum of square error by $n-1$ instead of with $n$, when calculating the standard deviation.
I said I am not going to answer it in class (since I didn't wanna go into unbiased estimators), but later I wondered - is there an intuitive explanation for this?!
 A: Sample variance can be thought of to be the exact mean of the pairwise "energy" $(x_i-x_j)^2/2$ between all sample points. The definition of sample variance then becomes
$$ s^2 = \frac{2}{n(n-1)}\sum_{i< j}\frac{(x_i-x_j)^2}{2} = \frac{1}{n-1}\sum_{i=1}^n(x_i-\bar{x})^2 .$$
This also agrees with defining variance of a random variable as the expectation of the pairwise energy, i.e. let $X$ and $Y$ be independent random variables with the same distribution, then
$$ V(X) = E\left(\frac{(X-Y)^2}{2}\right) = E((X-E(X))^2) . $$
To go from the random variable defintion of variance to the defintion of sample variance is a matter of estimating a expectation by a mean which is can be justified by the philosophical principle of typicality: The sample is a typical representation the distribution. (Note, this is related to, but not the same as estimation by moments.)
A: A common one is that the definition of variance (of a distribution) is the second moment recentered around a known, definite mean, whereas the estimator uses an estimated mean.  This loss of a degree of freedom (given the mean, you can reconstitute the dataset with knowledge of just $n-1$ of the data values) requires the use of $n-1$ rather than $n$ to "adjust" the result.
Such an explanation is consistent with the estimated variances in ANOVA and variance components analysis.  It's really just a special case.
The need to make some adjustment that inflates the variance can, I think, be made intuitively clear with a valid argument that isn't just ex post facto hand-waving.  (I recollect that Student may have made such an argument in his 1908 paper on the t-test.)  Why the adjustment to the variance should be exactly a factor of $n/(n-1)$ is harder to justify, especially when you consider that the adjusted SD is not an unbiased estimator.  (It is merely the square root of an unbiased estimator of the variance.  Being unbiased usually does not survive a nonlinear transformation.)  So, in fact, the correct adjustment to the SD to remove its bias is not a factor of $\sqrt{n/(n-1)}$ at all!
Some introductory textbooks don't even bother introducing the adjusted sd: they teach one formula (divide by $n$).  I first reacted negatively to that when teaching from such a book but grew to appreciate the wisdom: to focus on the concepts and applications, the authors strip out all inessential mathematical niceties.  It turns out that nothing is hurt and nobody is misled.
A: Suppose that you have a random phenomenon. Suppose again that you only get  one $N=1$ sample, or realization,  $x$. Without further assumptions, your "only" reasonable choice for a sample average is $\overline{m}=x$. If you do not subtract $1$ from your denominator, the (uncorrect) sample  variance would be $$ V=\frac{\sum_N (x_n - \overline{m} )^2}{N}$$, or:
$$\overline{V}=\frac{(x-\overline{m})^2}{1} = 0\,.$$
Oddly, the variance would be null with only one sample. And having a second sample $y$ would risk to increase your variance, if $x\neq y$. This makes no sense. Intuitively, an infinite variance would be a sounder result, and you can  recovered it only by "dividing by $N-1=0$".
Estimating a mean is fitting a polynomial with degree $0$ to the data, having one degree of freedom (dof).  This Bessel's correction applies to higher degrees of freedom models too: of course you can fit perfectly $d+1$ points with a $d$ degree polynomial, with $d+1$ dofs. The illusion of a zero-squared-error can only be counterbalanced by dividing by the number of points minus the number of dofs. This issue is particularly sensitive when dealing with very small experimental datasets.
A: The sample mean is defined as $\bar{X} = \frac{1}{n}\sum_{i=1}^{n} X_i$, which is quite intuitive. But the sample variance is $S^2 = \frac{1}{n-1}\sum_{i=1}^{n} (X_i - \bar{X})^2$. Where did the $n - 1$ come from ? 
To answer this question, we must go back to the definition of an unbiased  estimator.  An unbiased estimator is one whose expectation tends to the true expectation. The sample mean is an unbiased estimator. To see why: 
$$ E[\bar{X}] = \frac{1}{n}\sum_{i=1}^{n} E[X_i] 
= \frac{n}{n} \mu = \mu $$
Let us look at the expectation of the sample variance, 
$$ S^2 = \frac{1}{n-1} \sum_{i=1}^{n} (X_i^2) - n\bar{X}^2 $$
$$ E[S^2] = \frac{1}{n-1} \left( n E[(X_i^2)] - nE[\bar{X}^2] \right). $$
Notice that $\bar{X}$ is a random variable and not a constant, so the expectation $E[\bar{X}^2] $ plays a role. This is the reason behind the $n-1$.
$$E[S^2] = \frac{1}{n-1} \left( n (\mu^2 + \sigma^2) - n(\mu^2 + Var(\bar{X})) \right). $$
$$Var(\bar{X}) = Var(\frac{1}{n}\sum_{i=1}^{n} X_i) 
= \sum_{i=1}^{n} \frac{1}{n^2} Var(X_i) 
= \frac{\sigma^2}{n} $$
$$E[S^2] = \frac{1}{n-1} \left( n (\mu^2 + \sigma^2) - n(\mu^2 + \sigma^2/n) \right). = \frac{(n-1)\sigma^2}{n-1} = \sigma^2 \\
$$
As you can see, if we had the denominator as $n$ instead of $n-1$, we would get a biased estimate for the variance! But with $n-1$ the estimator $S^2$ is an unbiased estimator. 
A: This is a total intuition, but the simplest answer is that is a correction made to make standard deviation of one-element sample undefined rather than 0.
A: The intuitive reason for the $n-1$ is that the $n$ deviations in the calculation of the standard deviation are not independent.  There is one constraint which is that the sum of the deviations is zero.  When we take that into account we are effectively dealing with $n-1$ quantities rather than $n$.  (Geometrically the deviation vector $x-\bar{x}$ is the projection of $x$ onto the space orthogonal to the space spanned by the vector of all ones and the space onto which it projects has dimension $n-1$.)
A: It is well-known (or easily proved) that the quadratic $\alpha z^2 + 2\beta z + \gamma$ has an extremum at $z = -\frac{\beta}{\alpha}$ which point is midway between the roots $\frac{-\beta - \sqrt{\beta^2-\alpha\gamma}}{\alpha}$ and $\frac{-\beta + \sqrt{\beta^2-\alpha\gamma}}{\alpha}$ of the quadratic.
This shows that, for any given $n$ real numbers $x_1, x_2, \ldots, x_n$, the quantity
$$G(a) = \sum_{i=1}^n (x_i-a)^2 = \left(\sum_{i=1}^n x_i^2\right)
-2a\left(\sum_{i=1}^n x_i\right) + na^2,$$
has minimum value when 
$\displaystyle a = \frac 1n \sum_{i=1}^n x_i =\bar{x}$.
Now, suppose that the $x_i$ are a sample of size $n$ from a distribution with unknown mean $\mu$ and unknown variance $\sigma^2$.
We can estimate $\mu$ as $\frac 1n \sum_{i=1}^n x_i = \bar{x}$ which
is easy enough to calculate, but an attempt to estimate $\sigma^2$
as $\frac 1n \sum_{i=1}^n (x_i-\mu)^2 = n^{-1}G(\mu)$ encounters the
problem that we don't know $\mu$. We can, of course, readily compute
$G(\bar{x})$ and we know that $G(\mu) \geq G(\bar{x})$, but how
much larger is $G(\mu)$? The answer is that
$G(\mu)$ is larger
than $G(\bar{x})$ by a factor of approximately $\frac{n}{n-1}$, 
that is,
$$G(\mu) \approx \frac{n}{n-1}G(\bar{x})\tag{1}$$ and
so the estimate
$\displaystyle n^{-1}G(\mu)= \frac 1n\sum_{i=1}^n(x_i-\mu)^2$ for the
variance of the distribution
can be approximated by
$\displaystyle \frac{1}{n-1}G(\bar{x}) = \frac{1}{n-1}\sum_{i=1}^n (x_i-\bar{x})^2.$
So, what is an intuitive explanation of $(1)$?
Well, we have that
\begin{align}
G(\mu) &= \sum_{i=1}^n (x_i-\mu)^2\\
&= \sum_{i=1}^n (x_i-\bar{x} + \bar{x}-\mu)^2\\
&= \sum_{i=1}^n \left((x_i-\bar{x})^2 + (\bar{x}-\mu)^2 
+ 2(x_i-\bar{x})(\bar{x}-\mu)\right)\\
&= G(\bar{x}) + n(\bar{x}-\mu)^2 + (\bar{x}-\mu)\sum_{i=1}^n(x_i-\bar{x})\\
&= G(\bar{x}) + n(\bar{x}-\mu)^2 \tag{2}
\end{align}
since $\sum_{i=1}^n (x_i-\bar{x}) = n\bar{x}-n\bar{x} = 0$.
Now,
\begin{align}
n(\bar{x}-\mu)^2 &= n\frac{1}{n^2}\left(\sum_{i=1}^n(x_i-\mu)\right)^2\\
&= \frac 1n \sum_{i=1}^n(x_i-\mu)^2 + \frac 2n \sum_{i=1}^n\sum_{j=i+1}^n(x_i-\mu)(x_j-\mu)\\
&= \frac 1n G(\mu) + \frac 2n \sum_{i=1}^n\sum_{j=i+1}^n(x_i-\mu)(x_j-\mu)\tag{3}
\end{align}
Except when we have an extraordinarily unusual sample in which
all the $x_i$ are larger than $\mu$ (or they are all smaller than
$\mu$), the summands $(x_i-\mu)(x_j-\mu)$ in the double sum on the 
right side of $(3)$ take on positive as well as negative values and
thus a lot of cancellations occur. Thus, the double sum can be expected
to have small absolute value, and we simply ignore it in comparison
to the $\frac 1nG(\mu)$ term on the right side of $(3)$. Thus, $(2)$
becomes
$$G(\mu) \approx G(\bar{x}) +  \frac 1nG(\mu)
\Longrightarrow G(\mu) \approx \frac{n}{n-1}G(\bar{x})$$
as claimed in $(1)$.
A: Why divide by $n-1$ rather than $n$? Because it is customary, and results in an unbiased estimate of the variance. However, it results in a biased (low) estimate of the standard deviation, as can be seen by applying Jensen's inequality to the concave function, square root.
So what's so great about having an unbiased estimator?  It does not necessarily minimize mean square error.  The MLE for a Normal distribution is to divide by $n$ rather than $n-1$.  Teach your students to think, rather than to regurgitate and mindlessly apply antiquated notions from a century ago.
A: You can gain a deeper understanding of the $n-1$ term through geometry alone, not just why it's not $n$ but why it takes exactly this form, but you may first need to build up your intuition cope with $n$-dimensional geometry. From there, however, it's a small step to a deeper understanding of degrees of freedom in linear models (i.e. model df & residual df). I think there's little doubt that Fisher thought this way. Here's a book that builds it up gradually:
Saville DJ, Wood GR. Statistical methods: the geometric approach. 3rd edition. New York: Springer-Verlag; 1991. 560 pages. 9780387975177
(Yes, 560 pages. I did say gradually.)
A: The standard deviation calculated with a divisor of $n-1$ is a standard deviation calculated from the sample as an estimate of the standard deviation of the population from which the sample was drawn. Because the observed values fall, on average, closer to the sample mean than to the population mean, the standard deviation which is calculated using deviations from the sample mean underestimates the desired standard deviation of the population. Using $n-1$ instead of $n$ as the divisor corrects for that by making the result a little bit bigger.
Note that the correction has a larger proportional effect when $n$ is small than when it is large, which is what we want because when n is larger the sample mean is likely to be a good estimator of the population mean.
When the sample is the whole population we use the standard deviation with $n$ as the divisor because the sample mean is population mean.
(I note parenthetically that nothing that starts with "second moment recentered around a known, definite mean" is going to fulfil the questioner's request for an intuitive explanation.)
A: The estimator of the population variance is biased when applied on a sample of the population. In order to adjust for that bias on needs to divide by n-1 instead of n. One can show mathematically that the estimator of the sample variance is unbiased when we divide by n-1 instead of n. A formal proof is provided here:
https://economictheoryblog.com/2012/06/28/latexlatexs2/
Initially it was the mathematical correctness that led to the formula, I suppose. However, if one wants to add intuition to a formula the already mentioned suggestions appear reasonable. 
First, observations of a sample are on average closer to the sample mean than to the population mean. The variance estimator makes use of the sample mean and as a consequence underestimates the true variance of the population. Dividing by n-1 instead of n corrects for that bias. 
Furthermore, dividing by n-1 make the variance of a one-element sample undefined rather than zero. 
A: At the suggestion of whuber, this answer has been copied over from another similar question.
Bessel's correction is adopted to correct for bias in using the sample variance as an estimator of the true variance.  The bias in the uncorrected statistic occurs because the sample mean is closer to the middle of the observations than the true mean, and so the squared deviations around the sample mean systematically underestimates the squared deviations around the true mean.
To see this phenomenon algebraically, just derive the expected value of a sample variance without Bessel's correction and see what it looks like.  Letting $S_*^2$ denote the uncorrected sample variance (using $n$ as the denominator) we have:
$$\begin{equation} \begin{aligned}
S_*^2
&= \frac{1}{n} \sum_{i=1}^n (X_i - \bar{X})^2 \\[8pt]
&= \frac{1}{n} \sum_{i=1}^n (X_i^2 - 2 \bar{X} X_i + \bar{X}^2) \\[8pt]
&= \frac{1}{n} \Bigg( \sum_{i=1}^n X_i^2 - 2 \bar{X} \sum_{i=1}^n X_i + n \bar{X}^2 \Bigg) \\[8pt]
&= \frac{1}{n} \Bigg( \sum_{i=1}^n X_i^2 - 2 n \bar{X}^2 + n \bar{X}^2 \Bigg) \\[8pt]
&= \frac{1}{n} \Bigg( \sum_{i=1}^n X_i^2 - n \bar{X}^2 \Bigg) \\[8pt]
&= \frac{1}{n} \sum_{i=1}^n X_i^2 - \bar{X}^2.
\end{aligned} \end{equation}$$
Taking expectations yields:
$$\begin{equation} \begin{aligned}
\mathbb{E}(S_*^2) 
&= \frac{1}{n} \sum_{i=1}^n \mathbb{E}(X_i^2) - \mathbb{E} (\bar{X}^2) \\[8pt]
&= \frac{1}{n} \sum_{i=1}^n (\mu^2 + \sigma^2) - (\mu^2 + \frac{\sigma^2}{n}) \\[8pt]
&= (\mu^2 + \sigma^2) - (\mu^2 + \frac{\sigma^2}{n}) \\[8pt]
&= \sigma^2 - \frac{\sigma^2}{n} \\[8pt]
&= \frac{n-1}{n} \cdot \sigma^2 \\[8pt]
\end{aligned} \end{equation}$$
So you can see that the uncorrected sample variance statistic underestimates the true variance $\sigma^2$.  Bessel's correction replaces the denominator with $n-1$ which yields an unbiased estimator.  In regression analysis this is extended to the more general case where the estimated mean is a linear function of multiple predictors, and in this latter case, the denominator is reduced further, for the lower number of degrees-of-freedom.
A: By definition, variance is calculated by taking the sum of squared differences from the mean and dividing by the size. We have the general formula

$\sigma^2= \frac{\sum_{i}^{N}(X_i-\mu)^2}{N}$ where $\mu$ is the mean and $N$ is the size of the population.

According to this definition, variance of the a sample (e.g. sample $t$) must also be calculated in this way.

$\sigma^2_t= \frac{\sum_{i}^{n}(X_i-\overline{X})^2}{n}$ where $\overline{X}$ is the mean and $n$ is the size of this small sample.

However, by sample variance $S^2$, we mean an estimator of the population variance $\sigma^2$. How can we estimate $\sigma^2$ only by using the values from the sample?
According to the formulas above, the random variable $X$ deviates from sample mean $\overline{X}$ with variance $\sigma^2_t$. The sample mean $\overline{X}$ also deviates from $\mu$ with variance $\frac{\sigma^2}{n}$ because sample mean gets different values from sample to sample and it is a random variable with mean $\mu$ and variance $\frac{\sigma^2}{n}$. (One can prove easily.)
Therefore, roughly, $X$ should deviate from $\mu$ with a variance that involves two variances so add up these two and get $\sigma^2=\sigma^2_t+\frac{\sigma^2}{n}$. By solving this, we get $\sigma^2=\sigma^2_t \times\frac{n}{n-1}$. Replacing $\sigma^2_t$ gives our estimator for population variance:

$S^2= \frac{\sum_{i}^{n}(X_i-\overline{X})^2}{n-1}$.

One can also prove that $E[S^2]=\sigma^2$ is true.
A: Generally using "n" in the denominator gives smaller values than the population variance which is what we want to estimate. This especially happens if the small samples are taken. In the language of statistics, we say that the sample variance provides a “biased” estimate of the population variance and needs to be made "unbiased".
If you are looking for an intuitive explanation, you should let your students see the reason for themselves by actually taking samples! Watch this, it precisely answers your question.
https://www.youtube.com/watch?v=xslIhnquFoE
A: I think it's worth pointing out the connection to Bayesian estimation.  Suppose you assume your data is Gaussian, and so you measure the mean $\mu$ and variance $\sigma^2$ of a sample of $n$ points.  You want to draw conclusions about the population.  The Bayesian approach would be to evaluate the posterior predictive distribution over the sample, which is a generalized Student's T distribution (the origin of the T-test).  This distribution has mean $\mu$, and variance $$\sigma^2 \left(\frac{n+1}{n-1}\right),$$
which is even larger than the typical correction.  (It has $2n$ degrees of freedom.)
The generalized Student's T distribution has three parameters and makes use of all three of your statistics. If you decide to throw out some information, you can further approximate your data using a two-parameter normal distribution as described in your question.
From a Bayesian standpoint, you can imagine that uncertainty in the hyperparameters of the model (distributions over the mean and variance) cause the variance of the posterior predictive to be greater than the population variance.
A: I'm jumping VERY late into this, but would like to offer an answer that is possibly more intuitive than others, albeit incomplete.
As others asserted, the population mean ($\mu$) and the sample mean ($\overline{X}$) are going to differ (where the larger the sample size the smaller the difference).
Let $e$ be the difference (or error) between the population and sample means:
$$
e = \mu - \overline{X}
$$
After rearranging:
$$
\overline{X} = \mu - e
$$
Thus:
$$
(X_i-\overline{X})^2 = (X_i-(\mu - e))^2 = (X_i - \mu + e)^2
$$
In other words $(X_i-\overline{X})^2$ conceals an error: $(X_i - \mu + e)^2$.
What does this result in?
The table below shows a population of $\{2, 4, 6\}$, so $\mu = 4$, and three possible sample means ($\overline{X}$):

*

*$4\ (e = 0)$

*$3.5\ (e = -0.5)$

*$4.5\ (e = 0.5)$
The (non-bold) numeric cells shows the squared difference. For example, with $X_1 = 2$ and $\overline{X} = 3.5$, $(X_i-\overline{X})^2 = 2.25$.
The bottom row shows the sum of squares (the numerator in $\frac{\sum(X_i-\overline{X})^2}{n}$), and as you can see, whenever there's an error, it is "overestimated".
To compensate for this, we have to take away something from the denominator.
$$
\begin{array}{|c|c|c|c|}
\hline
& \overline{X} = \mu = 4 & \overline{X} = 3.5 & \overline{X} = 4.5 \\ \hline
X_1 = 2 & 4 & 2.25 & 6.25 \\ \hline
X_2 = 4 & 0 & 0.25 & 0.25 \\ \hline
X_3 = 6 & 4 & 6.25 & 2.25 \\ \hline
\sum(X_i-\overline{X})^2 & \textbf{8} & \textbf{8.75} & \textbf{8.75} \\ \hline
\end{array}
$$
A: My goodness it's getting complicated!  I thought the simple answer was...  if you have all the data points you can use "n" but if you have a "sample" then, assuming it's a random sample, you've got more sample points from inside the standard deviation than from outside (the definition of standard deviation).  You just don't have enough data outside to ensure you get all the data points you need randomly.  The n-1 helps expand toward the "real" standard deviation.
