The distribution with minimum median under mean constraint Consider the family of densities $\mathcal{P}_{\mu}$ which contains densities satisfying the following conditions:

*

*Lipshitz continuous (rate of change bounded above and below by some constants).


*Has finite support, which, without loss of generality we take to be $\Omega \in[0,1]$.


*Has a mean constraint $\mu = \int_{\Omega} xp(x)dx$.
We want to find $p \in \mathcal{P}_{\mu}$ that minimizes the median $\int_0^m p(x)dx = \frac{1}{2}$.
I have a few questions.
(1) Is this a well-posed problem?
(2) Is there an analytic way to find this distribution, or to bound the distance between $m$ and $\mu$ (as a function of the Lipchitz constants I guess)?
(3) It seems to me that this is not a "hard" problem, in the sense that it should be possible to approximate the solution numerically by quantizing the distribution, and writing  a minimization problem. The Lipchitz constraints and the mean constraints can be approximated by linear ones. The problem is that the objective, the median, is not so simple. It does seem "sort of" convex, but I am not sure how to make this tractable.
Any suggestions on any of these questions will be greatly appreciated!
 A: This problem can be analysed with cdf. Consider monotonous $F(x):[0,1]\to[0,1]$ to be the cdf, then the median is the x-coordinate of intersection point with horizontal line $p=1/2$. For mean, we can write:
$$
\int_0^1xF'(x)dx=\Big.xF(x)\Big|_0^1-\int_0^1F(x)dx=1-\int_0^1F(x)dx
$$
which is the area to the left of the curve $F(x)$.

Now, since $m_{\min}(\mu)$ is a continuous monotonous function as well, you can use the duality principle and instead of finding $\min m$ given $\mu$, you can search for $\max \mu$ given $m$.
The latter one is easier because, in terms of function $F(x)$, we want to find such a function that passes through the point $(m,1/2)$ and minimizes the area under the curve.
Without Lipshitz condition, it's trivial to find. It's $F(x)=\frac12\Theta(x-m)$, with the mean $\mu=(1+m)/2$ (if $\mu<1/2$ you can make $m=0$).
With Lipshitz bound $K$, it's not hard to prove that $F(x)$ will be a piecewise function of parabolas $\pm K(x-x_0)^2+f_0$ and straight lines. One can even solve this optimization problem analytically by hand, but it's a lot of tedious work since there are dozen of cases depending on $K$ and $m$. Computer assisted brute force can be more helpful.

