Foundations to Frontier
Tests
A. Mathematical Foundations › A4 Probability Theory › Theory

Concentration Inequalities: Markov, Chebyshev, Hoeffding, Bernstein, McDiarmid

Guarantees rather than approximations. The CLT says what deviations look like for large n; concentration inequalities give bounds that hold for every n. Markov uses only the mean, Chebyshev the variance, Hoeffding boundedness (exponential tails), Bernstein both range and variance, and McDiarmid extends it all to any function with bounded differences. With the union bound they give sample sizes, safe certification of learned controllers, and the first generalization bounds of learning theory.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

How sure can you be?

A robot arm succeeds at 92 of 100 grasps. Is its true success rate really above 85%? The law of large numbers says the average will eventually be right. Engineers need more: “with 99% confidence, the true rate is at least X.” Concentration inequalities give exactly such promises, and they hold for any number of trials, with no “approximately”.

They work because a sum of many independent bounded pieces rarely strays far from its average. To stray far, many pieces would all have to be unlucky in the same direction at once, and that’s exponentially unlikely.

How unlikely is a big deviation? Six tail bounds against the truth
1e01e-31e-61e-91e-12deviation t
■ exact: 0.0728■ Markov: 0.8571■ Chebyshev: 0.4200■ Hoeffding: 0.3679■ Bernstein: 0.3237■ Chernoff (KL): 0.3146
P(p̂ − p ≥ t) for the success rate p̂ of n trials. Markov and Chebyshev use only the mean and the variance, so they decay slowly. Hoeffding uses boundedness and decays like e^(−2nt²). Bernstein also uses the variance, so it wins when p is small. Chernoff's KL bound has the exact exponent, and the truth sits just below it. Every bound stays above the thick (exact) curve: that's what makes them guarantees.
Why engineers care

Certifying that a learned controller is safe, deciding how many test drives or simulations you need, proving a machine-learning model will work on new data, and setting alarm thresholds that rarely trigger falsely all need a bound that is guaranteed, not approximate.

📝 Quick check (Level 0)
0/3 answered
  1. 1. A concentration inequality gives…
  2. 2. Big deviations of an average are rare because…
  3. 3. More trials make the guarantee…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

Markov and Chebyshev

  • Markov: for X≥0X\ge0 and a>0a > 0, P(X≥a)≤EXaP(X\ge a)\le\frac{\mathbb EX}{a}. Proof: a1{X≥a}≤Xa\mathbf 1\{X\ge a\}\le X. Take expectations.
  • Chebyshev: apply Markov to (X−μ)2(X - \mu)^2: P(∣X−μ∣≥kσ)≤1k2P(\lvert X - \mu\rvert\ge k\sigma)\le\frac1{k^2}.

They need almost nothing, so they’re loose. Chebyshev says 25% at 2σ2\sigma, but a normal has 4.6%.

Hoeffding’s inequality

If Xi∈[ai,bi]X_i\in[a_i, b_i] are independent, then for Sn=∑XiS_n = \sum X_i and t>0t > 0,

P(Sn−ESn≥t)≤exp⁡(−2t2∑i(bi−ai)2)P\big(S_n - \mathbb ES_n\ge t\big)\le\exp\Big(-\frac{2t^2}{\sum_i(b_i - a_i)^2}\Big)

For the mean of nn variables in [0,1][0,1]: P(Xˉ−μ≥t)≤e−2nt2P(\bar X - \mu\ge t)\le e^{-2nt^2}. Two-sided, multiply by 2. The decay is exponential in nn, and it never depends on the distribution, only on the range.

Sample size: n≥ln⁡(2/δ)2ε2n\ge\frac{\ln(2/\delta)}{2\varepsilon^2} gives P(∣Xˉ−μ∣≥ε)≤δP(\lvert\bar X - \mu\rvert\ge\varepsilon)\le\delta. For ε=0.05\varepsilon = 0.05 and δ=0.05\delta = 0.05, that’s 738.

📝 Quick check (Level 1)
0/3 answered
  1. 1. Markov's inequality needs X to be…
  2. 2. Chebyshev bound on P(|X − μ| ≥ 3σ)?
  3. 3. Hoeffding's bound for a mean of [0,1] variables decays like…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.

Bernstein: use the variance too

If ∣Xi−μi∣≤M\lvert X_i - \mu_i\rvert\le M and ∑Var⁡Xi=nσ2\sum\operatorname{Var}X_i = n\sigma^2, then

