advanced34 min studyLesson 60 in Mathematics

Large deviations and rare events

Bound atypical averages with exponential moments, distinguish finite-sample inequalities from logarithmic asymptotics, and reason about rare-event simulation.

On this page

What you’ll understand

  • Derive a Chernoff upper bound using an exponential moment.
  • Calculate the Bernoulli relative-entropy rate with its domain assumptions.
  • Separate exponential-scale asymptotics, exact probabilities, and estimator relative error.

The central limit theorem describes fluctuations near a typical average on a shrinking square-root scale. Reliability and queue overflow often ask a different question: how unlikely is a fixed, substantial deviation when many random contributions accumulate? Large-deviation theory studies the exponential scale of such probabilities. It connects moment-generating functions to rate functions and links Bernoulli tails to relative entropy. The resulting exponent is informative, but it is not automatically an exact probability or a replacement for finite-sample prefactors and model assumptions.

An exponential transform turns a tail into a moment

For a positive tilt theta, the event that a sum exceeds a threshold is equivalent to the exponential of that sum exceeding the exponential threshold. Markov's inequality then bounds the event probability by an exponential moment divided by the threshold. With independent identically distributed contributions, the moment factors into a product. Taking its logarithm makes the exponent linear in sample size. Independence and finiteness of the chosen moment are the two critical permissions in this calculation.

Optimizing over allowed positive theta yields the strongest bound of this form for an upper tail. This is a finite-sample inequality, so it remains a bound even when sample size is modest. For variables with no finite positive exponential moments, the same derivation supplies no useful positive-tilt estimate. Heavy-tailed sums can be dominated by one unusually large contribution rather than a coordinated shift of many moderate ones. A formula derived for light tails should not be applied merely because a sample average exists.

P(X‾n≥a)≤exp⁡ ⁣[−nsup⁡θ≥0{θa−Λ(θ)}],Λ(θ)=log⁡E[eθX1]\mathbb P(\overline X_n\ge a)\le\exp\!\left[-n\sup_{\theta\ge0}\{\theta a-\Lambda(\theta)\}\right],\qquad\Lambda(\theta)=\log\mathbb E[e^{\theta X_1}]
The Xᵢ are IID, and the optimization uses θ≥0 with finite exponential moment. The inequality follows from Markov's inequality; the upper-tail direction determines the tilt sign.↔ Scroll wide equations horizontally.

A rate function measures cost on a logarithmic scale

Under Cramér's theorem, IID real random variables whose moment-generating function is finite in a neighborhood of zero satisfy a large-deviation principle for their empirical means. The rate is the Legendre–Fenchel transform of the log moment-generating function. The theorem gives upper bounds for closed sets and lower bounds for open sets on the scale of logarithm divided by n. Turning these into one equality for a particular event requires regularity of that event and agreement of the relevant rate infima.

For Bernoulli variables with success probability p strictly between zero and one, the rate at an empirical success fraction a is binary relative entropy D(a||p). It is nonnegative and vanishes at a=p. For a>p, it gives the Chernoff exponent for an upper tail; a below p instead calls for a lower-tail analysis using negative tilts. Endpoint values use continuous conventions such as zero times log zero equals zero. A divergence in probability-parameter space measures the cost of an atypical empirical law, rather than an ordinary distance between individual outcomes.

I(a)=sup⁡θ∈R{θa−Λ(θ)},D(a∥p)=alog⁡ap+(1−a)log⁡1−a1−pI(a)=\sup_{\theta\in\mathbb R}\{\theta a-\Lambda(\theta)\},\qquad D(a\|p)=a\log\frac ap+(1-a)\log\frac{1-a}{1-p}
The first expression is the Cramér rate under the stated exponential-moment assumptions. The Bernoulli formula uses 0<p<1 and 0≤a≤1 with endpoint limits; logarithms are natural.↔ Scroll wide equations horizontally.

An exponent does not settle a rare-event estimate

A logarithmic asymptotic of the form probability approximately exp(−nI) identifies the dominant exponential decay while allowing polynomial factors and other subexponential corrections. It may be accurate in log probability yet inaccurate by a large multiplicative factor. An optimized Chernoff inequality is an upper bound, not an assertion that the probability attains that bound. For a small binomial model, summing exact terms supplies a valuable independent benchmark and exposes the difference between exponential order, finite-sample bounds, and exact values.

