Show that if $Y$ is another random variable such that $E[X] = E[Y]$ and $V(X) = V(Y)$ then $P(Y \ge a) \le p$ Let $p \in (0,1)$ and $X$ be a random variable such that $P(X=a) = p, P(X=-b) = 1-p$
Show that if $Y$ is another random variable such that $E[X] = E[Y]$ and $V(X) = V(Y)$ then $P(Y \ge a) \le p$ and that equality holds iff $X$ and $Y$ are equal in distribution.
I have a hint to use Chebychev's inequality here but I am not quite getting the desired result.
By Chebychev we have $P(\lvert Y - E[Y] \rvert \ge a ) \le \frac{V(Y)}{a^2}$ which we can re-write with $E[X]$ and $V(X)$ but I am still not getting the result.
I can write it as:
$P(Y \ge a) = P( Y - E[X] \ge a - E[X]) \le P( \lvert Y - E[X] \rvert \ge a - E[X]) \le \frac{V(X)}{(a-E[X])^2} = \frac{p(a+b)^2(1-p)}{(a-E[X])^2}$
which would be using Chebychev but this doesnt help since $E[X] = ap - b(1-p)$ and $(a-E[X])^2 = [(1-p)(a+b)]^2$ so if say $p = \frac{1}{2}$ then I just get the last part being equal to $1$ which doesn't insure the original is less than or equal to $p$.
 A: for a simple solution, make use of the fact that the equalities of mean and variance are not affected by affine transformations to the underlying random variables so
1.)  we can assume WLOG that $b=0$. The result trivially holds when $a=0$ (as both r.v.'s have zero mean and zero variance), so assume $a\gt 0$.
2.) we can divide out $a$ and assume WLOG that $a =1$
First notice:
$E\big[X^2\big] -E\big[X\big]^2= \operatorname{var}\big(X\big) = \operatorname{var}\big(Y\big)= E\big[Y^2\big] -E\big[Y\big]^2\longrightarrow E\big[X^2\big]= E\big[Y^2\big]$
because $E\big[X\big] = E\big[Y\big]$.  Then
$P\big(Y \geq a)\leq P\big(\vert Y\vert \geq a)= P\big(Y^2 \geq a^2) \leq \frac{E\big[Y^2\big]}{a^2} = E\big[Y^2\big] =  E\big[X^2\big] =p \cdot a^2 = p$
by Markov's Inequality
addendum
for avoidance of doubt here are two other basics taken for granted in the above
i)
for any $\lambda \in \mathbb R$
$Y':= Y +\lambda$
$P(Y\leq \eta\big) = P(Y'\leq \eta + \lambda\big)$
ii)
for any $c \gt 0$
$Y'':= c\cdot Y'$
$P(Y'\leq \gamma\big) = P(Y''\leq c\gamma\big)$
what the above does with the "WLOG" statements is actually prove the result for the nice case of $Y''$ which gives the result for $Y'$ which gives the result for $Y$.  We 'want' to look at the $Y''$ case because it has an associated $X''$ case where $X''$ is a Bernouli, which is standard form for a binary r.v.