P(Xˉ−μ≥t)≤exp⁡(−nt22σ2+23Mt)P(\bar X - \mu\ge t)\le\exp\Big(-\frac{nt^2}{2\sigma^2 + \frac23Mt}\Big)

When σ2\sigma^2 is small, as with rare failures, this is much sharper than Hoeffding, which assumes the worst-case variance (b−a)2/4(b - a)^2/4. For small tt it behaves like a Gaussian tail with the true variance. For large tt it’s like an exponential tail.

The union bound

P(⋃kAk)≤∑kP(Ak)P(\bigcup_kA_k)\le\sum_kP(A_k). To make KK statements hold simultaneously with probability 1−δ1 - \delta, give each one δ/K\delta/K. With Hoeffding, the price is only ln⁡K\sqrt{\ln K}. This is how you safely evaluate many candidate policies or hyperparameters on the same test set.

McDiarmid: beyond sums

If changing the ii-th input changes f(X1,…,Xn)f(X_1, \dots, X_n) by at most cic_i (bounded differences), then

P(f−Ef≥t)≤exp⁡(−2t2∑ici2)P(f - \mathbb Ef\ge t)\le\exp\Big(-\frac{2t^2}{\sum_ic_i^2}\Big)

Examples: the empirical risk (ci=1/nc_i = 1/n), the number of empty bins, the length of a longest common subsequence, and the error of a stable learning algorithm.

🐍 Exercise 1: bounds against the exact tail
Compute the exact binomial tail of a success rate and check that Markov, Chebyshev, Hoeffding and Bernstein all bound it. Show that Hoeffding decays exponentially while Chebyshev doesn't, that Bernstein wins when p is small, and compute Hoeffding sample sizes.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Bernstein beats Hoeffding when…
  2. 2. To make 100 bounds hold together at δ = 0.05 overall, each uses…
  3. 3. The empirical risk (losses in [0,1]) has bounded differences c_i =

Level 3: Advanced

★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.

Proof of Hoeffding

  1. Chernoff step. For any λ>0\lambda > 0, Markov applied to eλ(S−ES)e^{\lambda(S - \mathbb ES)} gives P(S−ES≥t)≤e−λt∏iEeλ(Xi−μi)P(S - \mathbb ES\ge t)\le e^{-\lambda t}\prod_i\mathbb Ee^{\lambda(X_i - \mu_i)} (A4.3-3).
  2. Hoeffding’s lemma. If X∈[a,b]X\in[a,b] and EX=0\mathbb EX = 0, then EeλX≤eλ2(b−a)2/8\mathbb Ee^{\lambda X}\le e^{\lambda^2(b - a)^2/8}. Proof sketch: by convexity, eλx≤b−xb−aeλa+x−ab−aeλbe^{\lambda x}\le\frac{b - x}{b - a}e^{\lambda a} + \frac{x - a}{b - a}e^{\lambda b}. Take expectations. Write the log of the result as L(h)L(h) with h=λ(b−a)h = \lambda(b - a). Then L(0)=L′(0)=0L(0) = L'(0) = 0 and L′′≤1/4L''\le1/4, so L(h)≤h2/8L(h)\le h^2/8.
  3. Optimize. P≤exp⁡(−λt+λ2∑(bi−ai)2/8)P\le\exp(-\lambda t + \lambda^2\sum(b_i - a_i)^2/8). Minimize at λ=4t/∑(bi−ai)2\lambda = 4t/\sum(b_i - a_i)^2 to get exp⁡(−2t2/∑(bi−ai)2)\exp(-2t^2/\sum(b_i - a_i)^2). ∎

McDiarmid follows the same pattern applied to the Doob martingale Zk=E[f∣X1,…,Xk]Z_k = \mathbb E[f\mid X_1, \dots, X_k]. Each increment lies in an interval of length ckc_k, so Hoeffding’s lemma applies step by step (Azuma–Hoeffding).

A first generalization bound

For a finite hypothesis class H\mathcal H and losses in [0,1][0,1], Hoeffding plus the union bound give, with probability ≥1−δ\ge1 - \delta, simultaneously for all h∈Hh\in\mathcal H:

R(h)≤R^(h)+ln⁡∣H∣+ln⁡(1/δ)2nR(h)\le\hat R(h) + \sqrt{\frac{\ln\lvert\mathcal H\rvert + \ln(1/\delta)}{2n}}

This is the template for VC, Rademacher and PAC-Bayes bounds (Shalev-Shwartz and Ben-David, 2014).

