# Distance between mean and median

I want to solve the following problem in T.Tao's random matrix theory book. Let $X$ be a random variable with finite second momment. A median $M(X)$ of $X$ saisfies $\mathbb{P}(X>M(X)),\mathbb{P}(X<M(X))\leq 1/2$. Now I wan to prove that for any median: $$M(X)=\mathbb{E}(X)+O((\mathbb{Var}(X))^{1/2})$$

I think we have to use Chebyshev's inequality for this, which I have done to obtain: $$\mathbb{P}(X>\lambda \sigma)\leq \mathbb{P}(|X|>\lambda \sigma)\leq \frac{1}{\lambda ^2}$$ where $\sigma=(\mathbb{Var}(X))^{1/2}$. But I fail to interprete this...

• A stronger version of the above is actually true: $|M(X) - \mathbb{E}(X)| \le \sigma$, as proven by the answer below. Commented Mar 8, 2022 at 6:41

You have to use two things:

1. $\mathbb E(|X-c|)$ is minimized when $c=M(X)$ Proof.

2. Jensen inequality

Then you can have: $$\left|M(X)-\mathbb{E}(X)\right|=\left|\mathbb{E}(M(X)-X)\right| \\ \leq \mathbb{E}(\left|X-M(X)\right|)\leq \mathbb{E}(\left|X-\mathbb E(X)\right|) \\ \leq \sqrt{\mathbb{E}(\left|X-\mathbb E(X)\right|^2)}=(\mathbb{Var}(X))^{1/2}.$$

• What is the proof for $E[|X - E[X]|] \leq \sqrt{E[|X - E[X]|^2]}$?
– 24n8
Commented Aug 15, 2020 at 6:21
• @Iamanon Apply Jensen's inequality with $\varphi(x)=x^2$. Commented Aug 15, 2020 at 6:23
• @user1551 Ah yes, just realized that as I saw this.
– 24n8
Commented Aug 15, 2020 at 6:23

Here's a different proof that does not use the fact that $M(X)$ minimizes $c\mapsto E(|X-c|)$.

By Chebyshev’s one-sided inequality (also known as Cantelli's inequality), $$\forall t >0, P\left(\frac{X-E(X)}{\sqrt{Var(X)}}\geq t \right) \leq \frac{1}{1+t^2}$$

Hence, with $t=1$ $$P\left(X\geq E(X)+\sqrt{Var(X)} \right) \leq \frac{1}{2}$$ thus $M(X)\leq E(X)+\sqrt{Var(X)}$.

Replacing $X$ by $-X$ in the previous inequality (this transformation leaves $Var(X)$ untouched), we have $$P(X\leq E(X)-\sqrt{Var(X)})\leq \frac 12$$ thus $M(X)\geq E(X)-\sqrt{Var(X)}$.

Hence $-\sqrt{Var(X)} \leq M(X)-E(X) \leq \sqrt{Var(X)}$, which rewrites as $$|M(X)-E(X)|\leq \sqrt{Var(X)}$$

• I don't think that you can assert that $P(X \geq a) \leq 1/2 \implies M(X) \leq a$. Consider $P(X \in A) = \frac12\mathbf{1}_{0 \in A} + \frac12\mathbf{1}_{1 \in A}$. Then $a = 0.1$ satisfies the inequality, but $0.5$ is a median. Commented Dec 6, 2019 at 11:19
• But it is true that for $\epsilon > 0$, $P(X \geq a) \leq 1/2 - \epsilon \implies M(X) \leq a$. Indeed, if $b > a$, then, $P(X < b) > P(X < a) \geq 1/2 + \epsilon$ which opposes the required inequality for a median. Commented Dec 6, 2019 at 11:23