COM­P4804: Al­go­rithms II
$\new­com­mand{\R}{\mathbb{R}}\De­clar­e­Math­Op­er­a­tor{\E}{\mathbf{E}}\De­clar­e­Math­Op­er­a­tor{\deg}{deg}$
Cher­noff's Bounds

Here are my orig­i­nal hand-writ­ten notes and more on this topic.

A Bernoulli($p$) ran­dom vari­able is a ran­dom vari­able that takes on a 1 with prob­a­bil­ity $p$ and a 0 with prob­a­bil­ity $1-p$.

If $X$ is Bernoulli($p$), then \[ \E[X] = p\cdot 1 + (1-p)0 = p \en­space . \] (These are named after Jacob Bernoulli, a math­e­mati­cian who lived in the 16-1700s.)

A bi­no­mial($p,n$) ran­dom vari­able is the sum of $n$ in­de­pen­dent Bernoulli($p$) ran­dom vari­ables. \[ B = X_1+X_2+\cdots + X_n \] If $B$ is a bi­no­mial$(p,n)$, then, \[ \E[B] = \E\left[\sum_{i=1}^n X_i\right] = \sum_{i=1}^n \E[X_i] = pn \en­space . \]

The Dis­tri­b­u­tion of Bi­no­mial Ran­dom vari­ables

A bi­no­mial ran­dom vari­able takes on val­ues in $\{0,\ldots,n\}$, but the dis­tri­b­u­tion is clearly not uni­form. In fact, \[ \Pr\{B=i\} = \binom{n}{i}p^i(1-p)^{n-i} \en­space , \] but this is kind of awk­ward to work with. (Try com­put­ing $\E[B]$ with­out using lin­ear­ity of ex­pec­ta­tion and you'll un­der­stand.)

Cher­noff's Bounds give us es­ti­mates on the prob­a­bil­ity that a bi­no­mial$(n,p)$ is far from its ex­pected value. For any $0 < \ep­silon < 1$, \[ \Pr\{B \ge (1+\ep­silon)pn\} \le e^{-\ep­silon^2pn/3} \en­space , \] and \[ \Pr\{B \le (1-\ep­silon)pn\} \le e^{-\ep­silon^2pn/2} \en­space . \] No­tice that these prob­a­bil­ity get ex­po­nen­tially small in $n$.

Ap­pli­ca­tion: Es­ti­mat­ing Sam­ple Sizes

Sup­pose we have $n$ el­e­ments and we sam­ple each el­e­ment in­d­pen­dently with prob­a­bilty $1/2$. If $B$ is the num­ber of sam­ples, then $B$ is a bi­no­mial$(1/2,n)$ ran­dom vari­able, so $\E[B] = n/2$.

It might be a prob­lem if we have too many sam­ples (maybe we don't have enough mem­ory). Cher­noff cov­ers this: \[ \Pr\{B \ge (1+\ep­silon) n/2\} \le e^{-\ep­silon^2 n/6} \]

It might be a prob­lem if we have too few sam­ples (maybe some cal­cu­la­tion will be in­cor­rect). Cher­noff cov­ers this too: \[ \Pr\{B \le (1-\ep­silon) n/2\} \le e^{-\ep­silon^2 n/4} \]

So the sam­ple size is very close to $n/2$ with prob­a­bil­ity very close to 1.

Ap­pli­ca­tion: Monte-Carlo In­te­gral Eval­u­a­tion

Sup­pose we have some weird func­tion $f(x)$. We know $1/2\le f(x)\le 1$ for all $x\in[0,1]$. We know how to eval­u­ate $f(x)$, but it's so weird we don't know how to in­te­grate it.

Eval­u­at­ing the in­te­gral $\int_0^1 f(x)\, dx$ is the same as ask­ing for the area under the curve de­fined by $f(x)$. Here's an al­go­rithm:

  1. $C\gets 0$
  2. Pick $(x,y)$ uni­formly at ran­dom in the unit square $[0,1]^2$.
  3. If $f(x) > y$ then add 1 to $C$
  4. Re­peat steps 1 and 2 $k=c\ln n$ times
  5. Out­put $C/k$

Ob­serve that $C$ is a bi­no­mial$(p,n)$ ran­dom vari­able where $p=\int_0^1 f(x)\, dx$ is ex­actly the value we are try­ing to com­pute. And, by as­sump­tion, $p>1/2$. So, by Cher­noff's bounds: \[ \Pr\{C \ge (1+\ep­silon)pk\} \le e^{-\ep­silon^2 pk/3} \le e^{-\ep­silon^2 c\ln n/6} = n^{-\ep­silon^2 c/6} \] and \[ \Pr\{C \le (1-\ep­silon)pk\} \le e^{-\ep­silon^2 pk/2} \le e^{-\ep­silon^2 c\ln n/4} = n^{-\ep­silon^2 c/4} \en­space . \]

Ap­pli­ca­tion: Ran­dom­ized Bi­nary Search