# Maximizing variance with compact support

Claim: Let $X$ be a random variable whose support is $[0,r]$. Then $\text{Var }X<\frac{r^2}{4}.$

I'm not sure how to prove this claim, but the intuitive idea is that you saturate the inequality by calculating the variance when $P(X=0)=P(X=r)=\frac{1}{2}$.

I want to find a bivariate generalization of the above theorem. Specifically, something like the following:

Claim: Let $X$ and $Y$ be random variables with a joint compact support of area $A$. Then $\text{Var }X \cdot \text{Var }Y - \text{Cov}^2(X,Y) < ???$

I would like to figure the value of '???' as a function of $A$ if it even exists. And also perhaps prove the claim if it is true. Can you help?

Clearly by definition of variance, if you move some probability mass farther away from the mean then this will increase variance. So all the probability mass is split between $0$ and $r$. Let $p = p(r)$. Then the mean is $pr$ and the expectation of the square is $pr^2$. Thus you want to maximize $pr^2 - (pr)^2 = r^2p(1-p)$. You can show the maximum occurs at $p = 1/2$ in which case the variance is $r^2/4$. I'm not sure about the two variable generalization but it seems like the maximum should occur when the two variables are independent, i.e. your support is a rectangle. If that's true, then you get the same answer for your variance quantity if $A$ is fixed regardless of the side lengths of your rectangle, and I believe the answer for the maximum will be $A^2/16$.