Find an example of a PDF where the mode and median are the same, but the expectation is different

probabilityprobability distributionsprobability theory

We have continuous random variable X, and we need to find a conditional pdf: $f_X(x|X\in[0,\frac{\pi}{3}])$
such that Median of $f_X(X|X\in[0,\frac{\pi}{3}]) = $ Mode of $f_X(X|X\in[0,\frac{\pi}{3}]) \neq E(X|X\in[0,\frac{\pi}{3}])$.

I have come to conclusion that I can not use a symmetric function, as the median and expectation would be the same, and I have to choose a function that has a maximum that is not at 0 or $\frac{\pi}{3}$. The function will have to be integratable so that I can find the expectation.

Best Answer

The text doesn't require that the Expectation exist, it requires only that the $median=max \ne \mu$

So I easily found this solution.

Let's take a Cauchy distribution with median the midpoint in $[0;\frac{\pi}{3}]$

$$f(x)=\frac{1}{\pi}\frac{1}{(x-\frac{\pi}{6})^2+1}$$

Let's condition this PDF in the requested interval (it is enough to divide the PDF by the CDF in $\pi/3$) obtaining

$$f(x|X \in[0;\frac{\pi}{3}])=\frac{1}{2 arctan(\frac{\pi}{6})}\frac{1}{(x-\frac{\pi} {6})^2+1}$$

Now you have a continuos distribution defined in the support $[0;\frac{\pi}{3}]$, symmetric, with $Max=Median=\frac{\pi}{6} \ne \mu$ because the mean doesn't exist

That's all :)

EDIT: answering to comment

It is well known that the conditional distribution

$$f(x|X \in[0;\frac{\pi}{3}])=f(x)\frac{1}{F_X(\pi/3)-F_X(0)}$$

It is the $f(x)$ multiplied by a normalization coefficient and of course

$$F_X(\pi/3)-F_X(0)=\int_0^{\pi/3} f(t)dt$$

If you do not want to solve the integral you can use the known CDF of the Cauchy Distribution so the result is immediate;

Related Question