Tightest bounds on sample variance given sample size, mean, minimum, and maximum For real-valued samples (possibly known to lie in some interval, but without further constraints on them), I am interested in the tightest possible bound on the sample variance $\sigma^2$, given the sample size $n$, sample mean $\mu$, sample minimum $m$, and sample maximum $M$. The context is that of data-sets with these statistics and the sample standard deviation. Namely, tuples $(m, M, \mu, \sigma)$ with $n$ fixed. Their use would be to check the consistency of these values. (You would be amazed to see what errors appear in such datasets!)
I have come across the lower bound attributed to Gyula (Julius) von Szőkefalvi Nagy,
$$\sigma^2\geq\frac{1}{n}\frac{M-m}{2},$$
but have not identified this bound in the claimed source or an academic reference; I assume that $n$ needs to be replaced by $n-1$ if Bessel's correction is used.
I have come across the upper bound named after Bathia and Davis, 
$$\sigma^2\leq(M-\mu)(\mu-m).$$
Their paper “A Better Bound on the Variance” is easy to locate.
However, neither bound is claimed to be the tightest possible given $n$, $\mu$, $m$, and $M$. A priori, this seemed unlikely to me as well, because the lower bound does not make use of $\mu$ and the upper does not make use of $n$.
So, my first question is: Have the tightest bounds been described in the literature, and if so, where?
In case this question cannot be answered positively, I have a follow-up question: Are the bounds I derive below the tightest ones? (To start perhaps: Are they valid?)
In what follows, I assume without loss of generality (wlog) that $\mu=0$, so $m\leq0\leq M$. I will work with the samples through their order statistics, i.e.,
$$m=x_{(1)}\leq x_{(2)}\leq\dots\leq x_{(i)}\leq\dots\leq x_{(n-1)}\leq x_{(n)}=M.$$
So then
$$\mu=\frac{1}{n}\sum_{i=1}^nx_{(i)}=\frac{1}{n}\left(m+\sum_{i=2}^{n-1}x_{(i)}+M\right)=0$$
and
$$\sigma^2=\frac{1}{n-1}\sum_{i=1}^n{x_{(i)}}^2=\frac{1}{n-1}\left(m^2+\sum_{i=2}^{n-1}{x_{(i)}}^2+M^2\right).$$
Based on the principle that $kz^2\leq(kz)^2$ for $k\in\mathbb{Z}_{>0}$ and $z\in\mathbb{R}$, we construct hypothetical samples that should minimize and maximize the variance.
First with as many possible values close to $\mu=0$ for the lower bound,
$$0=m+\sum_{i=2}^{n-1}x_{(i)}+M=m+(n-2)\nu+M,$$
where $\nu=-\frac{m+M}{n-2}$, so that 
$$\sigma^2\geq\frac{1}{n-1}\left(m^2+(n-2)\nu^2+M^2\right).$$
Second with as many values far away from $\mu=0$ for the upper bound,
$$0=m+\sum_{i=2}^{n-1}x_{(i)}+M=n_mm+\kappa+n_MM,$$
where $n_m=\lfloor n\alpha\rfloor$ and $n_M=\lfloor n(1-\alpha)\rfloor$ with $\alpha=\frac{M}{M-m}$ from $0=\alpha m + (1-\alpha)M$ implying $(n_m+n_M=n\wedge\kappa=0)\vee(n_m+n_M=n-1\wedge m<\kappa<M)$, so that
$$\sigma^2\leq\frac{1}{n-1}\left(n_mm^2+\kappa^2+n_MM^2\right).$$
I have checked that these bounds are indeed tighter than the Nagy and Bathia-Davis ones. (I took wlog that $-m=1\geq M$ and plotted for $M\in(0,1]$ and $n\in[3,600]$.)
 A: I was looking into the same question in the discrete case and just found your great question: I wanted to find the smallest possible sample standard deviation for a list of integers with known minimum, maximum, mean, and cardinality, and I found nothing beyond the citations you listed.
To answer your question’s two parts,
a) Your bounds on the variance look both correct and tight to me;
   you’ve described specific distributions that minimize and maximize
   the variance and have the same other given statistics.
b) It sure looks like the bounds you give are nowhere
   published. They deserve to be, I think. They’re certainly not
   published anywhere easy to find, and as it sounds like we’ve both
   seen, peer reviewers and editors sometimes aren’t aware of them!
   [Disclaimer: I’m not a statistician, and I haven’t done
   comprehensive research; I mostly googled, but I googled a lot, and
   that tends to work pretty well much of the time.]
In terms of a resource to help run “sanity checks” of summary statistics by testing whether a tuple $(n,m, M, \mu, \sigma)$ is mathematically possible (I think you left out $n$ near the top of your question), you could go a little further in a couple of ways.


*

*A bounds-check on $\sigma$ isn’t a definitive test for a tuple,
because there is a minimum value of $n$ (depending on more-or-less how “centrally located” $\mu$ is with respect to $m$ and $M$) for which $n$ data values can
have minimum $m$, maximum $M$, and mean $\mu$. If $n$ is too small,
what you call $\nu$ will be outside the range $[m,M]$. For example, suppose $m=-1$, $M=10$, and $n=10$. Then $\nu=-\frac{m+M}{n-2}=-\frac98<m$.

*If the data are discrete, the bounds with that additional
assumption are generally tighter, and exact bounds in that case would be good to give — at least for equally-spaced data, like “number of $X$” or Likert-scale survey data.

*Also, but maybe not worth the bother to work out, for the discrete case,
not every possible $\sigma$ within your bounds is attainable for a
given $n$, so the bounds-check isn’t definitive, even if $n$, $m$, $M$, and $\mu$ are simultaneously attainable.
For what it’s worth, I don’t immediately see the Nagy bound in the cited Nagy paper, either, but I’m not even close to fluent in mathematical German.
