Equality in Cantelli's inequality (source code)

= Equality in Cantelli's inequality
{title2=$\mathbb P(X=\mu+a)=\sigma^2/(\sigma^2+a^2)$}

For $a>0$ and $\sigma^2>0$, place <probabilities>
$$
\mathbb P(X=\mu+a)=\frac{\sigma^2}{\sigma^2+a^2},\qquad
\mathbb P\left(X=\mu-\frac{\sigma^2}{a}\right)=\frac{a^2}{\sigma^2+a^2}.
$$
Their weighted deviations cancel, giving <expected value> $\mu$; their weighted squared deviations give <variance> $\sigma^2$. Only the upper point belongs to $X-\mu\geq a$, so its <tail probability> attains <Cantelli's inequality>. With $a=2$, $\sigma^2=1$, $\mu=0$, the locations are two and $-1/2$, with masses $1/5$ and $4/5$. The optimized shift makes the lower point zero before squaring, explaining equality in the <Markov's inequality> step.

The threshold convention matters: this example has $\mathbb P(X-\mu>a)=0$. For a strict threshold, placing the upper point at $a+\varepsilon$ instead gives probabilities approaching the same bound as $\varepsilon\downarrow0$, with the prescribed <mean> and <variance> retained. Extra restrictions on the <support of a probability distribution> can change which extremal models are allowed.