 #jsDisabledContent { display:none; } My Account |  Register |  Help Flag as Inappropriate This article will be permanently flagged as inappropriate and made unaccessible to everyone. Are you certain this article is inappropriate?          Excessive Violence          Sexual Content          Political / Social Email this Article Email Address:

# Chernoff's inequality

Article Id: WHEBN0000611816
Reproduction Date:

 Title: Chernoff's inequality Author: World Heritage Encyclopedia Language: English Subject: Collection: Publisher: World Heritage Encyclopedia Publication Date:

### Chernoff's inequality

In probability theory, the Chernoff bound, named after Herman Chernoff, gives exponentially decreasing bounds on tail distributions of sums of independent random variables. It is a sharper bound than the known first or second moment based tail bounds such as Markov's inequality or Chebyshev inequality, which only yield power-law bounds on tail decay. However, the Chernoff bound requires that the variates be independent – a condition that neither the Markov nor the Chebyshev inequalities require.

It is related to the (historically earliest) Bernstein inequalities, and to Hoeffding's inequality.

## Example

Let X1, ..., Xn be independent Bernoulli random variables, each having probability p > 1/2. Then the probability of simultaneous occurrence of more than n/2 of the events {Xk = 1} has an exact value S, where

$S=\sum\limits_\left\{i = \lfloor \frac\left\{n\right\}\left\{2\right\} \rfloor + 1\right\}^n \binom\left\{n\right\}\left\{i\right\}p^i \left(1 - p\right)^\left\{n - i\right\} .$

The Chernoff bound shows that S has the following upper bound:

$S \le 1 - \mathrm\left\{e\right\}^\left\{- \frac\left\{1\right\}\left\{2p\right\}n \left\left( \left\{p - \frac\left\{1\right\}\left\{2\right\}\right\} \right\right)^2\right\} .$

Indeed, noticing that μ = np, we get by the multiplicative form of Chernoff bound (see below or Corollary 13.3 in Sinclair's class notes),

$\mathbf\left\{P\right\}\left \left( S\le\frac\left\{n\right\}\left\{2\right\}\right \right)= \mathbf\left\{P\right\} \left \left( S\le\left\left(1-\left\left(1-\frac\left\{1\right\}\left\{2p\right\}\right\right)\right\right)\mu\right \right) \leq e^\left\{-\frac\left\{\mu\right\}\left\{2\right\}\left\left(1-\frac\left\{1\right\}\left\{2p\right\}\right\right)^2\right\}=e^\left\{-\frac\left\{1\right\}\left\{2p\right\}n\left\left(p-\frac\left\{1\right\}\left\{2\right\}\right\right)^2\right\}$

This result admits various generalizations as outlined below. One can encounter many flavours of Chernoff bounds: the original additive form (which gives a bound on the absolute error) or the more practical multiplicative form (which bounds the error relative to the mean).

## A motivating example

File:Chernoff bound.png

The simplest case of Chernoff bounds is used to bound the success probability of majority agreement for n independent, equally likely events.

A simple motivating example is to consider a biased coin. One side (say, Heads), is more likely to come up than the other, but you don't know which and would like to find out. The obvious solution is to flip it many times and then choose the side that comes up the most. But how many times do you have to flip it to be confident that you've chosen correctly?

In our example, let Xi denote the event that the ith coin flip comes up Heads; suppose that we want to ensure we choose the wrong side with at most a small probability ε. Then, rearranging the above, we must have:

$n \geq \frac\left\{1\right\}\left\{\left(p -\frac\left\{1\right\}\left\{2\right\}\right)^2\right\} \ln \frac\left\{1\right\}\left\{\sqrt\left\{\varepsilon\right\}\right\}.$

If the coin is noticeably biased, say coming up on one side 60% of the time (p = .6), then we can guess that side with 95% (ε = .05) accuracy after 150 flips (n = 150). If it is 90% biased, then a mere 10 flips suffices. If the coin is only biased a tiny amount, like most real coins are, the number of necessary flips becomes much larger.

More practically, the Chernoff bound is used in randomized algorithms (or in computational devices such as quantum computers) to determine a bound on the number of runs necessary to determine a value by majority agreement, up to a specified probability. For example, suppose an algorithm (or machine) A computes the correct value of a function f with probability p > 1/2. If we choose n satisfying the inequality above, the probability that a majority exists and is equal to the correct value is at least 1 − ε, which for small enough ε is quite reliable. If p is a constant, ε diminishes exponentially with growing n, which is what makes algorithms in the complexity class BPP efficient.

Notice that if p is very close to 1/2, the necessary n can become very large. For example, if p = 1/2 + 1/2m, as it might be in some PP algorithms, the result is that n is bounded below by an exponential function in m:

$n \geq 2^\left\{2m\right\} \ln \frac\left\{1\right\}\left\{\sqrt\left\{\varepsilon\right\}\right\}.$

## The first step in the proof of Chernoff bounds

The Chernoff bound for a random variable X, which is the sum of n independent random variables $X_1, ..., X_n$, is obtained by applying etX for some well-chosen value of t. This method was first applied by Sergei Bernstein to prove the related Bernstein inequalities.

From Markov's inequality and using independence we can derive the following useful inequality:

For any t > 0,

$\mathbf\left\{P\right\}\left(X \ge a\right) = \mathbf\left\{P\right\}\left \left(e^\left\{tX\right\} \ge e^\left\{ta\right\}\right \right) \le \frac\left\{ E\left[e^\left\{tX\right\}\right]\right\}\left\{e^\left\{ta\right\}\right\} = \frac\left\{E\left[\prod_i e^\left\{tX_i\right\}\right]\right\}\left\{e^\left\{ta\right\}\right\}.$

In particular optimizing over t and using independence we obtain,

$\mathbf\left\{P\right\}\left(X \ge a\right) \leq \min_\left\{t>0\right\} \frac\left\{\prod_i E\left[e^\left\{tX_i\right\}\right]\right\}\left\{e^\left\{ta$

(})

.|1}}

