Is the cumulative distribution function evaluated on the expected value $\frac{1}{2}$

Let $$X$$ be a random variable with density function $$f(x)$$, so $$\int_{-\infty}^{+\infty}f(x)dx=1$$ and $$E(X)=\int_{-\infty}^{+\infty}{xf(x)dx}.$$ Then, my question is if $$\int_{-\infty}^{E(X)}{f(x)dx}=\frac{1}{2} ?$$ and if it is true, how can be proved? Otherwise, which would be a contra-example of this?

Thanks!

• So, the question is whether the mean is equal to the median and this is always true if the density is symmetric about a middle value and sometimes otherwise. For example in the not very magnificent seven 0, 0, 0, 1, 1, 1, 4 the mean is equal to the median but symmetry is lacking. I don't know how much more notation and machinery you want to use. – Nick Cox May 3 at 8:18
• Ok! I hadn't see that my question could be restated as asking if the mean is equal to the median. In this case, I see the answer it is clearly negative and I assume it should not be difficult to get a contra-example. Thanks! – iago May 3 at 8:48
• ... take some skew distribution; not every asymmetric distribution has mean different from median but you'd find a counterexample in no time. – Glen_b May 4 at 0:10

Since you're writing what look to be Riemann integrals, I presume we're keeping to the case where $$X$$ is a continuous random variable.

If $$m$$ is a value for which $$\int_{-\infty}^m f_X(x)\, dx =\frac12$$ then $$m$$ is a median of $$X$$ (if the density is $$>0$$ in a neighborhood of $$m$$, then $$m$$ will be unique; the median).

Since here the upper limit of the integral is given as $$m=E(X)$$, this amounts - as Nick Cox pointed out in comments - to saying "is there a distribution for which the mean differs from the median", and the obvious thing to do when searching for a counterexample is to try some distributions that are skew*.

Here's an obvious example: the exponential distribution, which has its median at $$\ln 2$$ times the mean (i.e. about 70% of the mean).

You might like to also consider the density

$$f(x) = \cases{ \begin{array}{lr} 0, & \text{for } x\leq 0\\ 2x, & \text{for } 0< x\leq 1\\ 0, & \text{for } x> 1 \end{array}}$$

as a simple one to try for yourself (since the integrations are particularly simple).

*(not every asymmetric distribution has mean different from median, however)