# A problem involving probability mass shift

Consider a probability model with sample space on the interval $[0,a]$ where $a$ is a finite positive real number. Consider two probability distributions $P_1$ and $P_2$ on the sample space, where $P_2$ is obtained by shifting an infinitesimal probability $dP$ from position $x_1$ in the interval to $x_2$. Random variable $X$ is defined as $X(\omega)=\omega$ on the interval. Assume the mean of $X$ under $P_1$ is $E(X)$.

Find a condition that does not involve $dP$ that is necessary and sufficient for $d(Var(X))\le 0$. If $P_1$ has mass of 0.5 at the ends of the interval, show that the condition is satisfied for all $x_1$ and $x_2$.

I picked this problem from an old book of mine. The condition I got to was $x_2+x_1-a\le 0$. However this seems to be dependent on $a$ and is not true for all $x_1$ and $x_2$ as the second problem demands.

-

Intuitively, you must bring the mass towards the mean to reduce the variance. I.e. the condition should be something like $|x_1-E(X)|\ge|x_2-E(X)|$.
To prove this formally, first, consider a discrete distribution: that takes the value $x_i$ with probability $p_i$. Then, the variance is $Var(X)=\sum_ip_i(x_i-E(X))^2$. To see what happens when you shift it such that $p_1$ becomes $p_1-\epsilon$ and $p_2$ becomes $p_2+\epsilon$ we need to take the partial derivative of the expression above keeping in mind that $\frac{\partial p_2}{\partial p_1}=-1$ and, given that, we also have $\frac{\partial E(X)}{\partial p_1}=x_1-x_2$. Therefore, $\frac{\partial Var(X)}{\partial p_1}=(x_1-E(X))^2-(x_2-E(X))^2-2(x_1-x_2)\sum_ip_i(x_i-E(X))$, the last term being zero. We need this expression to be non-negative (decrease in $p_1$ leads to decrease in $Var(X)$). Hence, we obtain the condition as above.