advanced29 min studyLesson 692 in Mathematics

Hoeffding's lemma and bounded sums

Use deterministic interval widths to obtain finite-sample Gaussian-shaped tails for independent bounded variables.

On this page

What you’ll understand

  • State Hoeffding's lemma with its centering and interval constants.
  • Derive upper and two-sided bounds for independent bounded sums.
  • Compute a sample-size guarantee and distinguish exact bounds from normal approximations.

Sometimes the only trustworthy distributional information is a deterministic range. Hoeffding's lemma converts that range into a centered exponential-moment bound, and independence then produces a tail inequality for the whole sum. The resulting Gaussian-shaped exponent does not assert that the variables or their sum are Gaussian. Its strength is finite-sample validity under limited assumptions; its limitation is that interval widths can ignore a much smaller actual variance.

A bounded variable has a controlled centered mgf

If a real variable X lies almost surely in a deterministic interval [a,b], Hoeffding's lemma bounds the log mgf of X−EX by λ²(b−a)²/8 for every real λ. The width is unchanged by centering, and no symmetry or identical distribution is required. The constant variable case has width zero and no fluctuation. A bound depending on the width rather than the endpoints is invariant under adding a deterministic offset, exactly as a centered concentration statement should be.

One proof studies the second derivative of the log mgf. Under exponential tilting, this derivative is a variance. The tilted distribution remains supported in [a,b], so its variance is at most (b−a)²/4. Integrate this curvature bound twice, using that the centered log mgf and its first derivative vanish at zero. Boundedness ensures all exponential moments exist and justifies differentiating. This argument explains both the factor one eighth and why replacing the interval width by a sample-observed range would not preserve the theorem.

a≤X≤b a.s.⟹log⁡Eeλ(X−EX)≤λ2(b−a)28(λ∈R)a\le X\le b\ \text{a.s.}\quad\Longrightarrow\quad\log\mathbb E e^{\lambda(X-\mathbb EX)}\le\frac{\lambda^2(b-a)^2}{8}\quad(\lambda\in\mathbb R)
The bounds a,b are deterministic population bounds; the variable inside the exponential is centered.↔ Scroll wide equations horizontally.

Add the widths in squared form

For independent X_i in intervals [a_i,b_i], factor the centered sum's mgf and add the lemma bounds. If W is the sum of squared widths, the resulting proxy is W/4 in the convention log mgf≤proxy times λ²/2. Optimizing the upper-tail exponential bound gives exp(−2t²/W). Applying the same reasoning to the negative sum and combining events gives the factor two for an absolute deviation. When W is zero the sum is deterministic, so the displayed division formula is replaced by that trivial case.

For an average of n independent variables in [0,1], the deviation scale is n times the average error. The bound therefore becomes exp(−2nε²) for one side and twice this quantity for two sides. Identical distribution is not required if the average is centered at its own expected value. Turning this into estimation of one common population mean does require that all the expectations equal that mean, as they do for an iid sample. Independence remains essential even when every marginal is bounded.

P ⁣{∣∑i(Xi−EXi)∣≥t}≤2exp⁡ ⁣(−2t2∑i(bi−ai)2)\mathbb P\!\left\{\left|\sum_i(X_i-\mathbb EX_i)\right|\ge t\right\}\le2\exp\!\left(-\frac{2t^2}{\sum_i(b_i-a_i)^2}\right)
The summands are independent and their squared-width sum is positive. A one-sided event has the same exponent without the factor two.↔ Scroll wide equations horizontally.

A guarantee is not a normal approximation

Hoeffding's inequality is valid before any asymptotic limit, including highly skewed Bernoulli distributions where a normal approximation may be poor. It does not approximate individual probability bars, and it does not require estimating a variance. The tradeoff is conservatism: rare Bernoulli successes have variance far below one quarter, while the width-based proxy still uses one quarter per trial. Variance-sensitive inequalities can improve that situation when their additional inputs are available and correctly bounded.

To choose a sample size, solve the exponential inequality for n and round upward. The resulting number is sufficient under the assumptions, rather than a necessary minimum for the true distribution. If the sample is collected adaptively, correlated over time, or selected after inspecting an outcome, independent-sum reasoning may fail. A conditional-mgf or martingale argument can sometimes replace it, but bounded observations alone do not grant that replacement. Keep the sampling design in the probability statement alongside the numerical error tolerance.

A fair-coin average above 0.7

