# The expected value of a convex function according to two distributions

[Spoiler: it's not true (see comments)]

I believe the following to be true, but am not sure how to prove it:

$$\mathbb{E}_1[x] > \mathbb{E}_2[x] \implies \mathbb{E}_1 [g(x)] > \mathbb{E}_2 [g(x)]$$ when $g$ is an increasing, convex function. (We can also restrict ourselves to $x \geq 0$ for my problem.) By the subscripts $1$ and $2$, I refer to two different probability distributions over x.

In the continuous case, we'd have

$$\int x f_1(x) dx > \int x f_2(x) dx \implies \int g(x) f_1(x) dx > \int g(x) f_2(x) dx$$

for two pdfs $f_1$ and $f_2$.

Question: Is my conjecture right, and if so, what's the proof?

What I've tried: We might like to write it this way:

$$\int x (f_1(x) - f_2(x)) dx > 0 \implies \int g(x) (f_1(x) - f_2(x)) dx > 0$$

I've tried using integration by parts to rewrite it in terms of $g^{\prime}(x)$ and the cdfs, but I wasn't able to carry that through. It seems promising, but I wasn't sure how to use it.

I also thought about assuming that $g(x)$ is analytic and using the Taylor series, but again, I'm not sure where to take that either.

Sidenote: It would also be cool to show whether $g$ has to be strictly increasing everywhere for this to be true.

-
My advice: do not try to prove this result, it does not hold (and counterexamples abound). – Did Apr 23 '12 at 6:23
OK, thanks, but I'm having trouble coming up with any counter-examples (pictorially, it seems counterintuitive). Could you give one or give me an idea of what to look for? Thank you! – usul Apr 23 '12 at 6:34
Compare uniform distributions on intervals with nearly equal midpoints. – Did Apr 23 '12 at 6:40
OK, I think I see by taking one distribution to be uniform on [0,1] and the other to be uniform on [0.5,0.5+epsilon]. The same argument with a minus epsilon would show a counterexample for concave functions. Thanks you, that answers my question! – usul Apr 23 '12 at 6:55
Indeed. A common practice in such cases is that the OP (you!) writes an answer which, after a while so that others can check it, may be accepted. This allows to close the question. – Did Apr 23 '12 at 9:55

Consider $g(x) = x^2$ . $f_2(0) = \frac{1}{2}, f_2(1) = \frac{1}{2}$. (So there is a 50-50 chance of realizing either zero or one.)
Then $\mathbb{E}_2(x) = 0.5$, and $\mathbb{E}_2(g(x)) = 0.5$.
Let $f_1(0.5) = \frac{1}{2}, f_1(0.5 + \epsilon) = \frac{1}{2}$. Then $\mathbb{E}_1(x) = 0.5 + \frac{\epsilon}{2}$, but $\mathbb{E}_1(g(x)) \approx \frac{1}{2} 0.25 + \frac{1}{2} 0.25 = 0.25$.
So we have a counterexample. A similar example could show that this not true in general for concave functions either -- only for $g(x)$ a linear function of $x$.