edgekit

Inequalities & tail bounds

You rarely know the distribution of anything real. What you know is a mean, maybe a variance, maybe that the variable is bounded — and you still have to answer “how likely is disaster?” Probability inequalities are the machinery for saying something rigorous from almost nothing: Markov from a mean, Chebyshev from a variance, Hoeffding from boundedness, Jensen from curvature. This chapter proves each one, shows exactly when each is tight, and works the single most instructive comparison in the subject — one tail probability bounded four different ways.

Intuition — a hierarchy of ignorance

Each inequality is a trade: the less you assume, the weaker (but more bulletproof) your conclusion. Know only the mean? Markov gives you a bound that decays like — feeble, but unconditionally true. Add a variance and Chebyshev buys . Add boundedness and Hoeffding buys exponentialdecay — the difference between “a 10-sigma event has probability at most 1%” and “at most ”. Good prep questions walk this ladder deliberately: they hand you minimal information and test whether you reach for the matching rung, and whether you know that each bound is achieved by some worst-case distribution — that nothing stronger is available for free.

Markov — from a mean alone#

Theorem (Markov). If and , then

Proof — one line of truncation

Since , we may discard the part of below and floor the rest: pointwise (check both cases: if the right side is ; otherwise it is 0). Take expectations of both sides and use :

Sharpness: the bound is achieved by the two-point distribution , — all mass either at zero or exactly at the threshold. No assumption-free improvement exists.

Worked example.A strategy’s daily loss (a non-negative variable on losing days) averages $10k. Markov: the probability of a $100k-plus loss day is at most 10%. Crude — but it required nothingexcept non-negativity and the mean, and it is already enough to falsify a vendor claiming “$100k losses one day in a thousand” while reporting a $10k average loss only if you also trust a variance. Non-negativity is essential: a mean-zero P&L can breach any level with high probability.

Chebyshev — from a variance#

Theorem (Chebyshev). For any with mean and variance , and any ,

Proof — Markov applied to the squared deviation

The variable is non-negative with mean , so Markov applies to it at level :

The trick generalises: apply Markov to any increasing transform of . Higher moments give and beyond; the exponential transform gives Chernoff below. Sharpness: Chebyshev is achieved by the three-point law , — check: the variance is exactly and the tail exactly . So the bound is unimprovable in general, yet wildly loose for thin-tailed laws: at Chebyshev says 11.1% where the normal answer is 0.27%.

Tail probability versus threshold k for a standard normal, compared against the Chebyshev 1 over k squared bound and a Hoeffding-style exponential bound
Three answers to P(|X - mu| >= k sigma). Chebyshev's 1/k^2 (top) holds for every distribution with that variance; the exponential bound (middle) needs boundedness or subgaussian tails; the exact normal tail (bottom) needs the whole distribution. Information buys decay rate.

One-sided refinement (Cantelli). If only the upper tail matters,

strictly better than for the one-sided question (at : 50% vs Chebyshev’s vacuous 100%). Sketch: for any , implies , so Markov gives ; minimise over (the optimum is ) to get . The free parameter is a preview of the Chernoff method: introduce a knob, apply Markov, optimise the knob.

Jensen — from curvature#

Theorem (Jensen). If is convex, then ; if concave, the inequality flips. Strict convexity makes it strict unless is degenerate.

Proof — the supporting line (full proof, discrete or not)

Convexity means the graph of sits above every tangent (supporting) line. Take the supporting line at the point : there exists a slope with

Substitute and take expectations: the linear term dies because , leaving . (For the discrete two-point case this is literally the definition of convexity, , and induction extends it to any finite mixture — the classical proof; the supporting line does all cases at once.)

A convex curve with a chord above it connecting two points, showing that the average of the function values sits above the function of the average
Jensen geometrically: for a convex function the chord lies above the curve, so averaging outputs (chord midpoint) beats applying the function to the averaged input (curve). Every vol-drag, E[1/X], and AM-GM fact is this one picture.

Three applications carry most of the practical weight. Reciprocals: is convex on , so — the expected reciprocal of a random discount factor, price relative, or waiting time always exceeds the naive plug-in. Vol drag: is concave, so : compound (log) growth is always dragged below the arithmetic mean, the inequality behind the of Itô’s lemma and the lognormal mean/median wedge of the distribution zoo. AM–GM: put a uniform distribution on and exponentiate Jensen for the concave :

