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,


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,


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




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,


where $\nu=-\frac{m+M}{n-2}$, so that


Second with as many values far away from $\mu=0$ for the upper bound,


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


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]$.)

  • $\begingroup$ I must be having problems reading today, because despite scanning this question many times I cannot find a definition of "$\kappa$" anywhere: exactly how is it determined by $M, m,n,$ and $\mu$ alone? BTW, the comments to the question at stats.stackexchange.com/questions/142655 might be of some interest concerning the upper bound. $\endgroup$
    – whuber
    Commented Dec 7, 2017 at 16:31
  • $\begingroup$ $\kappa$ is defined implicitly by the next-to-last displayed equation: $m\leq\kappa=-(n_mm+n_MM)\leq M$. $\endgroup$
    – equaeghe
    Commented Dec 7, 2017 at 21:32
  • $\begingroup$ @equaeghe The theorems you cited (Davies-Nagy) does not assume that $m=x_{(1)}$ nor $M=x_{(n)}$, they just say bounded variables. You are putting additional assumptions and claim a different result, so it is difficult to say what you mean by "tighter"? $\endgroup$
    – Henry.L
    Commented Dec 12, 2022 at 6:54
  • $\begingroup$ @Henry.L: m (minimum) and M (maximum) are bounds, so their results hold. That means that the extra assumption I'm making is that the minimum and maximum are known (that is explicit). So then given that, are my bounds tighter? $\endgroup$
    – equaeghe
    Commented Dec 13, 2022 at 9:18
  • $\begingroup$ Sure. I think so, but also more restrictive. $\endgroup$
    – Henry.L
    Commented Dec 13, 2022 at 13:50

1 Answer 1


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.

  • 1
    $\begingroup$ We have several threads that establish the mathematical equivalent of $$\sigma^2 \le (\mu-m)(M-\mu)$$ for arbitrary distributions supported on $[M,m]$ and show that it is tight: the maximum is attained for a two-point distribution giving probability $(M-\mu)/(M-m)$ to $m$ and probability $(\mu-m)/(M-m)$ to $M.$ In light of this, the bounds given in the question look plausible (but I haven't checked the derivation). For your case the situation is more complicated, because $m,\mu,M$ alone determine a relatively small finite number of possible values of $\sigma^2.$ $\endgroup$
    – whuber
    Commented May 4, 2018 at 20:57
  • $\begingroup$ “I think you left out n near the top of your question”: Thanks, clarified. $\endgroup$
    – equaeghe
    Commented May 7, 2018 at 11:52
  • $\begingroup$ “And more obviously, it must be the case that $m\leq\mu\leq M$”: I mention this as $m\leq0\leq M$ in my derivation, where $0=\mu$. $\endgroup$
    – equaeghe
    Commented May 7, 2018 at 12:17
  • $\begingroup$ “If n is too small, what you call $\nu$ will be outside the range $[m,M]$”: I don't think so; did you take into account that $\mu=0$ is assumed? $\endgroup$
    – equaeghe
    Commented May 7, 2018 at 12:20
  • 1
    $\begingroup$ “If the data are discrete, the bounds with that additional assumption are generally tighter”: I've now clarified that I consider the real-valued case. Also, I am quite sure that no general expression can be given in the discrete case, as you are faced with a non-linear integer programming problem to determine which sets of samples are feasible. (Of course, if you make additional assumptions, this picture may change.) $\endgroup$
    – equaeghe
    Commented May 7, 2018 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.