Similarly,

$\mathbf\left\{P\right\} \left(X \le a\right) = \mathbf\left\{P\right\}\left \left(e^\left\{-tX\right\} \ge e^\left\{-ta\right\}\right\right)$

and so,

$\mathbf\left\{P\right\} \left(X \le a\right) \leq \min_\left\{t>0\right\} e^\left\{ta\right\} \prod_i E\left[e^\left\{-tX_i\right\}\right] .$

## Precise statements and proofs

### Theorem for additive form (absolute error)

The following Theorem is due to Wassily Hoeffding and hence is called Chernoff-Hoeffding theorem.

Assume random variables $X_1, \ldots, X_m$ are i.i.d. Let p = E[Xi], Xi ∈ {0, 1}, and ε > 0. Then

$\mathbf\left\{P\right\} \left \left( \frac\left\{1\right\}\left\{m\right\} \sum X_i \geq p + \varepsilon \right \right) \leq \left \left( \left\{\left \left(\frac\left\{p\right\}\left\{p + \varepsilon\right\}\right \right)\right\}^\left\{p+\varepsilon\right\} \left\{\left \left(\frac\left\{1 - p\right\}\left\{1 -p - \varepsilon\right\}\right \right)\right\}^\left\{1 - p- \varepsilon\right\}\right \right) ^m = e^\left\{ - D\left(p+\varepsilon\|p\right) m\right\}$

and

$\mathbf\left\{P\right\} \left \left( \frac 1 m \sum X_i \leq p - \varepsilon \right \right) \leq \left \left( \left\{\left \left(\frac\left\{p\right\}\left\{p - \varepsilon\right\}\right \right)\right\}^\left\{p-\varepsilon\right\} \left\{\left \left(\frac\left\{1 - p\right\}\left\{1 -p + \varepsilon\right\}\right \right)\right\}^\left\{1 - p+ \varepsilon\right\}\right \right) ^m = e^\left\{ - D\left(p-\varepsilon\|p\right) m\right\},$

where

$D\left(x\|y\right) = x \log \frac\left\{x\right\}\left\{y\right\} + \left(1-x\right) \log \left \left(\frac\left\{1-x\right\}\left\{1-y\right\} \right \right)$

is the Kullback-Leibler divergence between Bernoulli distributed random variables with parameters x and y respectively. If $p\geq 1/2$, then

$\mathbf\left\{P\right\}\left \left( X>mp+x \right \right) \leq \exp \left \left(-\frac\left\{x^2\right\}\left\{2mp\left(1-p\right)\right\} \right \right) .$

#### Proof

Let q = p + ε. Taking a = mq in (1), we obtain:

