# Upper bound on absolute difference with squares

I'm looking for an upper bound on $$E_X\left[\left\vert X^2-(E[X])^2\right\vert\right]$$, where $$X$$ is a nonnegative random variable, with known $$E[X]$$ and $$E[X^2]$$, but unknown higher moments.

A lower bound is $$E[X^2]-(E[X])^2$$, and I wonder if a there is a constant multiple of this as an upper bound?

• Upper bound in terms of what, exactly? The absolute value sign is superfluous, because $E[X^2] \ge E[X]^2$ in any event, so you are asking for an upper bound for the variance, given that you know the variance.
– whuber
Commented Oct 4, 2023 at 2:41
• The issue is that the absolute value is a nonlinear function.
– axk
Commented Oct 4, 2023 at 2:52
• @Whuber - the absolute value sign is not superfluous: for non-constant random variables, there is a positive probability that $X<E[X]$ in which case $X^2 -(E[X])^2<0$ Commented Oct 4, 2023 at 8:48
• @Henry Thank you -- I had misread that by distributing expectation over the absolute value!
– whuber
Commented Oct 4, 2023 at 13:14

I would have thought you could say:

$$E\big|X^2-(E[X])^2\big| \le E\big|X^2+(E[X])^2\big| = E\big[X^2\big]+(E[X])^2$$

As an example to show it can come close:

• suppose $$X=1000$$ with probability $$\frac1{100}$$ and $$X=0$$ otherwise,

• so $$E[X]=10$$ and $$E[X^2]=10000$$,

• we get $$E[X^2]-(E[X])^2=9900$$ and $$E[X^2]+(E[X])^2=10100$$

• with $$E\big|X^2-(E[X])^2\big|=10098$$ closer to the upper bound.

As to your question of a constant multiple of the variance, the answer seems to be no. Adjusting the previous example, suppose $$X=1000$$ with probability $$\frac1{100}$$ and $$X=999$$ otherwise, so $$E[X]=999.01$$ and $$E[X^2]=998020.99$$, you have $$E[X^2]-(E[X])^2=0.0099$$ and $$E\big|X^2-(E[X])^2\big|=39.570498$$, almost four thousand times as big. This is not the worst case.

• You would have thought but...? Or do you think it still? Commented Oct 4, 2023 at 10:30
• @RichardHardy It was a quick response giving a bound which was not of the form requested. I often make mistakes when looking at something new (here I initially persuaded myself $E[X^2]$ was a bound and then found a counterexample), so I used a weaker tense and mood to reflect this. I still think it correct, but I am happy to leave my original words. Commented Oct 4, 2023 at 10:37
• Thanks, I understand. Commented Oct 4, 2023 at 10:38