Search

Search papers and lessons

Chebyshev's Inequality

Level 3 · 9 min read

Chebyshev's inequality says that at most 1/k² of any distribution lies more than k standard deviations from its mean, whatever the shape of the distribution.

On this page

  • Colour = topic mix
  • Probability
  • Discrete math
  • Sign in to see your progress

TL;DR

Chebyshev's inequality gives a guaranteed upper limit on how often a random value strays far from its mean. If a quantity has mean μ\mu and standard deviation σ\sigma, then at most 1/k21/k^2 of its values lie kk or more standard deviations away from μ\mu. For k=2k = 2 that is at most a quarter; for k=3k = 3, at most a ninth.

The bound needs only the mean and the variance. It does not care whether the distribution is a bell curve, a skewed tail or a lumpy mix, which is what makes it useful when you know nothing else about the data.

Where you'll see it: in quick reliability estimates ("at most 1 in 9 requests can be slower than three standard deviations above average"), and as the step that proves the law of large numbers.

Intuition

How far can a value wander?

Think of a crowd of people with an average height of 170 cm and a standard deviation of 10 cm. How many people can be 30 cm or more away from average, that is, 140 cm or shorter, or 200 cm or taller? You might guess "almost none", but the crowd could be odd: a few very tall people and a few very short ones could pull the variance up while keeping most of the crowd close to 170.

The variance is the average squared distance from the mean. If many values were far away, that average would be large. A large average squared distance leaves little room for many values to be far away. Chebyshev's inequality turns that bookkeeping into a number (here, at most 1/91/9 of the crowd, since 30 cm is three standard deviations). Every value far from the mean adds at least t2t^2 to the total of squared distances, so there cannot be too many of them.

The picture below shows a standard normal curve, with the two tails beyond two standard deviations marked by points. Chebyshev's bound says that for any distribution with mean 0 and variance 1, at most 1/41/4 of the mass can lie in those two tails combined, however the rest of the mass is arranged. The normal curve happens to put far less there, about 0.0460.046, which is why the bound is loose for it.

−4−3−2−10123400.10.20.30.4distance from mean, in standard deviationsdensity
  • standard normal
Points mark the edges of the region two or more standard deviations from the mean. Chebyshev caps the mass in that region at 1/4 for every distribution with this mean and variance.

The math

Statement

Definition: Chebyshev's inequality

Let XX be a random variable with finite mean μ\mu and finite variance σ2>0\sigma^2 \gt 0. For any k>0k \gt 0,

P(∣X−μ∣≥kσ)≤1k2.P\big(|X - \mu| \geq k\sigma\big) \leq \frac{1}{k^2}.

Equivalently, for any distance t>0t \gt 0,

P(∣X−μ∣≥t)≤σ2t2.P\big(|X - \mu| \geq t\big) \leq \frac{\sigma^2}{t^2}.

Here P(⋅)P(\cdot) is the probability of an event, ∣X−μ∣|X - \mu| is the distance of the value from the mean, and tt is a threshold in the same units as XX. The two forms say the same thing: put t=kσt = k\sigma into the second to get the first.

Proof

The proof rests on Markov's inequality: for a non-negative random variable YY and any a>0a \gt 0, P(Y≥a)≤E[Y]/aP(Y \geq a) \leq \mathbb{E}[Y]/a. To see why, note that Y≥a⋅1{Y≥a}Y \geq a \cdot \mathbf{1}\{Y \geq a\} always holds, where the indicator 1{Y≥a}\mathbf{1}\{Y \geq a\} is 1 when the event happens and 0 otherwise. Take expectations of both sides: E[Y]≥a P(Y≥a)\mathbb{E}[Y] \geq a\,P(Y \geq a). Divide by aa.

Now let Y=(X−μ)2Y = (X - \mu)^2, which is non-negative, and take a=t2a = t^2. The event ∣X−μ∣≥t|X - \mu| \geq t is the same as (X−μ)2≥t2(X - \mu)^2 \geq t^2, so

P(∣X−μ∣≥t)=P((X−μ)2≥t2)≤E[(X−μ)2]t2=σ2t2.P\big(|X - \mu| \geq t\big) = P\big((X-\mu)^2 \geq t^2\big) \leq \frac{\mathbb{E}\big[(X-\mu)^2\big]}{t^2} = \frac{\sigma^2}{t^2}.

