# Hoeffding's inequality

In probability theory, Hoeffding's inequality provides an upper bound on the probability that the sum of random variables deviates from its expected value. Hoeffding's inequality was proved by Wassily Hoeffding in 1963.[1]

Hoeffding's inequality is a special case of the Azuma–Hoeffding inequality, and it is more general than the Bernstein inequality, proved by Sergei Bernstein in 1923. They are also special cases of McDiarmid's inequality.

## Special case of Bernoulli random variables

Hoeffding's inequality can be applied to the important special case of identically distributed Bernoulli random variables, and this is how the inequality is often used in combinatorics and computer science. We consider a coin that shows heads with probability $p$ and tails with probability $1-p$. We toss the coin $n$ times. The expected number of times the coin comes up heads is $p\cdot n$. Furthermore, the probability that the coin comes up heads at most $k$ times can be exactly quantified by the following expression:

$\Pr\Big(n \text{ coin tosses yield heads at most } k \text{ times}\Big)= \sum_{i=0}^{k} \binom{n}{i} p^i (1-p)^{n-i}\,.$

In the case that $k=(p-\epsilon) n$ for some $\epsilon > 0$, Hoeffding's inequality bounds this probability by a term that is exponentially small in $\epsilon^2 \cdot n$:

$\Pr\Big(n \text{ coin tosses yield heads at most } (p-\epsilon) n \text{ times}\Big)\leq\exp\big(-2\epsilon^2 n\big)\,.$

Similarly, in the case that $k=(p+\epsilon) n$ for some $\epsilon > 0$, Hoeffding's inequality bounds the probability that we see at least $\epsilon n$ more tosses that show heads than we would expect:

$\Pr\Big(n \text{ coin tosses yield heads at least } (p+\epsilon) n \text{ times}\Big)\leq\exp\big(-2\epsilon^2 n\big)\,.$

Hence Hoeffding's inequality implies that the number of heads that we see is concentrated around its mean, with exponentially small tail.

$\Pr\Big(n \text{ coin tosses yield heads between } (p-\epsilon)n \text{ and } (p+\epsilon)n \text{ times}\Big)\geq 1-2\exp\big(-2\epsilon^2 n\big)\,.$

## General case

Let

$X_1, \dots, X_n \!$

be independent random variables. Assume that the $X_i$ are almost surely bounded; that is, assume for $1 \leq i \leq n$ that

$\Pr(X_i \in [a_i, b_i]) = 1. \!$

We define the empirical mean of these variables

$\overline X = \frac{1}{n}(X_1 + \cdots + X_n).$

Theorem 2 of Hoeffding (1963) proves the inequalities

$\Pr(\overline X - \mathrm{E}[\overline X] \geq t) \leq \exp \left( - \frac{2n^2t^2}{\sum_{i=1}^n (b_i - a_i)^2} \right),\!$
$\Pr(|\overline X - \mathrm{E}[\overline X]| \geq t) \leq 2\exp \left( - \frac{2n^2t^2}{\sum_{i=1}^n (b_i - a_i)^2} \right),\!$

which are valid for positive values of t. Here $\mathrm{E}[\overline X]$ is the expected value of $\overline X$. The inequalities can be also stated in terms of the sum

$S = X_1 + \cdots + X_n$

of the random variables:

$\Pr(S - \mathrm{E}[S] \geq t) \leq \exp \left( - \frac{2t^2}{\sum_{i=1}^n (b_i - a_i)^2} \right),\!$
$\Pr(|S - \mathrm{E}[S]| \geq t) \leq 2\exp \left( - \frac{2t^2}{\sum_{i=1}^n (b_i - a_i)^2} \right).\!$

Note that the inequalities also hold when the $X_i$ have been obtained using sampling without replacement; in this case the random variables are not independent anymore. A proof of this statement can be found in Hoeffding's paper. For slightly better bounds in the case of sampling without replacement, see for instance the paper by Serfling (1974).

## References

• Serfling, Robert J. (1974). "Probability Inequalities for the Sum in Sampling without Replacement". The Annals of Statistics 2 (1): 39–48. doi:10.1214/aos/1176342611.
• Hoeffding, Wassily (March 1963). "Probability inequalities for sums of bounded random variables". Journal of the American Statistical Association 58 (301): 13–30. JSTOR 2282952.