Concentration and the union bound

Why stronger tail bounds?

2026-11-17

No pair left behind

For n data points, there are N=\binom n2=\frac{n(n-1)}2 pairwise distances.

With n=1000, that is 499{,}500 opportunities for failure.

A guarantee for one pair must be strong enough to cover them all.

Recall: the worst pair does drift

n Gaussian points in \mathbb R^{10{,}000}, projected to k=200 dimensions, as in the teaser. We track the error in squared distance, \big|\|f(\mathbf x_i)-f(\mathbf x_j)\|^2/\|\mathbf x_i-\mathbf x_j\|^2-1\big|.

The typical pair does not care about n. The worst pair does, but only slowly. Today: why.

The union bound

For any events E_1,\ldots,E_N, \boxed{\Pr\!\left(\bigcup_{j=1}^N E_j\right) \leq\sum_{j=1}^N\Pr(E_j).}

Pointwise, \mathbf 1_{\cup_j E_j}\leq\sum_{j=1}^N\mathbf 1_{E_j}:

  • If no E_j happens, both sides are 0.
  • If some E_j happen, the left side is 1 and the right side counts them, so it is at least 1.

Take expectations.

A budget for each bad event

To make \Pr(\text{any failure})\leq\delta, it suffices that \Pr(E_j)\leq\frac{\delta}{N} \qquad\text{for every }j.

For n=1000 and \delta=0.05, \frac{\delta}{N}=\frac{0.05}{499{,}500}\approx10^{-7}.

We need a very small single-pair failure probability.

Refresher: the Gaussian

A random variable G\sim N(\mu,\sigma^2) has density p(x)=\frac1{\sqrt{2\pi\sigma^2}}\,e^{-(x-\mu)^2/(2\sigma^2)}, \qquad \mathbb E[G]=\mu, \quad \operatorname{Var}(G)=\sigma^2. The standard Gaussian has \mu=0, \sigma=1, and \mu+\sigma G\sim N(\mu,\sigma^2) when G\sim N(0,1).

The tails decay like e^{-x^2/2}, much faster than any polynomial. This is what we will exploit today.

Why squared Gaussians?

f(\mathbf x)=\frac1{\sqrt k}\mathbf G\mathbf x, with \mathbf G\in\mathbb R^{k\times d} standard Gaussian. For a pair, let \mathbf u=\mathbf x_i-\mathbf x_j. By linearity, \frac{\|f(\mathbf x_i)-f(\mathbf x_j)\|^2}{\|\mathbf x_i-\mathbf x_j\|^2} =\frac1k\sum_{r=1}^k\left(\frac{(\mathbf G\mathbf u)_r}{\|\mathbf u\|}\right)^2.

Each term is a standard Gaussian

(\mathbf G\mathbf u)_r=\sum_{l=1}^dG_{rl}u_l\sim N\big(0,\|\mathbf u\|^2\big), independent across rows r.

Every pair’s distortion is an average of k independent squared N(0,1) variables.

The random quantity we will need

Let G_1,\ldots,G_k be independent N(0,1) variables. Define Z_k=\frac1k\sum_{j=1}^kG_j^2.

For a standard Gaussian, \mathbb E[G_j^2]=1 and \mathbb E[G_j^4]=3, so \operatorname{Var}(G_j^2)=\mathbb E[G_j^4]-\big(\mathbb E[G_j^2]\big)^2=3-1=2.

By independence, \mathbb E[Z_k]=1, \qquad \operatorname{Var}(Z_k)=\frac1{k^2}\cdot k\cdot2=\frac2k.

What Chebyshev gives

\Pr(|Z_k-1|\geq\varepsilon)\leq\frac2{k\varepsilon^2}.

For N events, each with this bound, \Pr(\text{any failure})\leq\frac{2N}{k\varepsilon^2}.

To make this at most \delta, it suffices that k\geq\frac{2N}{\varepsilon^2\delta}. With n=1000, \varepsilon=0.25, \delta=0.05: k\geq3.2\times10^{8}, linear in the number of pairs.

Markov on a faster-growing function

Chebyshev applied Markov to (X-\mu)^2.

For a centered sum S and \lambda>0, apply Markov to e^{\lambda S} instead.

Since e^{\lambda s} is positive and increasing, \{S\geq a\}=\{e^{\lambda S}\geq e^{\lambda a}\}, so \Pr(S\geq a) \leq e^{-\lambda a}\,\mathbb E[e^{\lambda S}].

If S=X_1+\cdots+X_k has independent summands, \mathbb E[e^{\lambda S}] =\prod_{j=1}^k\mathbb E[e^{\lambda X_j}].

A Gaussian concentration theorem

For independent G_j\sim N(0,1) and 0<\varepsilon<1, \boxed{ \Pr\!\left(\left|\frac1k\sum_{j=1}^kG_j^2-1\right| \geq\varepsilon\right) \leq2e^{-k\varepsilon^2/8}. }

The key feature is exponential decay in k\varepsilon^2.

Proof sketch

Write S=\sum_{j=1}^kG_j^2, so Z_k=S/k. Treat the upper tail first.

  • Moment generating function. A Gaussian integral gives \mathbb E[e^{\lambda G^2}]=(1-2\lambda)^{-1/2} for \lambda<\tfrac12.
  • Markov on e^{\lambda S}. By independence, \Pr(S\geq k(1+\varepsilon))\leq\big[e^{-\lambda(1+\varepsilon)}(1-2\lambda)^{-1/2}\big]^k.
  • Optimize \lambda. Taking \lambda=\frac{\varepsilon}{2(1+\varepsilon)} gives \big[(1+\varepsilon)e^{-\varepsilon}\big]^{k/2}, and \log(1+\varepsilon)\leq\varepsilon-\varepsilon^2/4 on [0,1] turns this into e^{-k\varepsilon^2/8}.
  • Lower tail. The same steps with \lambda<0 give \Pr(Z_k\leq1-\varepsilon)\leq e^{-k\varepsilon^2/4}\leq e^{-k\varepsilon^2/8}. Add the two tails.

Visualizing the bounds

Fix \varepsilon=0.25. Dots: 200{,}000 simulated draws of Z_k. Solid: the exact tail. Note the log scale.

Chebyshev never reaches the budget on this plot. The Gaussian bound does, because it decays exponentially, like the truth.

The payoff of exponential decay

If every bad event has probability at most 2e^{-k\varepsilon^2/8}, then \Pr(\text{any failure})\leq2N e^{-k\varepsilon^2/8}.

This is at most \delta whenever \boxed{k\geq\frac8{\varepsilon^2}\log\!\left(\frac{2N}{\delta}\right).}

Same n, \varepsilon, \delta: k\geq2152, logarithmic in the number of pairs.

Checking the bound against a simulation

n=1000 Gaussian points in \mathbb R^{10{,}000}, all 499{,}500 pairs, worst squared-distance error over 3 draws of \mathbf G.

From d=10{,}000 down to k\approx1000 already works. The guarantee is conservative by about a factor of two, but it is the right order. Chebyshev asked for 3.2\times10^8.

The tool for random projections

For n points, 2N=n(n-1)\leq n^2. So it suffices to choose k\geq\frac8{\varepsilon^2}\left(2\log n+\log\frac1\delta\right).

Next: show that the distortion of one fixed vector has exactly the distribution Z_k.

Then apply this guarantee to every pairwise difference.