{"id":165,"date":"2013-12-07T14:47:33","date_gmt":"2013-12-07T14:47:33","guid":{"rendered":"http:\/\/davidgunter.com\/words\/?p=165"},"modified":"2014-02-06T12:31:20","modified_gmt":"2014-02-06T19:31:20","slug":"weve-been-flipping-coins-wrong","status":"publish","type":"post","link":"https:\/\/www.davidgunter.com\/es-mx\/2013\/12\/07\/weve-been-flipping-coins-wrong\/","title":{"rendered":"We&#8217;ve been flipping coins wrong"},"content":{"rendered":"<p>Actually, the title is a bit misleading. We have been using our coin flips incorrectly. A paper entitled, <em>Dynamical Bias In The Coin Toss<\/em> [<a href=\"http:\/\/statweb.stanford.edu\/~susan\/papers\/headswithJ.pdf\" target=\"_blank\">PDF<\/a>] came out in 2009 by a group from Stanford University and the University of California-Santa Cruz. The authors&#8217; main result was that a standard coin, when flipped and then caught by the flipping-hand, had a 51% chance of showing the same surface as the one showing before the toss. That is, there is a slightly greater chance that a coin showing heads at the start of the flip will show heads after the flip.<\/p>\n<p>Trying to get around this bias by spinning the coin on a flat surface doesn&#8217;t work either. The physics of a spinning disk cause it to eventually fall with the heavy side down. In the study, a spun coin turned up <em>tails<\/em> 80% of the time!<\/p>\n<p>What is needed is a fool-proof way to flip a coin and eliminate any bias. This was actually worked out in 1951* by the famous mathematician John von Neumann. He was dealing with trying to create random numbers in new digital computers. His procedure works with any coin including a trick or weighted coin. By way of example suppose you have a weighted coin that when flipped will show <em>heads<\/em> 80% of the time. If you want a fair result you simply flip the coin twice. If it comes up <em>heads<\/em> both times or if it comes up <em>tails<\/em> both times you throw away the result and flip twice more. If it comes up <em>heads-tails<\/em> you mark the result down as <em>heads<\/em>. If it comes up <em>tails-heads<\/em> then you mark the result down as tails. That&#8217;s it.<\/p>\n<p>Why does this work? It works because the probability for getting the result <em>heads then tails<\/em> is the same as the probability of getting the result <em>tails then heads<\/em> and that is all we ask for in a coin toss where we are interested in only two outcomes. Mathematically, we have<\/p>\n<p style=\"text-align: center;\">P(HT) = P(TH),<br \/>\nP(H) \u00d7 P(T) = P(T) \u00d7 P(H),<br \/>\n0.8 \u00d7 0.2 = 0.2 \u00d7 0.8 = <strong>0.16<\/strong>,<\/p>\n<p>where P(HT) is the probability of getting the result <em>heads then tails<\/em> which is simply a product of the probability of getting heads times the probability of getting tails, assuming the coin flips are all independent (they are).<\/p>\n<p>It&#8217;s important to note that this procedure will work for any coin, even one you may not trust or know in advance what its bias may be.<\/p>\n<p>*John von Neumann,<em>Various techniques used in connection with random digits<\/em>, Journal of Research of the National Bureau of Standards, Appl. Math. Series (1951), 3, 36-38<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Actually, the title is a bit misleading. We have been using our coin flips incorrectly. A paper entitled, Dynamical Bias In The Coin Toss [PDF] came out in 2009 by a group from Stanford&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":259,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[28,26,24,27,25],"class_list":["post-165","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-science","tag-betting","tag-chance","tag-coin-toss","tag-gambling","tag-probability"],"_links":{"self":[{"href":"https:\/\/www.davidgunter.com\/es-mx\/wp-json\/wp\/v2\/posts\/165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.davidgunter.com\/es-mx\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.davidgunter.com\/es-mx\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.davidgunter.com\/es-mx\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.davidgunter.com\/es-mx\/wp-json\/wp\/v2\/comments?post=165"}],"version-history":[{"count":9,"href":"https:\/\/www.davidgunter.com\/es-mx\/wp-json\/wp\/v2\/posts\/165\/revisions"}],"predecessor-version":[{"id":174,"href":"https:\/\/www.davidgunter.com\/es-mx\/wp-json\/wp\/v2\/posts\/165\/revisions\/174"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.davidgunter.com\/es-mx\/wp-json\/wp\/v2\/media\/259"}],"wp:attachment":[{"href":"https:\/\/www.davidgunter.com\/es-mx\/wp-json\/wp\/v2\/media?parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.davidgunter.com\/es-mx\/wp-json\/wp\/v2\/categories?post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.davidgunter.com\/es-mx\/wp-json\/wp\/v2\/tags?post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}