taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.2.10-21

Exercise 1.2.10-21

not stated yet in Lean solution written

RatingHM21
MarkersHM (needs higher mathematics)
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.10 of Volume 1. Companion chapter: Analysis of an algorithm

The task

Prove Pr⁡(X≥n(p+ϵ))≤e−ϵ2n/(2q)\Pr(X\ge n(p+\epsilon))\le e^{-\epsilon^2n/(2q)} for the number XX of heads in nn tosses, and give a similar bound for the lower tail.

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

Prove the tail inequality (25) first: compare each term pkp_k, k≥rk\ge r, with pkxk−rp_kx^{k-r}.

Hint 2

Choose xx that minimizes the right side of (25), and expand the logarithm.

Solution

Show the solution

Tail inequality (25). For x≥1x\ge1 and k≥rk\ge r we have xk−r≥1x^{k-r}\ge1. So Pr⁡(X≥r)=∑k≥rpk≤∑k≥rpkxk−r≤x−r∑kpkxk=x−rG(x)\Pr(X\ge r)=\sum_{k\ge r}p_k\le\sum_{k\ge r}p_kx^{k-r}\le x^{-r}\sum_kp_kx^k=x^{-r}G(x).

Now let 0≤ϵ<q0\le\epsilon<q (if ϵ>q\epsilon>q the event is empty, since X≤nX\le n, and for ϵ=q\epsilon=q the probability is pn≤e−qnp^n\le e^{-qn}). Use (25) with r=n(p+ϵ)r=n(p+\epsilon), G=(q+px)nG=(q+px)^n:

Pr⁡(X≥n(p+ϵ))≤(q+pxxp+ϵ)n.\Pr(X\ge n(p+\epsilon))\le\Bigl(\frac{q+px}{x^{p+\epsilon}}\Bigr)^n.

The base is smallest at x=(p+ϵ)qp(q−ϵ) (≥1)x=\frac{(p+\epsilon)q}{p(q-\epsilon)}\ (\ge1). Then q+px=qq−ϵq+px=\frac q{q-\epsilon}, and the base becomes

B=(pp+ϵ)p+ϵ(qq−ϵ)q−ϵ,B=\Bigl(\frac p{p+\epsilon}\Bigr)^{p+\epsilon}\Bigl(\frac q{q-\epsilon}\Bigr)^{q-\epsilon},

using 1−(p+ϵ)=q−ϵ1-(p+\epsilon)=q-\epsilon. We bound the two factors.

First factor. For s=p+ϵp≥1s=\frac{p+\epsilon}p\ge1, ln⁡s≥1−1s\ln s\ge1-\frac1s, so (p+ϵ)ln⁡s≥(p+ϵ)−p=ϵ(p+\epsilon)\ln s\ge(p+\epsilon)-p=\epsilon. Hence (pp+ϵ)p+ϵ≤e−ϵ\bigl(\frac p{p+\epsilon}\bigr)^{p+\epsilon}\le e^{-\epsilon}.

Second factor. Put u=ϵ/q∈[0,1)u=\epsilon/q\in[0,1). Then −(q−ϵ)ln⁡(1−u)=q(1−u)∑j≥1ujj=q(u−∑j≥2ujj(j−1))≤q(u−u22)=ϵ−ϵ22q-(q-\epsilon)\ln(1-u)=q(1-u)\sum_{j\ge1}\frac{u^j}j=q\Bigl(u-\sum_{j\ge2}\frac{u^j}{j(j-1)}\Bigr)\le q\Bigl(u-\frac{u^2}2\Bigr)=\epsilon-\frac{\epsilon^2}{2q}. Hence (qq−ϵ)q−ϵ≤eϵ−ϵ2/(2q)\bigl(\frac q{q-\epsilon}\bigr)^{q-\epsilon}\le e^{\epsilon-\epsilon^2/(2q)}.

So B≤e−ϵ2/(2q)B\le e^{-\epsilon^2/(2q)}, and Pr⁡(X≥n(p+ϵ))≤e−ϵ2n/(2q)\Pr(X\ge n(p+\epsilon))\le e^{-\epsilon^2n/(2q)}.

Lower tail. Heads and tails exchange their roles, so n−Xn-X is the number of tails, with probability qq for one tail. Then Pr⁡(X≤n(p−ϵ))=Pr⁡(n−X≥n(q+ϵ))≤e−ϵ2n/(2p)\Pr(X\le n(p-\epsilon))=\Pr(n-X\ge n(q+\epsilon))\le e^{-\epsilon^2n/(2p)}, by the first part with pp and qq exchanged.

Check

Take n=100n=100, p=q=12p=q=\frac12, ϵ=0.2\epsilon=0.2. The bound is e−0.04⋅100/1=e−4=0.0183e^{-0.04\cdot100/1}=e^{-4}=0.0183, and the exact value of Pr⁡(X≥70)\Pr(X\ge70) is 0.00003930.0000393, consistent with the bound.

Remarks

The better bounds exp⁡(−ϵ2n/(2pq))\exp(-\epsilon^2n/(2pq)) for p≥12p\ge\frac12 and exp⁡(−2ϵ2n)\exp(-2\epsilon^2n) hold for all pp. They need a sharper estimate of the base BB.

This solution is drafted, and a person has not reviewed it yet. The source.

In Lean

not stated yet The exercise is not stated in Lean yet.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.