The last step uses the definition of variance from Mean and Variance: E[(X−μ)2]=σ2\mathbb{E}[(X - \mu)^2] = \sigma^2. Setting t=kσt = k\sigma gives the 1/k21/k^2 form.

Reading the bound

Some values of kk are worth memorising:

  • k=2k = 2: at most 1/4=25%1/4 = 25\% lies two or more standard deviations from the mean.
  • k=3k = 3: at most 1/9≈11%1/9 \approx 11\% lies three or more standard deviations away.
  • k=1k = 1: the bound is 11, which says nothing. For k≤1k \leq 1 the bound is useless.

The bound is in terms of the probability of being far from the mean. It says nothing about how close values cluster; it is a tail statement.

Two-sided and one-sided

The statement above is two-sided: it counts values far above and far below the mean together. If you only care about one side, Chebyshev still applies, but a sharper result exists. Cantelli's inequality says P(X−μ≥t)≤σ2/(σ2+t2)P(X - \mu \geq t) \leq \sigma^2 / (\sigma^2 + t^2) for the upper tail. It is always at least as tight, and strictly tighter for t>0t \gt 0.

Worked examples

Example
A fair die, checked by hand

Let XX be the result of one roll of a fair six-sided die. Its values are 11 to 66, each with probability 1/61/6.

  1. Mean: μ=(1+2+3+4+5+6)/6=3.5\mu = (1+2+3+4+5+6)/6 = 3.5.
  2. Second moment: E[X2]=(1+4+9+16+25+36)/6=91/6≈15.167\mathbb{E}[X^2] = (1+4+9+16+25+36)/6 = 91/6 \approx 15.167.
  3. Variance: σ2=E[X2]−μ2=15.167−12.25=35/12≈2.917\sigma^2 = \mathbb{E}[X^2] - \mu^2 = 15.167 - 12.25 = 35/12 \approx 2.917.
  4. Threshold t=2t = 2. The values with ∣X−3.5∣≥2|X - 3.5| \geq 2 are X=1X = 1 (distance 2.52.5) and X=6X = 6 (distance 2.52.5). Each has probability 1/61/6, so the exact probability is 2/6=1/32/6 = 1/3.
  5. Chebyshev bound: σ2/t2=2.917/4≈0.729\sigma^2 / t^2 = 2.917 / 4 \approx 0.729.

Interpretation: the true probability is 0.3330.333 and the bound is 0.7290.729. The bound holds, and it is loose, because it has to cover every distribution with this mean and variance, not just this one.

Example
A latency budget, with real numbers

A web service has mean response time μ=200\mu = 200 ms and standard deviation σ=50\sigma = 50 ms. You want to know how often a response takes 350 ms or more.

  1. Distance from the mean: 350−200=150350 - 200 = 150 ms, which is t=150=3σt = 150 = 3\sigma, so k=3k = 3.
  2. Chebyshev bound: P(∣X−200∣≥150)≤1/32=1/9≈0.111P(|X - 200| \geq 150) \leq 1/3^2 = 1/9 \approx 0.111.
  3. For comparison, if response times were Gaussian, P(∣Z∣≥3)=2(1−Φ(3))≈0.0027P(|Z| \geq 3) = 2(1 - \Phi(3)) \approx 0.0027, where Φ\Phi is the standard normal distribution function.

Interpretation: without assuming any shape, you can guarantee that no more than about 11% of responses take 350 ms or longer. If the times really are close to Gaussian, the true rate is about 0.27%, which is about forty times smaller. The bound is safe, but it is a guarantee rather than an estimate. Use it when you cannot justify a shape, and do not present it as the expected rate.

Example
A distribution that meets the bound exactly