$\mathbf\left\{P\right\}\left \left( \frac\left\{1\right\}\left\{m\right\} \sum X_i \ge q\right \right)\le \inf_\left\{t>0\right\} \frac\left\{E \left\left[\prod e^\left\{t X_i\right\}\right\right]\right\}\left\{e^\left\{tmq\right\}\right\} = \inf_\left\{t>0\right\} \left\left[\frac\left\{ E\left\left[e^\left\{tX_i\right\} \right\right] \right\}\left\{e^\left\{tq\right\}\right\}\right\right]^m.$

Now, knowing that $\mathbf\left\{P\right\}\left[X_i = 1\right] = p, \mathbf\left\{P\right\}\left[X_i = 0\right] = \left(1-p\right)$, we have

$\left\left[\frac\left\{ \mathbf\left\{E\right\}\left\left[e^\left\{tX_i\right\} \right\right] \right\}\left\{e^\left\{tq\right\}\right\}\right\right]^m = \left\left[\frac\left\{p e^t + \left(1-p\right)\right\}\left\{e^\left\{tq\right\} \right\}\right\right]^m = \left[pe^\left\{\left(1-q\right)t\right\} + \left(1-p\right)e^\left\{-qt\right\}\right]^m.$

Therefore we can easily compute the infimum, using calculus:

$\frac\left\{d\right\}\left\{dt\right\} \left(pe^\left\{\left(1-q\right)t\right\} + \left(1-p\right)e^\left\{-qt\right\}\right) = \left(1-q\right)pe^\left\{\left(1-q\right)t\right\}-q\left(1-p\right)e^\left\{-qt\right\}$

Setting the equation to zero and solving, we have

\begin\left\{align\right\}

(1-q)pe^{(1-q)t} &= q(1-p)e^{-qt} \\ (1-q)pe^{t} &= q(1-p) \end{align} so that

$e^t = \frac\left\{\left(1-p\right)q\right\}\left\{\left(1-q\right)p\right\}.$

Thus,

$t = \log\left\left(\frac\left\{\left(1-p\right)q\right\}\left\{\left(1-q\right)p\right\}\right\right).$

As q = p + ε > p, we see that t > 0, so our bound is satisfied on t. Having solved for t, we can plug back into the equations above to find that

\begin\left\{align\right\}

\log \left (pe^{(1-q)t} + (1-p)e^{-qt} \right ) &= \log \left ( e^{-qt}(1-p+pe^t) \right ) \\ &= \log\left[e^{-q \log\left(\frac{(1-p)q}{(1-q)p}\right)}\right] + \log\left[1-p+pe^{\log\left(\frac{1-p}{1-q}\right)}e^{\log\frac{q}{p}}\right] \\ &= -q\log\frac{1-p}{1-q} -q \log\frac{q}{p} + \log\left[1-p+ p\left(\frac{1-p}{1-q}\right)\frac{q}{p}\right] \\ &= -q\log\frac{1-p}{1-q} -q \log\frac{q}{p} + \log\left[\frac{(1-p)(1-q)}{1-q}+\frac{(1-p)q}{1-q}\right] \\ &= -q\log\frac{q}{p} + (1-q)\log\frac{1-p}{1-q} = -D(q \| p). \end{align}

We now have our desired result, that

$\mathbf\left\{P\right\} \left \left(\frac\left\{1\right\}\left\{m\right\}\sum X_i \ge p + \varepsilon\right \right) \le e^\left\{-D\left(p+\varepsilon\|p\right) m\right\}.$

To complete the proof for the symmetric case, we simply define the random variable Yi = 1−Xi, apply the same proof, and plug it into our bound.

#### Simpler bounds

A simpler bound follows by relaxing the theorem using $D\left( p + x \| p\right) \geq 2 x^2$, which follows from the convexity of $D\left(p+x\| p\right)$ and the fact that

$\frac\left\{d^2\right\}\left\{dx^2\right\} D\left(p+x\|p\right) = \frac\left\{1\right\}\left\{\left(p+x\right)\left(1-p-x\right)\right\}\geq 4=\frac\left\{d^2\right\}\left\{dx^2\right\}\left(2x^2\right).$

This result is a special case of Hoeffding's inequality. Sometimes, the bound $D\left( \left(1+x\right) p \| p\right) \geq x^2 p/4$ for $-1/2 \leq x \leq 1/2$, which is stronger for p < 1/8, is also used.