Naive Monte Carlo struggles when the event probability r is tiny: the variance of an indicator average is r(1−r)/N, giving relative standard error about 1/√(Nr). Observing no events does not establish r=0. Exponential tilting can make the rare empirical mean typical under a proposal distribution, after which likelihood-ratio weights recover the original probability. A good proposal must still cover the event and control weighted variance. Large-deviation geometry guides that choice, while estimator diagnostics and exact checks establish whether it actually improved the computation.

Var⁡(r^N)r=1−rNr,r^N=1N∑i=1N1Ai\frac{\sqrt{\operatorname{Var}(\widehat r_N)}}{r}=\sqrt{\frac{1-r}{Nr}},\qquad\widehat r_N=\frac1N\sum_{i=1}^N\mathbf1_{A_i}
The event indicators are independent with common probability 0<r<1. This exact relative standard error concerns naive Monte Carlo, not an importance-sampling estimator.↔ Scroll wide equations horizontally.

A rare excess of Bernoulli successes

Let K be binomial with n=100 and p=0.1. Bound the probability K≥30 and compare the result with the exact binomial tail.

  1. The threshold fraction is a=0.3, above the mean fraction 0.1. Compute D(0.3∥0.1)=0.3log⁡3+0.7log⁡(7/9)≈0.15366359D(0.3\|0.1)=0.3\log3+0.7\log(7/9)\approx0.15366359. Natural logarithms are needed for the exponential expression used next.

  2. The Bernoulli Chernoff upper bound is e−100D≈2.12068×10−7e^{-100D}\approx2.12068\times10^{-7}. Its optimal positive tilt is θ=log⁡{a(1−p)/[p(1−a)]}=log⁡(27/7)\theta=\log\{a(1-p)/[p(1-a)]\}=\log(27/7), consistent with shifting the empirical success fraction upward.

  3. Summing the exact binomial probabilities from k=30 through 100 gives approximately 2.44511×10−82.44511\times10^{-8}. The bound is about 8.67 times the exact tail. Both values are small, but replacing a certified upper bound with an exact-probability claim would lose this material difference.

The result

The tail is at most about 2.12×10⁻⁷, while its exact value is about 2.45×10⁻⁸. The exponential rate captures rarity without supplying the full finite-sample probability.

Explore the model

Interactive lab

Interactive lab · probability

Exact finite tails before asymptotic inference

Set p to 0.1 and increase n within the control range. Inspect how mass concentrates near np and how far-right bars become small. For a chosen integer threshold, sum the displayed exact binomial masses on paper and compare with exp[−nD(a||p)] when a>p. The lab displays exact finite probabilities, not a fitted large-deviation rate, a logarithmic convergence proof, or an importance-sampling run; its control range may be smaller than the worked example.

Exact finite tails before asymptotic inferenceThese are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Current readings: Mean · np: 5; Variance · np(1−p): 2.5; Total probability: 1. All parameters are adjustable with the labeled controls below.03581000.070.150.220.3Successes kP(X = k)k = 0 · P = 9.77e-4
Exact probabilityHighlighted outcomeMean np
Mean · np
5
Variance · np(1−p)
2.5
Total probability
1
t = 0 s

These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. 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 forFinite exact probabilities, exponential upper bounds, and asymptotic rate functions describe related but different levels of precision.

Check your understanding

What justifies the finite-sample upper-tail Chernoff bound used for IID Bernoulli trials?

Try it yourself

An event has probability r=10⁻⁶. Approximately how many independent naive Monte Carlo samples are needed for a relative standard error of 10%? Is one million samples enough?

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

Give me a hint

For small r, solve 1/√(Nr)=0.1. Relative error is measured against r rather than against one.

Compare with the solution

The requirement is Nr≈100, hence N≈100/10⁻⁶=10⁸ samples. One million gives Nr=1 and relative standard error about 1, or 100%, rather than 10%. This is a standard-error calculation, not a deterministic guarantee, and it explains why weighted rare-event methods can be necessary even when ordinary simulation is straightforward.

Take it with you

  • Chernoff bounds use exponential moments, independence, and a tilt whose sign matches the tail.
  • A large-deviation principle describes logarithmic scaling under explicit assumptions, while exact finite probabilities retain subexponential detail.
  • Rare-event Monte Carlo needs enough expected hits or a correctly weighted variance-reduction strategy.

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.