Let XX take the value −1-1 with probability 1/81/8, the value 00 with probability 3/43/4, and the value 11 with probability 1/81/8.

  1. Mean: μ=(−1)(1/8)+0+(1)(1/8)=0\mu = (-1)(1/8) + 0 + (1)(1/8) = 0.
  2. Variance: σ2=E[X2]=(1)(1/8)+(1)(1/8)=1/4\sigma^2 = \mathbb{E}[X^2] = (1)(1/8) + (1)(1/8) = 1/4, so σ=1/2\sigma = 1/2.
  3. Threshold t=1t = 1: P(∣X∣≥1)=P(X=−1)+P(X=1)=1/4P(|X| \geq 1) = P(X = -1) + P(X = 1) = 1/4.
  4. Chebyshev bound: σ2/t2=(1/4)/1=1/4\sigma^2 / t^2 = (1/4)/1 = 1/4.

Interpretation: the probability equals the bound exactly. So at k=2k = 2 the inequality cannot be improved for distributions with this mean and variance. Its looseness in the die example came from the die's shape, not from a flaw in the inequality.

Tradeoffs and failure modes

Chebyshev is a worst-case guarantee, so it is the right tool when you need a bound that holds regardless of shape, and the wrong tool when you want a typical value.

SituationWhat goes wrongBetter choice
You know the distribution is roughly GaussianThe bound overstates the tail by a large factorUse the Gaussian tail probabilities from Gaussian (Normal) Distribution
You need a one-sided tailTwo-sided bound counts both tails, so it overstates one tailCantelli's inequality
You have a sample, not the true variancePlugging in the sample variance gives a bound that is only approximateConfidence intervals, or a bootstrap
The variance is infinite (heavy-tailed data)The bound says nothingRobust statistics, or a bound that needs a different moment
You want a tight estimate of a sample meanThe bound is loose for averages[[central-limit-theorem

A common error is to read the bound as "about this many values lie outside". It is an upper limit that holds for every distribution with the given mean and variance, so it can be far above the actual fraction.

History

Irénée-Jules Bienaymé stated a version of the inequality in the 1850s. Pafnuty Chebyshev proved a form of it in the 1860s and used it to study the law of large numbers, which is why the result carries his name. Andrey Markov, Chebyshev's student, later gave the more general argument now called Markov's inequality. The proof used today, Markov's inequality applied to the squared deviation, is the one found in textbooks.

The problem being solved was foundational. Probability was becoming a tool for making statements about averages of many observations, and mathematicians needed a bound that did not depend on knowing the exact distribution. Chebyshev's inequality supplied one, and it made the law of large numbers provable from only a finite variance.

Check yourself

QuestionA distribution has mean 10 and variance 4. Using Chebyshev, what is the largest possible probability that a value is 14 or more, or 6 or less?Show answer

Here σ=2\sigma = 2 and the threshold is t=4t = 4, which is k=2k = 2 standard deviations. The bound is σ2/t2=4/16=1/4\sigma^2 / t^2 = 4/16 = 1/4, so the probability is at most 0.250.25.

QuestionCompute the variance of a fair coin that pays 0 or 1, and check Chebyshev with threshold t=1t = 1 against the exact probability.Show answer

The mean is 1/21/2 and each deviation from the mean is ±1/2\pm 1/2, so σ2=1/4\sigma^2 = 1/4. The event ∣X−1/2∣≥1|X - 1/2| \geq 1 never happens, so the exact probability is 00. The bound is σ2/t2=1/4\sigma^2/t^2 = 1/4. The bound holds, and it is not tight here, because the coin's values are too close to the mean to ever reach threshold 1.

QuestionWhy can Chebyshev's inequality be applied to a skewed, non-Gaussian quantity such as the waiting time of a queue, and what does that buy you?Show answer

The proof uses only the mean and the variance, and both exist for the queue whenever its second moment is finite. Because no shape is assumed, the guarantee holds for the skewed distribution as well. What you give up is accuracy: the bound will usually overstate the tail, so it is useful for safety margins rather than for predicting typical rates.

QuestionA monitoring team says, 'Chebyshev shows that 99% of our requests finish within three standard deviations of the mean.' Is that claim right?Show answer

Not as stated. Chebyshev gives at most 1/91/9 of requests lying three or more standard deviations away, so at least 8/9≈89%8/9 \approx 89\% lie within three standard deviations. That is a lower bound on the fraction inside, and it is weaker than 99%. Getting 99% would need kk such that 1/k2=0.011/k^2 = 0.01, which means k=10k = 10. The team has mixed up the direction and the number.

Sources