### Theorem for multiplicative form of Chernoff bound (relative error)

Let random variables $X_1, \ldots, X_n$ be independent random variables taking on values 0 or 1. Further, assume that $\mathbf\left\{P\right\}\left(X_i = 1\right) = p_i$. Then, if we let $X = \sum_\left\{i=1\right\}^n X_i$ and μ be the expectation of X, for any δ > 0

$\mathbf\left\{P\right\} \left( X > \left(1+\delta\right)\mu\right) < \left\left(\frac\left\{e^\delta\right\}\left\{\left(1+\delta\right)^\left\{\left(1+\delta\right)\right\}\right\}\right\right)^\mu.$

#### Proof

According to (1),

\begin\left\{align\right\}

\mathbf{P} (X > (1 + \delta)\mu) & \le \inf_{t > 0} \frac{\mathbf{E}\left[\prod_{i=1}^n\exp(tX_i)\right]}{\exp(t(1+\delta)\mu)} ) \\ & = \inf_{t > 0} \frac{\prod_{i=1}^n\mathbf{E}[\exp(tX_i)]}{\exp(t(1+\delta)\mu)} \\ & = \inf_{t > 0} \frac{\prod_{i=1}^n\left[p_i\exp(t) + (1-p_i)\right]}{\exp(t(1+\delta)\mu)} \end{align} The third line above follows because $e^\left\{tX_i\right\}$ takes the value $e^t$ with probability pi and the value 1 with probability $1-p_i$. This is identical to the calculation above in the proof of the Theorem for additive form (absolute error).

Rewriting $p_ie^t + \left(1-p_i\right)$ as $p_i\left(e^t-1\right) + 1$ and recalling that $1+x \le e^x$ (with strict inequality if x > 0), we set $x = p_i\left(e^t-1\right)$. The same result can be obtained by directly replacing a in the equation for the Chernoff bound with (1 + δ)μ.

Thus,

$\mathbf\left\{P\right\}\left(X > \left(1+\delta\right)\mu\right) < \frac\left\{\prod_\left\{i=1\right\}^n\exp\left(p_i\left(e^t-1\right)\right)\right\}\left\{\exp\left(t\left(1+\delta\right)\mu\right)\right\} = \frac\left\{\exp\left\left(\left(e^t-1\right)\sum_\left\{i=1\right\}^n p_i\right\right)\right\}\left\{\exp\left(t\left(1+\delta\right)\mu\right)\right\} = \frac\left\{\exp\left(\left(e^t-1\right)\mu\right)\right\}\left\{\exp\left(t\left(1+\delta\right)\mu\right)\right\}.$

If we simply set t = log(1+δ) so that t > 0 for δ > 0, we can substitute and find

$\frac\left\{\exp\left(\left(e^t-1\right)\mu\right)\right\}\left\{\exp\left(t\left(1+\delta\right)\mu\right)\right\} = \frac\left\{\exp\left(\left(1+\delta - 1\right)\mu\right)\right\}\left\{\left(1+\delta\right)^\left\{\left(1+\delta\right)\mu\right\}\right\} = \left\left[\frac\left\{\exp\left(\delta\right)\right\}\left\{\left(1+\delta\right)^\left\{\left(1+\delta\right)\right\}\right\}\right\right]^\mu$

This proves the result desired. A similar proof strategy can be used to show that

$\mathbf\left\{P\right\}\left(X < \left(1-\delta\right)\mu\right) < \left\left[\frac\left\{\exp\left(-\delta\right)\right\}\left\{\left(1-\delta\right)^\left\{\left(1-\delta\right)\right\}\right\}\right\right]^\mu.$

Using Chernoff bound, we can prove some simpler result:

$\mathbf\left\{P\right\}\left( X \ge \left(1+\delta\right)\mu\right) \le e^\left\{-\frac\left\{\delta^2\mu\right\}\left\{3\right\}\right\}, \quad 0 < \delta < 1$,
$\mathbf\left\{P\right\}\left( X \le \left(1-\delta\right)\mu\right) \le e^\left\{-\frac\left\{\delta^2\mu\right\}\left\{2\right\}\right\}, \quad 0 < \delta < 1$.

### Better Chernoff bounds for some special cases

We can obtain stronger bounds using simpler proof techniques for some special cases of symmetric random variables.

Let $X_1, X_2, ..., X_n$ be independent random variables,