Cauchy–Schwarz — from second moments#

Theorem. . Proof: is a quadratic in with at most one root, so its discriminant is non-positive — which is exactly the claim (equality iff is a.s. proportional to ). Applied to centred variables it bounds covariance by the product of standard deviations, i.e. — the fact used throughout Joint distributions & correlation. A desk-level corollary: the covariance of a signal with returns can never exceed , which caps the Sharpe any linear rule built on that signal can achieve — the information-coefficient bound of the math of edge.

Chernoff and Hoeffding — exponential decay#

The Chernoff method is Markov with a tunable exponential lens. For any , the map is increasing, so

and since this holds for every , optimise: . The recipe: (1) exponentiate, (2) Markov, (3) factorise the MGF across independent summands — this is the step where independence pays, because turns a sum into a product — then (4) minimise over . For bounded summands, bounding each MGF by (Hoeffding’s lemma — the honest technical step, proved by a Taylor argument on the log-MGF) yields the celebrated:

Theorem (Hoeffding). If are independent with , then for the sample mean and any ,

Interpretation: the sample mean of bounded variables concentrates around the truth at an exponential rate — no normality assumed, no asymptotics, valid at every finite . Doubling the sample squares the tail probability. This is the rigorous, non-asymptotic cousin of the CLT: the CLT tells you the shapeof the fluctuation, Hoeffding gives a certificate against being fooled by it. Berry–Esseen (next chapter) quantifies how fast the CLT shape itself becomes trustworthy — error in the CDF, so with skewed trade P&L the Gaussian approximation converges at only .

Worked example — how long a backtest? Trades are wins or losses (bounded in after coding a win as 1). You want the observed win rate within of truth with 95% confidence. Two-sided Hoeffding: gives trades. A claimed edge of 53% vs 50% needs thousands of trades before the data can certify it — arithmetic that should precede every backtest read-out, and the reason the gauntlet demands sample-size honesty before it looks at a Sharpe ratio.

The union bound — and its multiple-testing sting#

Theorem (Boole). For any events (no independence needed), . Proof: induction from two events, where by the inclusion–exclusion identity of Counting & combinatorics; alternatively note the indicator of the union is pointwise at most the sum of indicators and take expectations.

The sting: test 20 useless strategies at the 5% level and the union bound caps the chance that some strategy passes at — vacuous, and under independence the true probability is . Flip it into a control: to keep the family-wise error below across tests, test each at — the Bonferroni correction, proved by exactly this bound and developed with its refinements in Multiple testing & paradoxes. Combined with Hoeffding it also prices the maximum of many strategies’ luck — Problem 5 below.

BoundRequiresTail decayTight when
Markovmass at 0 and at the threshold
Chebyshevthree-point worst case
Cantellione-sided questions
Jensenconvexity of φ— (moment inequality)φ linear, or X degenerate
Hoeffding / Chernoffindependence + boundedness (or MGF)near-Gaussian bounded sums
Union boundnothingadditiverare, nearly disjoint events

A seeded simulation runs the whole ladder on one target — a fair coin showing at least 60% heads in 100 flips — against the exact answer computed in Problem 2:

bounds_ladder.py
import numpy as np
from math import comb, exp, sqrt

rng = np.random.default_rng(11)

# Target: P(at least 60 heads in 100 fair flips)
n, p, k = 100, 0.5, 60
exact = sum(comb(n, j) for j in range(k, n + 1)) / 2**n
cheb = (p * (1 - p) / n) / 0.10**2          # Chebyshev, two-sided /2 not taken
cantelli = 1 / (1 + 0.10**2 * n / (p * (1 - p)))
hoeff = exp(-2 * n * 0.10**2)
# CLT with continuity correction: P(Z > (59.5 - 50)/5)
from math import erfc
clt = 0.5 * erfc((59.5 - 50) / 5 / sqrt(2))

