Theorem · Markov's inequalityLet X be a random variable taking only non-negative values, with finite expectation, and let a > 0. Then P(X ≥ a) ≤ E[X]/a.
Write the expectation as a sum over the values X can take: E[X] = Σ x·P(X = x), where every term has x ≥ 0 and P(X = x) ≥ 0, so every term is non-negative.
Throw away the terms with x < a. Discarding non-negative terms can only decrease the sum, so E[X] ≥ Σ over x ≥ a of x·P(X = x).
In what is left, every x is at least a, so replacing each x by a can only decrease the sum again: E[X] ≥ a·Σ over x ≥ a of P(X = x) = a·P(X ≥ a). Divide by a > 0.
□
Two features of that argument are worth naming because they are what the rest of the course relies on. It never looks at the shape of the distribution, so it applies to any non-negative X at all; and it is tight, in the sense that a variable taking value a with probability E[X]/a and 0 otherwise meets it with equality. A bound that is attained by some distribution cannot be improved without adding a hypothesis, and the next theorem is what one extra hypothesis buys.
Theorem · Chebyshev's inequalityLet X have finite mean μ and finite variance Var(X), and let t > 0. Then P(|X − μ| ≥ t) ≤ Var(X)/t². Writing t = kσ with σ the standard deviation and k > 0 gives the form Discrete Probability states: P(|X − μ| ≥ kσ) ≤ 1/k².
Let Y = (X − μ)². A square is never negative, so Markov's inequality applies to Y, and E[Y] = Var(X) is the definition of the variance.
The events are the same: |X − μ| ≥ t holds exactly when (X − μ)² ≥ t², because both sides of |X − μ| ≥ t are non-negative and squaring preserves order there. So P(|X − μ| ≥ t) = P(Y ≥ t²) ≤ E[Y]/t² = Var(X)/t² by Markov at a = t².
For the second form, put t = kσ. Then Var(X)/t² = σ²/(k²σ²) = 1/k², provided σ > 0; if σ = 0 then X is constant and both sides are 0 for every t > 0.
□
That is the proof the Simulation course of the Operations Research path points at when it states Chebyshev and applies it to a sample mean. It is two lines because Markov did the work, and it is worth noticing which line carries the generality: nothing above assumed the distribution was symmetric, unimodal, or anything else. A confidence interval built on Chebyshev is valid for a simulation whose output distribution nobody has written down, and that is the property being bought.
The slack, measured against a distribution that is known exactly
Randomised quicksort on ten keys is the ideal test, because the lab knows the whole distribution: E[C] = 30791/1260 ≈ 24.4373 and Var(C) = 4913659/317520 ≈ 15.4751, both exact. So every bound can be printed beside the quantity it bounds rather than beside a guess at it. Slide the threshold and the panel recomputes both columns.
a P(C >= a) exactly Markov, E/a ratio
24 332/675 = 0.49185 30791/30240 = 1.0182 2.07
30 6283/56700 = 0.11081 30791/37800 = 0.8146 7.35
36 13/945 = 0.01376 30791/45360 = 0.6788 49.34
45 2/14175 = 0.00014 30791/56700 = 0.5431 3848.88
At a = 24 the bound exceeds one, and a probability is at most one anyway, so the inequality is true and says nothing whatsoever. That is not a defect in the lab or a badly chosen slider position: it is what Markov does when a is near the mean, and a reader who has never seen it will eventually quote a vacuous bound as though it were evidence. Further out the bound becomes informative in form and steadily worse in accuracy, until at the worst case it overstates the truth by a factor near 3849.
What the second moment buys
t P(|C - E| >= t) exactly Chebyshev, Var/t^2
3 1751/3780 = 0.46323 4913659/2857680 = 1.7195
6 1637/18900 = 0.08661 4913659/11430720 = 0.4299
9 1571/56700 = 0.02771 4913659/25719120 = 0.1911
12 44/4725 = 0.00931 4913659/45722880 = 0.1075
15 19/9450 = 0.00201 4913659/71442000 = 0.0688
Chebyshev decays as 1/t² where Markov decays as 1/a, so it is the sharper tool once t is a few standard deviations out: at t = 15 it allows 0.069 against a truth of 0.002, a factor of 34, where Markov at the comparable threshold was out by a factor of thousands. It also goes vacuous, at t = 3, for the same reason — σ ≈ 3.93 here, so t = 3 is less than one standard deviation and 1/k² exceeds one.
And it bounds a two-sided event. P(|C − μ| ≥ t) includes runs that were unusually cheap as well as unusually expensive, which is often not the event you care about. Using Chebyshev for a one-sided question is legitimate and wasteful: it throws away half the bound. The lab prints the two-sided exact probability beside it so the comparison is like for like.
Why not measure the tail instead
Over seeds 1 to 120 the panel counts 60 runs at or above 24 comparisons, which is 1/2, against an exact tail of 332/675 ≈ 0.492. Eleven runs reached 30, against 0.111. One run reached 36, against 0.0138. The measurements are close and they are measurements: they move with the slider, they say nothing about the values no seed reached, and they are about this instance rather than about every instance. The bounds are about every instance and they hold for instances nobody has enumerated, which is the only reason to prove them.
The honest summary is that this page has three ways to answer “how likely is a bad run?” and they are ranked by what they cost and what they cover. The enumeration is exact and available only when the distribution can be computed. The measurement is available always and establishes nothing about unobserved outcomes. The bound is available from two numbers, holds for every distribution with those numbers, and is loose by a factor this page prints.