Skip to content
nonconvexcard

Concentration Inequalities

Markov to McDiarmid, each with its hypotheses, a complete proof, an interpretation and the regime in which it is the right tool.

High-Dim ProbabilityAdvanced⏱ 1 day27 min readconcentrationmarkovchebyshevchernoffhoeffding
8 problems →

Every inequality on this page bounds the same kind of quantity — the probability that a random variable is far from its mean — and each pays for its conclusion with a different hypothesis. The table is the summary; the rest of the page is the proofs.

| Inequality | Hypothesis | Tail bound on P(∣Z−EZ∣≥t)\P(|Z - \E Z| \ge t) | Decay | | --- | --- | --- | --- | | Markov | Z≥0Z \ge 0 | EZ/t\E Z/t (one-sided, about 0) | 1/t1/t | | Chebyshev | Var⁡Z<∞\Var Z < \infty | σ2/t2\sigma^2/t^2 | 1/t21/t^2 | | Chernoff | MGF finite | e−sup⁡λ(λt−ψ(λ))e^{-\sup_\lambda(\lambda t - \psi(\lambda))} | shape of ψ∗\psi^* | | Hoeffding | Z=∑XiZ = \sum X_i, independent, Xi∈[ai,bi]X_i \in [a_i,b_i] | 2exp⁡ ⁣(−2t2/∑(bi−ai)2)2\exp\!\big(-2t^2/\sum(b_i-a_i)^2\big) | Gaussian | | Bernstein | as Hoeffding, plus variance σ2\sigma^2 | 2exp⁡ ⁣(−t2/(2σ2+2Mt/3))2\exp\!\big(-t^2/(2\sigma^2 + 2Mt/3)\big) | Gaussian then exponential | | Azuma | martingale, increments in [−ci,ci][-c_i,c_i] | 2exp⁡ ⁣(−t2/(2∑ci2))2\exp\!\big(-t^2/(2\sum c_i^2)\big) | Gaussian | | McDiarmid | ff with bounded differences cic_i | 2exp⁡ ⁣(−2t2/∑ci2)2\exp\!\big(-2t^2/\sum c_i^2\big) | Gaussian | | Gaussian concentration | ff KK-Lipschitz, X∼N(0,Id)X\sim\Ncal(0,I_d) | 2exp⁡ ⁣(−t2/(2K2))2\exp\!\big(-t^2/(2K^2)\big) | Gaussian, dimension-free |

Run it: Concentration inequalities, side by sideEmpirical tail probabilities of a sample mean against the Markov, Chebyshev, Hoeffding and Bernstein bounds.

The two moment inequalities

TheoremMarkov's inequality

Let Z≥0Z \ge 0 be a random variable and t>0t > 0. Then

P(Z≥t)≤EZt.\P(Z \ge t) \le \frac{\E Z}{t}.

Assumptions

Non-negativity of ZZ, and that is all. No independence, no variance, no boundedness. This is why Markov is the foundation on which every other inequality here is built: all of them are Markov applied to a cleverly chosen non-negative function of ZZ.

CorollaryChebyshev's inequality

If EZ2<∞\E Z^2 < \infty then for all t>0t>0,

P(∣Z−EZ∣≥t)≤Var⁡(Z)t2.\P\big(|Z - \E Z| \ge t\big) \le \frac{\Var(Z)}{t^2}.

More generally, applying Markov to ∣Z−EZ∣p|Z - \E Z|^p gives P(∣Z−EZ∣≥t)≤E∣Z−EZ∣p/tp\P(|Z-\E Z| \ge t) \le \E|Z-\E Z|^p/t^p, so each finite moment buys one more power of tt. Sub-Gaussianity is, in this light, exactly the statement that all moments are available with the right growth, which is what upgrades polynomial decay to Gaussian decay.

PropositionMarkov and Chebyshev are attained

Both bounds are achieved with equality by explicit distributions, so neither can be improved without strengthening its hypotheses.

Key idea

These extremal distributions are worth staring at: they put all of their deviation mass at exactly the threshold tt. That is what a distribution with only a variance constraint is allowed to do, and it is why Chebyshev cannot see the difference between a Gaussian and a two-point distribution. Improving on Chebyshev requires a hypothesis that rules such distributions out — boundedness of many independent summands does exactly that.

The Chernoff method

PropositionThe Chernoff method

Let ZZ have cumulant generating function ψ(λ)=log⁡EeλZ\psi(\lambda) = \log \E e^{\lambda Z}, finite on an interval containing 00. Then for every tt,

P(Z≥t)≤exp⁡(−ψ∗(t)),ψ∗(t)=sup⁡λ>0(λt−ψ(λ)),\P(Z \ge t) \le \exp\big(-\psi^*(t)\big), \qquad \psi^*(t) = \sup_{\lambda > 0}\big(\lambda t - \psi(\lambda)\big),

where ψ∗\psi^* is the Legendre transform of ψ\psi.

Hoeffding's inequality

TheoremHoeffding's inequality