sim = (rng.binomial(n, p, 2_000_000) >= k).mean()
print(f"exact    {exact:.5f}")   # 0.02844
print(f"sim      {sim:.5f}")     # ~0.0284
print(f"clt      {clt:.5f}")     # 0.02871  (continuity-corrected)
print(f"hoeffding{hoeff: .5f}")  # 0.13534  (valid bound, ~5x loose)
print(f"cantelli {cantelli:.5f}")# 0.71429  (loose)
print(f"chebyshev{cheb: .5f}")   # 2.50000  (vacuous here)
Quant lens — bounds are risk statements you can sign
A model-based tail estimate (“VaR says 1%”) is only as good as the fitted distribution — and fitted distributions lieprecisely in the tails. Inequality-based statements are different in kind: “with only the variance assumed, the loss exceeds with probability at most 11%” survives any distributional surprise, fat tails included. Desks use the ladder in both directions: Chebyshev-style bounds for worst-case risk language when tails are untrusted, and Hoeffding-style concentration for certification — how many trades before a win rate, hit ratio, or A/B execution improvement is believable. The habit to build: before quoting any backtest statistic, ask which rung of the ladder your sample size actually supports.

Practice problems#

Problem 1 — Bound P(X ≥ 2μ)

A non-negative random variable has mean . (a) Bound . (b) Show the bound cannot be improved. (c) If you also learn , improve it.

Solution. (a) Markov: . (b) Take : the mean is and the tail is exactly — Markov is tight, so without more information is the honest answer. (c) With a variance, use one-sided Cantelli with , i.e. :

a 2.5× improvement from one extra number (plain Chebyshev would give , and wastes half its budget on the impossible lower tail). The escalation pattern — quote Markov, prove tightness, then upgrade when handed the variance — is exactly the ladder-climbing these problems are built to exercise.

Problem 2 — 60% heads in 100 flips: Hoeffding vs CLT vs exact

A fair coin is flipped 100 times. Estimate three ways and reconcile.

Solution. Hoeffding (a bound): . CLT (an approximation): , so 60% is 2 standard errors out; with continuity correction, . Exact: . Reconciliation: the exact answer is the truth; the CLT is a superb approximation here (symmetric, thin-tailed summands, decent ) but carries no guarantee; Hoeffding is 5× loose but is a certificate valid for every bounded distribution and every . Knowing which of the three to reach for — and saying so unprompted — is the real mark of understanding.

Problem 3 — Jensen traps: E[S²] vs E[S]², and friends

True or false, with proof: (a) ; (b) for positive , ; (c) the expected Sharpe of a strategy equals the Sharpe of its expected returns; (d) .

Solution. (a) True — is convex; the gap is precisely the variance, so equality holds iff is constant. (b) False — is convex, so , strictly unless degenerate. Concretely, equiprobable: . (c) False in general — the Sharpe is a nonlinear (concave-in-places) function of estimated moments; noisy estimates bias it, one reason reported backtest Sharpes flatter. (d) False as stated — is concave, so the inequality runs the other way: (this is also why underestimates even when is unbiased — see Estimators & sampling theory). The meta-rule: identify convex vs concave, and Jensen dictates the direction; the size of the gap always scales with variance.

Problem 4 — How big is the max of n Gaussians?

are standard normal (not necessarily independent). Show , and argue the rate is right.

Solution. The slick proof is Jensen + union-bound logic through the MGF. For any :

Take logs: ; minimise at to get — with no independence used anywhere. For iid Gaussians the bound is asymptotically exact (the tail puts the top order statistic near ), so the rate is correct: the best of lucky draws grows only like — slowly, but never zero. Numbers worth carrying: gives about 2.4; about 3.7.

Problem 5 — The best of N random strategies

A fund tries strategies with no true edge; each backtest Sharpe is approximately after scaling by years. How good will the best backtest look, and how many strategies until a “2.5-Sharpe-t-stat” discovery is expected by chance?

Solution. By Problem 4, the expected best t-stat is about — a “three-sigma discovery” manufactured from pure noise. For the second part, the union bound (or independence) says a level- exceedance is expected once : with , about strategies suffice — an afternoon of parameter search. This arithmetic is the entire mathematical core of data snooping: the more you search, the better your best must look, edge or not. Corrections (Bonferroni, deflated Sharpe) live in Multiple testing & paradoxes and Overfitting detection.

Next: concentration bounds say averages settle; the limit theorems say how — the law of large numbers gives the destination and the central limit theorem the shape of the journey, including the exact arithmetic of how many trades an edge needs. LLN & the central limit theorem.