Exercise 3.1: Derive Chebyshev from Markov

P(∣X−μ∣≥a)=P((X−μ)2≥a2)≤E(X−μ)2/a2=σ2/a2P(\lvert X - \mu\rvert\ge a) = P((X - \mu)^2\ge a^2)\le\mathbb E(X - \mu)^2/a^2 = \sigma^2/a^2.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Hoeffding's lemma bounds E e^{λX} (X ∈ [a,b], mean 0) by…
  2. 2. McDiarmid is proved with…
  3. 3. In the finite-class bound, the complexity term grows like…

Level 4: Expert

★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.

Certifying the best of many controllers: the winner’s curse

You train 50 grasp-policy variants and test each on 400 trials. Picking the best-looking one and reporting its 95% Hoeffding lower bound is not valid. The best-looking policy was chosen because it got lucky, so its bound fails far more than 5% of the time. Dividing δ\delta by the number of candidates (the union bound) restores the guarantee, and it costs only a ln⁡K\sqrt{\ln K} widening. Better still, hold out a fresh test set for the chosen policy. This is the formal version of “don’t tune on the test set,” and it’s central to statistical certification of autonomous systems (Koopman and Wagner, 2016; Corso et al., 2021).

🐍 Exercise 2 (research): safe certification and the winner's curse
Check that a single Hoeffding lower confidence bound covers the true success rate at least 95% of the time. Then select the best of 50 equally good policies tested on 400 trials each: show that naive bounds under-cover badly, and that dividing δ by 50 restores coverage at a small cost in the bound.

Concentration in AI, robotics and aerospace

  • PAC learning and generalization. Finite-class, VC and Rademacher bounds all start from Hoeffding/McDiarmid plus a union bound (Valiant, 1984; Bartlett and Mendelson, 2002).
  • Bandits and exploration. UCB adds a Hoeffding radius 2ln⁡t/na\sqrt{2\ln t/n_a} to each arm’s mean (“optimism in the face of uncertainty”), with provably logarithmic regret (Auer, Cesa-Bianchi and Fischer, 2002).
  • Safe RL and verification. High-confidence off-policy evaluation reports a lower bound on a new policy’s return before you deploy it (Thomas et al., 2015). Statistical model checking certifies probabilistic safety properties from simulated runs.
  • Scenario optimization for robust control: the number of sampled scenarios needed so that the solution violates at most an ε\varepsilon fraction of conditions with confidence 1−δ1 - \delta comes from a binomial tail bound (Campi and Garatti, 2008).
  • Conformal prediction produces distribution-free prediction sets whose coverage is a finite-sample guarantee. It’s widely used for uncertainty in perception and planning (Angelopoulos and Bates, 2023).

References

  1. W. Hoeffding (1963). “Probability inequalities for sums of bounded random variables.” JASA, 58(301).
  2. S. Bernstein (1924). “On a modification of Chebyshev’s inequality and of the error formula of Laplace.” Ann. Sci. Inst. Sav. Ukraine, 1.
  3. C. McDiarmid (1989). “On the method of bounded differences.” Surveys in Combinatorics, LMS Lecture Notes 141.
  4. S. Boucheron, G. Lugosi, P. Massart (2013). Concentration Inequalities: A Nonasymptotic Theory of Independence. Oxford University Press.
  5. R. Vershynin (2018). High-Dimensional Probability, Ch. 2. Cambridge University Press.
  6. S. Shalev-Shwartz, S. Ben-David (2014). Understanding Machine Learning. Cambridge University Press.
  7. P. Auer, N. Cesa-Bianchi, P. Fischer (2002). “Finite-time analysis of the multiarmed bandit problem.” Machine Learning, 47.
  8. P. Thomas, G. Theocharous, M. Ghavamzadeh (2015). “High-confidence off-policy evaluation.” AAAI.
  9. M. Campi, S. Garatti (2008). “The exact feasibility of randomized solutions of uncertain convex programs.” SIAM Journal on Optimization, 19(3).
  10. A. Corso, R. Moss, M. Koren, R. Lee, M. Kochenderfer (2021). “A survey of algorithms for black-box safety validation of cyber-physical systems.” JAIR, 72.
  11. A. Angelopoulos, S. Bates (2023). “Conformal prediction: a gentle introduction.” Foundations and Trends in ML, 16(4).
  12. P. Koopman, M. Wagner (2016). “Challenges in autonomous vehicle testing and validation.” SAE International Journal of Transportation Safety, 4(1).