Let X1,…,XnX_1,\dots,X_n be independent with Xi∈[ai,bi]X_i \in [a_i,b_i] almost surely, and let S=∑i=1nXiS = \sum_{i=1}^n X_i. Then for every t≥0t \ge 0,

P(S−ES≥t)≤exp⁡(−2t2∑i=1n(bi−ai)2),\P\big(S - \E S \ge t\big) \le \exp\left(-\frac{2t^2}{\sum_{i=1}^n (b_i-a_i)^2}\right),

and the two-sided bound holds with an extra factor 22. In particular, for i.i.d. Xi∈[0,1]X_i \in [0,1] and Xˉn=S/n\bar X_n = S/n,

P(∣Xˉn−μ∣≥t)≤2e−2nt2.\P\big(|\bar X_n - \mu| \ge t\big) \le 2e^{-2nt^2}.

What this does not say

Hoeffding's bound does not involve the variance of the XiX_i at all — only the lengths of their ranges. For a Bernoulli(p)(p) variable with small pp, the range is 11 while the variance is p(1−p)≪1p(1-p) \ll 1, and Hoeffding is correspondingly loose. It is also useless for unbounded variables: there is no version of this theorem for Gaussian summands via this route, though of course the sum of Gaussians is exactly Gaussian.

Inverting the bound is the form used in practice. Setting the right-hand side to δ\delta and solving for tt: with probability at least 1−δ1-\delta,

∣Xˉn−μ∣≤log⁡(2/δ)2nfor Xi∈[0,1].|\bar X_n - \mu| \le \sqrt{\frac{\log(2/\delta)}{2n}}\qquad\text{for } X_i \in [0,1].

Note the shape: the dependence on the confidence level is log⁡(1/δ)\sqrt{\log(1/\delta)}, which is extremely mild — buying three more orders of magnitude of confidence costs a factor of about 1.61.6 in the bound. This is the practical content of exponential concentration.

Bernstein's inequality

TheoremBernstein's inequality

Let X1,…,XnX_1,\dots,X_n be independent and centred with ∣Xi∣≤M|X_i| \le M almost surely, and set σ2=∑i=1nEXi2\sigma^2 = \sum_{i=1}^n \E X_i^2. Then for all t≥0t \ge 0,

P(∑iXi≥t)≤exp⁡(−t22σ2+23Mt).\P\left(\sum_i X_i \ge t\right) \le \exp\left(-\frac{t^2}{2\sigma^2 + \tfrac{2}{3}Mt}\right).

Key idea

Read the denominator. For t≲σ2/Mt \lesssim \sigma^2/M the term 2σ22\sigma^2 dominates and the bound is e−t2/2σ2e^{-t^2/2\sigma^2} — Gaussian, with the true variance, not the range. For t≳σ2/Mt \gtrsim \sigma^2/M the term 23Mt\tfrac23Mt dominates and the bound is e−3t/2Me^{-3t/2M} — exponential. Bernstein therefore interpolates between the two behaviours, with the crossover at the scale set by the ratio of variance to range. Hoeffding only ever gives the first shape, with σ2\sigma^2 replaced by the worst case compatible with the range.

Beyond independence: Azuma and McDiarmid

DefinitionMartingale

A sequence (Z0,Z1,…,Zn)(Z_0, Z_1, \dots, Z_n) adapted to a filtration F0⊆⋯⊆Fn\mathcal{F}_0 \subseteq \dots \subseteq \mathcal{F}_n is a martingale if each ZkZ_k is integrable and E[Zk∣Fk−1]=Zk−1\E[Z_k \mid \mathcal{F}_{k-1}] = Z_{k-1} for all kk. Its increments are Dk=Zk−Zk−1D_k = Z_k - Z_{k-1}, which satisfy E[Dk∣Fk−1]=0\E[D_k\mid\mathcal{F}_{k-1}] = 0.

TheoremAzuma–Hoeffding inequality

Let (Zk)k≤n(Z_k)_{k\le n} be a martingale whose increments satisfy ∣Dk∣≤ck|D_k| \le c_k almost surely. Then for all t≥0t\ge0,

P(Zn−Z0≥t)≤exp⁡(−t22∑k=1nck2).\P\big(Z_n - Z_0 \ge t\big) \le \exp\left(-\frac{t^2}{2\sum_{k=1}^n c_k^2}\right).
TheoremMcDiarmid's bounded differences inequality

Let X1,…,XnX_1,\dots,X_n be independent random variables with XiX_i taking values in a set Xi\Xcal_i, and let f:∏iXi→Rf : \prod_i \Xcal_i \to \R satisfy the bounded differences condition: for each ii there is cic_i with

