# Variance of discrete distribution exceeds variance of discrete uniform distribution

I am not a mathematician, so I don't quite understand how comes that a variance of some discrete probability distribution could exceed the variance of the discrete uniform distribution. I thought that variance of any distribution will be capped by the variance of the flat distribution.

My case:
I have the following probability distribution for the discrete random variable on the [0,4] interval:
0.66$$\hspace{0.5cm}$$0.16$$\hspace{0.5cm}$$0.01$$\hspace{0.5cm}$$0.01$$\hspace{0.5cm}$$0.16

I compute the variance of this distribution using:
$$\text{Var}(X) = \sum_{i=1}^n p_i\,\cdot\,(x_i - \mu)^2$$ and I get 2.1275, while the variance for the discrete uniform distribution, according to this formula $$\text{Var}(X) = \frac{n^2 - 1}{12}, \quad \text{where }n=b-a+1$$ should be 2.0 on the same interval, i.e., for $$b-a = 4$$.

This bugs me a lot. Please tell me what I am missing. Thank you for your time.

• Surely a symmetric U-shaped distribution (i.e. with more probability near the ends than the middle) will have a higher variance than the uniform (since more of the distribution is further from the mean). Aug 19, 2021 at 9:43
• @Glen_b Now that you've said that, it makes perfect sense to me that this could be the case. In physics we just don't encounter these scenarios and such possibility of having U-shaped distributions didn't even cross my mind. Thank you. Aug 19, 2021 at 9:54
• You made an error. Most of your probability is concentrated on the values $0,1,$ and $2,$ which (intuitively) must make the standard deviation substantially less than $(2-0)/2 = 1.$ I compute the variance as $0.4475$ rather than $2.1275.$
– whuber
Aug 19, 2021 at 18:47
• @whuber You are right, I pasted a wrong line from my data file which looked very similar to the other line for which I obtain 2.1275 for the variance. I am very sorry, I fixed the question. Thank you for pointing this out. Aug 20, 2021 at 7:35

Popoviciu's inequality states that the sharp upper bound on the variance $$\sigma^2$$ of any bounded probability distribution with support on $$[a, b]$$ is: $$\sigma^2\leq \frac{1}{4}(b - a)^2$$ In your case, $$a= 0, b = 4$$ so we have $$\sigma^2\leq 4$$. This is achieved precisely when half of the probability is concentrated at each of the two bounds.