Equality in Markov's inequality (source code)

= Equality in Markov's inequality
{title2=$Y\in\{0,a\}\quad\text{almost surely}$}

For a finite-<expected value> nonnegative <random variable> and $a>0$, equality in the uncapped <Markov's inequality> holds exactly when $Y$ takes only $0$ and $a$ <almost surely>. Indeed the nonnegative difference $Y-a\mathbf1_{\{Y\geq a\}}$ has zero <expected value> exactly when it vanishes <almost surely>. Giving $a$ <probability> $p$ yields $\mathbb E Y=pa$ and $\mathbb P(Y\geq a)=p$. This shows the bound cannot generally be reduced using only the nonnegative <random variable>'s <expected value>.