∣f(x1,…,xi,…,xn)−f(x1,…,xi′,…,xn)∣≤ci\big|f(x_1,\dots,x_i,\dots,x_n) - f(x_1,\dots,x_i',\dots,x_n)\big| \le c_i

for all x∈∏jXjx \in \prod_j \Xcal_j and all xi′∈Xix_i' \in \Xcal_i. Then for Z=f(X1,…,Xn)Z = f(X_1,\dots,X_n) and every t≥0t \ge 0,

P(Z−EZ≥t)≤exp⁡(−2t2∑i=1nci2).\P\big(Z - \E Z \ge t\big) \le \exp\left(-\frac{2t^2}{\sum_{i=1}^n c_i^2}\right).

Key idea

McDiarmid is the reason uniform convergence arguments work. The quantity of interest there is Z=sup⁡f∈F(R(f)−R^n(f))Z = \sup_{f\in\Fcal}\big(R(f) - \hat R_n(f)\big), which is a complicated function of the whole sample — but changing one sample point changes each empirical risk by at most 1/n1/n, and the supremum is 11-Lipschitz in the uniform norm, so ZZ has bounded differences ci=1/nc_i = 1/n. McDiarmid then concentrates ZZ around its mean at rate e−2nt2e^{-2nt^2}, and the remaining work — bounding EZ\E Z — is what Rademacher complexity does.

Gaussian concentration

TheoremGaussian concentration for Lipschitz functions

Let X∼N(0,Id)X \sim \Ncal(0, I_d) and let f:Rd→Rf : \R^d \to \R be KK-Lipschitz with respect to ∥⋅∥2\norm{\cdot}_2. Then

P(∣f(X)−Ef(X)∣≥t)≤2exp⁡(−t22K2)for all t≥0,\P\big(|f(X) - \E f(X)| \ge t\big) \le 2\exp\left(-\frac{t^2}{2K^2}\right) \qquad\text{for all } t\ge0 ,

equivalently ∥f(X)−Ef(X)∥ψ2≤CK\norm{f(X) - \E f(X)}_{\psi_2} \le CK for an absolute constant CC.

What this does not say

The dimension dd appears nowhere in the conclusion. That is the whole point, and it is the single most important structural fact in high-dimensional probability. But read the hypothesis carefully: ff must be Lipschitz in the Euclidean norm, and many natural functions are not Lipschitz with a dimension-free constant. f(x)=∑ixif(x) = \sum_i x_i is d\sqrt d-Lipschitz, and the theorem correctly returns a bound with a dd in it. The theorem is dimension-free; individual applications are only as dimension-free as their Lipschitz constants.

The theorem also says nothing about Ef(X)\E f(X), which is often the harder quantity. Concentration tells you the value is near some number; identifying that number is a separate problem.

CorollaryImmediate consequence: the norm concentrates

f(x)=∥x∥2f(x) = \norm{x}_2 is 11-Lipschitz, so for X∼N(0,Id)X \sim \Ncal(0,I_d),

P(∣∥X∥2−E∥X∥2∣≥t)≤2e−t2/2,\P\big(|\norm{X}_2 - \E\norm{X}_2| \ge t\big) \le 2e^{-t^2/2},

with no dependence on dd whatsoever. Since E∥X∥2=d (1+O(1/d))\E\norm{X}_2 = \sqrt d\,(1 + O(1/d)), this is the statement explored numerically on the norm concentration page.

Problems

Markov and Chebyshev are attainedProof · Foundation · 15 min Derive Hoeffding's inequality from Hoeffding's lemmaProof · Intermediate · 30 min Locating the Bernstein crossoverNumerical · Intermediate · 30 min Applying McDiarmid to a medianProof · Advanced · 30 min Azuma for a random walk with driftProof · Intermediate · 30 min Simulate and compare the concentration inequalitiesCoding · Intermediate · 1 hour The Chernoff exponent is a Legendre transformProof · Advanced · 1 hour

References

These works are cited as sources to read, not reproduced. All exposition, examples and problems on this site are written independently; where an argument is standard, the citation points to a canonical treatment.

Results stated on this page

  • TheoremMarkov's inequalityproof includedA non-negative random variable exceeds t with probability at most its mean over t.
  • CorollaryChebyshev's inequalityproof includedDeviations of size t have probability at most the variance over t squared.
  • PropositionThe Chernoff methodproof includedOptimising an exponential Markov bound over the tilting parameter yields the Legendre transform of the cumulant generating function.
  • TheoremHoeffding's inequalityproof includedSums of independent bounded variables have Gaussian tails with parameter determined by the ranges alone.
  • TheoremBernstein's inequalityproof includedFor bounded variables, a tail bound interpolating between Gaussian behaviour at small deviations and exponential behaviour at large ones.
  • TheoremAzuma–Hoeffding inequalityproof includedHoeffding's bound for martingales with bounded increments, requiring no independence.
  • TheoremMcDiarmid's bounded differences inequalityproof includedA function of independent variables that changes little when any single coordinate is changed concentrates around its mean.
  • TheoremGaussian concentration for Lipschitz functionsA Lipschitz function of a standard Gaussian vector is sub-Gaussian with parameter equal to its Lipschitz constant, with no dependence on dimension.
  • PropositionMarkov and Chebyshev are attainedproof includedBoth inequalities are tight, so their weakness is a property of their hypotheses and not of their proofs.

Experiments

Problems (8)

All problems

Papers that use this mathematics