Why a Bounded Range Limits Variability
If a random variable cannot leave a finite interval, its values cannot be arbitrarily far from their mean. This simple restriction gives a precise upper bound on its variance. The bound depends only on the interval width, and it is sharp: an appropriate distribution concentrated at the two endpoints attains it.
A more informative inequality retains the location of the mean within the interval. We will derive that bound first, then maximize it over possible means. Keeping these two steps separate makes the equality conditions transparent.
Since \(a\le X\le b\) almost surely, the mean also satisfies \(a\le\mu\le b\). The first bound below uses both endpoints and the value of \(\mu\); the second removes the mean to give a bound depending only on the interval length.
The Mean-Sensitive Variance Bound
Proof. For every \(x\in[a,b]\), both \(x-a\) and \(b-x\) are nonnegative. Therefore \((X-a)(b-X)\ge0\) almost surely. Expanding this product and taking expectations gives
Because \(X\) has a finite second moment, \(\operatorname{Var}(X)=E[X^2]-\mu^2\). Subtracting \(\mu^2\) from the last inequality yields
To bound the product, write \(d=b-a\). Direct expansion gives
Combining the inequalities proves \(\operatorname{Var}(X)\le(b-a)^2/4\). When \(a=b\), the almost-sure condition forces \(X=a\) almost surely, so \(\mu=a\) and the variance is zero; the same displayed bounds also give zero. \(\square\)
The mean-sensitive bound is strongest when the mean is near the center of the interval. If \(\mu\) is close to either endpoint, the product \((b-\mu)(\mu-a)\) is small. In particular, if \(\mu=a\) or \(\mu=b\), the variance must be zero.
Worked Example: An Endpoint Distribution With an Off-Center Mean
Let \(X\) equal \(2\) with probability \(0.7\) and \(10\) with probability \(0.3\). Its values lie in \([2,10]\). Calculate its mean and variance, and compare them with both bounds.
The mean is
The deviations from the mean are \(2-4.4=-2.4\) and \(10-4.4=5.6\), so
The mean-sensitive bound is \((10-4.4)(4.4-2)=5.6(2.4)=13.44\), so equality holds. The range-only bound is \((10-2)^2/4=64/4=16\), which is valid but not attained here. The mean is not at the interval midpoint, so the mean-sensitive bound is strictly smaller than the range-only bound.
When Are the Bounds Sharp?
There are two distinct equality questions. The mean-sensitive inequality can be sharp for a given mean anywhere in \([a,b]\). The range-only inequality is sharp only when the mean is at the midpoint as well as when the mean-sensitive inequality is sharp.
Assume first that \(a<b\). Equality in the first inequality of the proof holds exactly when \((X-a)(b-X)=0\) almost surely. To see this, the random variable \((X-a)(b-X)\) is nonnegative and bounded; its expectation is zero if and only if it is zero almost surely. Within \([a,b]\), its zeros are precisely \(a\) and \(b\). Thus equality in the mean-sensitive bound holds exactly when \(X\) is supported on the two endpoints, allowing one endpoint to have probability zero.
More explicitly, if \(P(X=b)=p\) and \(P(X=a)=1-p\), then
This formula is valid under the stated condition \(a<b\). For every \(\mu\in[a,b]\), it gives a probability \(p\in[0,1]\), and the resulting endpoint-supported distribution attains the mean-sensitive bound. Indeed, its variance is
If \(a=b\), this parameterization is not used: \(X=a\) almost surely, both bounds are zero, and any endpoint-probability description is unnecessary.
For the range-only bound, the identity
shows that its maximum over \(\mu\in[a,b]\) is attained only at \(\mu=(a+b)/2\), provided \(a<b\). Combining this with the equality condition just established, the range bound is attained exactly by a distribution assigning probability \(1/2\) to each endpoint. When \(a=b\), it is attained by the only possible distribution, the constant \(X=a\).
Worked Example: Attaining the Range Bound
Let \(X\) take the values \(0\) and \(8\), each with probability \(1/2\). Then \(X\in[0,8]\) almost surely and
Its variance is
The range bound is \((8-0)^2/4=64/4=16\), so equality holds. The mean-sensitive bound also equals \((8-4)(4-0)=16\). The mean is the midpoint of the interval, and the distribution puts equal probability on its endpoints, exactly the conditions for attaining the range bound.
Comparing Continuous and Interior-Supported Distributions
The extremal distribution is not generally continuous, nor does it need to put positive probability throughout the interval. The following examples show how the same bound applies across different types of distributions and how interior values can make it strict.
Worked Example: A Uniform Distribution on an Interval
Suppose \(X\) is uniform on \([-1,5]\). Its density is \(f(x)=1/6\) on that interval, and its mean is the midpoint, \(\mu=2\). Calculate the variance directly:
Here the interval width is \(6\), so the range bound is \(6^2/4=9\). The mean-sensitive bound is \((5-2)(2-(-1))=3(3)=9\) as well. The actual variance, \(3\), is below both bounds: unlike the extremal endpoint distribution, the uniform distribution also assigns probability to interior values.
Worked Example: Interior Mass Makes the Bound Strict
Suppose \(X\) takes values \(1,4,7\) with probabilities \(1/4,1/2,1/4\), respectively. The support lies in \([1,7]\). Its mean is
The second moment and variance are
Both bounds equal \(9\): \((7-1)^2/4=9\) and \((7-4)(4-1)=9\). The variance is strictly smaller. The value \(4\) has positive probability, so \(X\) is not concentrated entirely on the two endpoints; the equality condition for the mean-sensitive inequality fails.
Interpretation and a Common Pitfall
The range-only bound gives an immediate scale statement: a random variable confined to an interval of width \(b-a\) has standard deviation at most half that width. This does not say that every distribution on the interval is nearly as variable as the extremal endpoint distribution. The uniform and three-point examples have variance strictly below the maximum.
Common mistake: applying the endpoint probability formula \(p=(\mu-a)/(b-a)\) without checking that \(a<b\). If \(a=b\), the denominator is zero, and the expression is undefined. The correction is to handle this case directly: \(a\le X\le a\) almost surely forces \(X=a\) almost surely, hence \(\operatorname{Var}(X)=0\). For \(a<b\), the formula is valid, and it constructs an endpoint distribution with any feasible mean.
A second useful check is to distinguish equality in the two bounds. Endpoint support alone gives equality in the mean-sensitive bound, but it does not by itself give equality in the range-only bound. The mean must also be the interval midpoint, which for an endpoint-supported distribution requires equal endpoint probabilities.
Check Your Understanding
Use the bounds and equality conditions to answer these questions.
- If \(X\in[3,11]\) almost surely and \(E[X]=7\), what is the mean-sensitive variance bound, and what is the range-only bound?
- For \(a<b\), what endpoint probability \(P(X=b)\) gives an endpoint-supported distribution with mean \(\mu\)? State the allowable range of \(\mu\).
- What must be true about the distribution for equality in \(\operatorname{Var}(X)\le(b-\mu)(\mu-a)\)?
- What additional condition gives equality in \(\operatorname{Var}(X)\le(b-a)^2/4\) when \(a<b\)?
- If \(a=b\) and \(a\le X\le b\) almost surely, determine \(X\) and its variance. Why is the endpoint probability formula not appropriate?