Cantelli inequality (source code)

= Cantelli inequality
{c}
{title2=$P(X-\mathbb EX\geq a)\leq\sigma^2/(\sigma^2+a^2)$}

= Cantelli's inequality
{c}
{synonym}

= One-sided Chebyshev inequality
{synonym}

<Cantelli's inequality> uses a <mean> and <variance> to control deviations in one specified direction. For a real <random variable> $X$ with <expected value> $\mu$, finite <variance> $\sigma^2$, and $a>0$,
$$
\boxed{\mathbb P(X-\mu\geq a)\leq\frac{\sigma^2}{\sigma^2+a^2}.}
$$
Applying the same statement to $-X$ gives the lower <tail probability> bound $\mathbb P(X-\mu\leq-a)\leq\sigma^2/(\sigma^2+a^2)$. No <independence> or particular <probability distribution> is required. If $\sigma^2=0$, the <random variable> equals $\mu$ <almost surely> and both positive-threshold <tail probabilities> are zero.

For <variance> one and a threshold two above the <mean>, \b[the upper-tail <probability> is at most $1/5$]. Applying the two-sided <Chebyshev's inequality> to contain that upper <event> would give the weaker bound $1/4$. For the <standard normal distribution>, the actual upper <tail probability> at two is about $0.0227501$, much smaller than either bound. Yet the two-point <probability distribution> in <equality in Cantelli's inequality> attains $1/5$, showing why the smaller Gaussian value cannot be promised from these two <moments> alone.

\Image[/cantelli-one-sided-bound-and-extremizer.png]
{title=<Cantelli's inequality> sharpens a variance-only upper-tail bound and is exact for a two-point <probability distribution>}
{description=Left: actual upper <tail probabilities> for the <standard normal distribution> are compared with <Cantelli's inequality> and the capped two-sided <Chebyshev's inequality> used as an upper-tail bound. Right: masses $4/5$ at $-1/2$ and $1/5$ at two have <mean> zero and <variance> one. The upper mass is included by the non-strict threshold $X\geq2$. These are specified mathematical models, not observations.}

A short explanation is to centre $Y=X-\mu$ and choose a nonnegative shift $b$. On $Y\geq a$, the square $(Y+b)^2$ is at least $(a+b)^2$, so <Markov's inequality> gives
$$
\mathbb P(Y\geq a)\leq\frac{\mathbb E(Y+b)^2}{(a+b)^2}=\frac{\sigma^2+b^2}{(a+b)^2}.
$$
The best shift is $b=\sigma^2/a$, giving the displayed bound. Choosing the shift before squaring exploits the direction of the deviation; squaring the unshifted <random variable> treats both directions together. This shifted-square proof is also the strategy requested in the University of Utah's 2005 qualifying problem on <Cantelli's inequality>. https://quals.math.utah.edu/topics/borel-cantelli-lemmas/[University of Utah Mathematics, 2005 question 4: shifted-square Cantelli bound]{ref}.

The one-sided improvement should be used for a one-sided question. Adding upper and lower bounds by the <union bound> gives $2\sigma^2/(\sigma^2+a^2)$ for $|X-\mu|\geq a$. When $a\geq\sigma>0$, that is at least the <Chebyshev's inequality> bound $\sigma^2/a^2$; when $a<\sigma$, both two-sided expressions exceed one and must be capped. The separate one-sided bounds generally cannot be attained simultaneously by the same <probability distribution>.