$X = \sum_\left\{i=1\right\}^n X_i$.

(a) $\mathbf\left\{P\right\}\left(X_i = 1\right) = \mathbf\left\{P\right\}\left(X_i = -1\right) = \tfrac\left\{1\right\}\left\{2\right\}$.

Then,

$\mathbf\left\{P\right\}\left( X \ge a\right) \le e^\left\{\frac\left\{-a^2\right\}\left\{2n\right\}\right\}, \qquad a > 0$,

and therefore also

$\mathbf\left\{P\right\}\left( |X| \ge a\right) \le 2e^\left\{\frac\left\{-a^2\right\}\left\{2n\right\}\right\}, \qquad a > 0$ .

(b) $\mathbf\left\{P\right\}\left(X_i = 1\right) = \mathbf\left\{P\right\}\left(X_i = 0\right) = \tfrac\left\{1\right\}\left\{2\right\}, \mathbf\left\{E\right\}\left[X\right] = \mu = \frac\left\{n\right\}\left\{2\right\}$

Then,

$\mathbf\left\{P\right\}\left( X \ge \mu+a\right) \le e^\left\{\frac\left\{-2a^2\right\}\left\{n\right\}\right\}, \qquad a > 0$,
$\mathbf\left\{P\right\}\left( X \le \mu-a\right) \le e^\left\{\frac\left\{-2a^2\right\}\left\{n\right\}\right\}, \qquad 0 < a < \mu$,

## Applications of Chernoff bound

Chernoff bounds have very useful applications in set balancing and packet routing in sparse networks.

The set balancing problem arises while designing statistical experiments. Typically while designing a statistical experiment, given the features of each participant in the experiment, we need to know how to divide the participants into 2 disjoint groups such that each feature is roughly as balanced as possible between the two groups. Refer to this book section for more info on the problem.

Chernoff bounds are also used to obtain tight bounds for permutation routing problems which reduce book section for a thorough treatment of the problem.

## Matrix Chernoff bound

Main article: Matrix Chernoff bound

Rudolf Ahlswede and Andreas Winter introduced (Ahlswede & Winter 2003) a Chernoff bound for matrix-valued random variables.

If M is distributed according to some distribution over d × d matrices with zero mean, and if $M_1,M_2,\ldots,M_t$ are independent copies of M then for any ε > 0,

$\mathbf\left\{P\right\} \left\left( \bigg\Vert \frac\left\{1\right\}\left\{t\right\} \sum_\left\{i=1\right\}^t M_i - \mathbf\left\{E\right\}\left[M\right] \bigg\Vert_2 > \varepsilon \right\right) \leq d \exp \left\left( -C \frac\left\{\varepsilon^2 t\right\}\left\{\gamma^2\right\} \right\right).$

where $\lVert M \rVert_2 \leq \gamma$ holds almost surely and C > 0 is an absolute constant.

Notice that the number of samples in the inequality depends logarithmically on d. In general, unfortunately, such a dependency is inevitable: take for example a diagonal random sign matrix of dimension d. The operator norm of the sum of t independent samples is precisely the maximum deviation among d independent random walks of length t. In order to achieve a fixed bound on the maximum deviation with constant probability, it is easy to see that t should grow logarithmically with d in this scenario.

The following theorem can be obtained by assuming M has low rank, in order to avoid the dependency on the dimensions.

### Theorem without the dependency on the dimensions

Let 0 < ε < 1 and M be a random symmetric real matrix with $\Vert \mathbf\left\{E\right\}\left[M\right] \Vert_2 \leq 1$ and $\Vert M \Vert_2 \leq \gamma$ almost surely. Assume that each element on the support of M has at most rank r. Set

$t = \Omega \left\left( \frac\left\{\gamma\log \left(\gamma/\varepsilon^2\right)\right\}\left\{\varepsilon^2\right\} \right\right).$

If $r \leq t$ holds almost surely, then

$\mathbf\left\{P\right\} \left\left( \bigg\Vert \frac\left\{1\right\}\left\{t\right\} \sum_\left\{i=1\right\}^t M_i - \mathbf\left\{E\right\}\left[M\right] \bigg\Vert_2 > \varepsilon \right\right) \leq \frac\left\{1\right\}\left\{\mathbf\left\{poly\right\}\left(t\right)\right\}$

where $M_1,M_2,\ldots,M_t$ are i.i.d. copies of M.