{"id":1491,"date":"2010-10-08T09:45:07","date_gmt":"2010-10-08T15:45:07","guid":{"rendered":"http:\/\/hunch.net\/?p=1491"},"modified":"2010-10-08T09:45:07","modified_gmt":"2010-10-08T15:45:07","slug":"an-easy-proof-of-the-chernoff-hoeffding-bound","status":"publish","type":"post","link":"https:\/\/hunch.net\/?p=1491","title":{"rendered":"An easy proof of the Chernoff-Hoeffding bound"},"content":{"rendered":"<p>Textbooks invariably seem to carry the proof that uses Markov&#8217;s inequality, moment-generating functions, and Taylor approximations. Here&#8217;s an easier way.<\/p>\n<p>For $latex p,q \\in (0,1)$, let $latex K(p,q)$ be the KL divergence between a coin of bias $latex p$ and one of bias $latex q$: $latex K(p,q) = p \\ln \\frac{p}{q} + (1-p) \\ln \\frac{1-p}{1-q}.$<\/p>\n<p><strong>Theorem:<\/strong> Suppose you do $latex n$ independent tosses of a coin of bias $latex p$. The probability of seeing $latex qn$ heads or more, for $latex q &gt; p$, is at most $latex \\exp(-nK(q,p))$. So is the probability of seeing $latex qn$ heads or less, for $latex q &lt; p$.<\/p>\n<p><em>Remark:<\/em> By Pinsker&#8217;s inequality, $latex K(q,p) \\geq 2(p-q)^2$.<\/p>\n<p><strong>Proof<\/strong> Let&#8217;s do the $latex q &gt; p$ case; the other is identical.<\/p>\n<p>Let $latex \\theta_p$ be the distribution over $latex \\{0,1\\}^n$ induced by a coin of bias $latex p$, and likewise $latex \\theta_q$ for a coin of bias $latex q$. Let $latex S$ be the set of all sequences of $latex n$ tosses which contain $latex qn$ heads or more. We&#8217;d like to show that $latex S$ is unlikely under $latex \\theta_p$.<\/p>\n<p>Pick any $latex \\bar{x} \\in S$, with say $latex k \\geq qn$ heads. Then:<br \/>\n[latex size=&#8221;2&#8243;] \\frac{\\theta_q(\\bar{x})}{\\theta_p(\\bar{x})} = \\frac{q^k(1-q)^{n-k}}{p^k(1-p)^{n-k}} \\geq \\frac{q^{qn}(1-q)^{n-qn}}{p^{qn}(1-p)^{n-qn}} = \\left( \\frac{q}{p} \\right)^{qn} \\left( \\frac{1-q}{1-p}\\right)^{(1-q)n} = e^{n K(q,p)}.[\/latex]<\/p>\n<p>Since $latex \\theta_p(\\bar{x}) \\leq \\exp(-nK(q,p)) \\theta_q(\\bar{x})$ for every $latex \\bar{x} \\in S$, we have [latex]\\theta_p(S) \\leq \\exp(-nK(q,p)) \\theta_q(S) \\leq \\exp(-nK(q,p))[\/latex] and we&#8217;re done.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Textbooks invariably seem to carry the proof that uses Markov&#8217;s inequality, moment-generating functions, and Taylor approximations. Here&#8217;s an easier way. For $latex p,q \\in (0,1)$, let $latex K(p,q)$ be the KL divergence between a coin of bias $latex p$ and one of bias $latex q$: $latex K(p,q) = p \\ln \\frac{p}{q} + (1-p) \\ln \\frac{1-p}{1-q}.$ &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/hunch.net\/?p=1491\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;An easy proof of the Chernoff-Hoeffding bound&#8221;<\/span><\/a><\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-1491","post","type-post","status-publish","format-standard","hentry","category-machine-learning"],"_links":{"self":[{"href":"https:\/\/hunch.net\/index.php?rest_route=\/wp\/v2\/posts\/1491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hunch.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hunch.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hunch.net\/index.php?rest_route=\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/hunch.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1491"}],"version-history":[{"count":0,"href":"https:\/\/hunch.net\/index.php?rest_route=\/wp\/v2\/posts\/1491\/revisions"}],"wp:attachment":[{"href":"https:\/\/hunch.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hunch.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hunch.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}