For 100 independent Bernoulli(1/2) observations, bound the probability that the sample mean is at least 0.7. Compare with the exact binomial upper tail.

  1. Each interval has width one, so the sum of squared widths is 100. The sum is centered at 50, and a mean of 0.7 corresponds to count at least 70, a centered-sum deviation of 20.

  2. The one-sided Hoeffding exponent is −2·20²/100=−8. Thus the probability is at most exp(−8)≈0.000335463, with no extra factor two because the event is an upper tail only.

  3. Summing the exact binomial masses for counts 70 through 100 gives about 0.0000392507. The rigorous width-based bound is larger, while the displayed normal comparison in an instrument would be a separate approximation.

The result

The one-sided guarantee is exp(−8), about 3.35×10⁻⁴. The exact probability is about 3.93×10⁻⁵.

Explore the model

Interactive lab

Interactive lab · sampling

Finite-sample tails and sample size

Pause and Reset, then set p = 0.5 and sample size n = 100. Predict mean 0.5 and variance 0.0025 for K/n; add exact bars at 0.7 and above and compare with exp(−8). Reset and set both p = 0.5 and n = 25. The event K/n≥0.7 now starts at count 18, with exact tail 0.0216426 and the valid unrounded Hoeffding bound exp(−2). The normal overlay is an approximation and is not the Hoeffding bound; playback highlights exact outcomes rather than generating samples.

Finite-sample tails and sample sizeExact binomial masses for the mean of n independent Bernoulli trials, compared with normal mass between adjacent half-count boundaries; normal tails outside the finite support remain outside the bars. Playback highlights outcomes, not random samples. The Berry–Esseen bound applies to standardized CDFs, not individual bars or continuity-corrected errors. At p = 0 or 1, normal comparison and that bound are disabled. Normal-CDF evaluation uses a numerical approximation with absolute error below 7.5×10⁻⁸ (at most 1.5×10⁻⁷ per interval, before rounding). Current readings: Mean sample proportion: 0.5; Sample-mean variance: 0.0125; Uniform CDF error bound: ≤ 0.1062. All parameters are adjustable with the labeled controls below.Exact distribution of the mean of 20 independent Bernoulli variables with success probability 0.5; playback highlights outcome 0.00.250.50.75100.0580.1150.1730.23Sample mean · k / nProbability massNormal bin masses are an approximationk = 0 · exact probability = 9.54e-7
Exact binomial massNormal interval massHighlighted outcome / mean
Mean sample proportion
0.5
Sample-mean variance
0.0125
Uniform CDF error bound
≤ 0.1062
t = 0 s

Exact binomial masses for the mean of n independent Bernoulli trials, compared with normal mass between adjacent half-count boundaries; normal tails outside the finite support remain outside the bars. Playback highlights outcomes, not random samples. The Berry–Esseen bound applies to standardized CDFs, not individual bars or continuity-corrected errors. At p = 0 or 1, normal comparison and that bound are disabled. Normal-CDF evaluation uses a numerical approximation with absolute error below 7.5×10⁻⁸ (at most 1.5×10⁻⁷ per interval, before rounding). Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forHoeffding controls an event probability at each finite sample size; the normal overlay answers a different question.

Check your understanding

For independent Xᵢ in [0,1], what is the two-sided Hoeffding bound for |sample mean−its expectation|≥ε?

Try it yourself

How many iid observations in [0,1] suffice to estimate their common mean within 0.05 with failure probability at most 0.01 using two-sided Hoeffding? State the rounding and interpretation.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Solve 2 exp(−2n·0.05²)≤0.01, then take the smallest integer above the resulting real threshold.

Compare with the solution

The requirement is n≥log⁡(200)/(2⋅0.052)=log⁡(200)/0.005≈1059.6635n\ge\log(200)/(2\cdot0.05^2)=\log(200)/0.005\approx1059.6635. Thus n=1060 suffices. This controls the probability of error at least 0.05 by at most 0.01 under iid sampling and a deterministic [0,1] range. It is not a claim that every distribution needs 1060 samples: a nearly constant variable may need far fewer. Nor can the same number be justified for 1060 identical copies of one random observation, since those copies are not independent and averaging would create no new information.

Take it with you

  • Hoeffding's lemma uses centering and a deterministic interval width with constant one eighth.
  • Independent bounded sums have tails governed by the sum of squared widths.
  • Finite-sample guarantees, exact probabilities, and normal approximations must remain distinct.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.