{"id":12,"date":"2006-10-29T16:18:39","date_gmt":"2006-10-29T20:18:39","guid":{"rendered":"http:\/\/scripts.mit.edu\/~zong\/wpress\/?p=12"},"modified":"2008-01-12T21:20:07","modified_gmt":"2008-01-13T02:20:07","slug":"a-little-problem","status":"publish","type":"post","link":"https:\/\/blog.yhuang.org\/?p=12","title":{"rendered":"A little Markovian problem"},"content":{"rendered":"<p>Here it is:\u00a0<\/p>\n<blockquote><p>A has a fair coin and B has a fair coin. They flip coins together, but only keep track of their own sequences of heads and tails. A stops if the sequence &#8220;HHT&#8221; appears. B stops if the sequence &#8220;HTH&#8221; appears. Which player is more likely to stop first?<\/p><\/blockquote>\n<p><!--more--><\/p>\n<p>While it would first appear that any 3-flip sequence is equally likely and so neither A nor B is more likely to stop before the other, this is wrong. The eight 3-flip sequences are only equally likely when taken independently of the remaining sequence context. By context, I mean there is a time origin in this problem and there is memory from the stopping 3-flip sequence that leads all the way back to it.<\/p>\n<p>The answer is found if we draw the state diagram of the game for each player.<\/p>\n<p>Player A<br \/>\n<img decoding=\"async\" align=\"bottom\" alt=\"Input: digraph G {\ngraph [rankdir=LR]\n{0 H HH HHT [shape=doublecircle]}\n0 -&gt; H [label=H]\n0 -&gt; 0 [label=T]\nH -&gt; HH [label=H]\nH -&gt; 0 [label=T]\nHH -&gt; HH [label=H]\nHH -&gt; HHT [label=T]\n}\" src=\"https:\/\/blog.yhuang.org\/wp-content\/uploads\/images\/f151847dd4f5adb6d5a138ee4e318e12.png\" \/><\/p>\n<p>Player B<br \/>\n<img decoding=\"async\" align=\"bottom\" alt=\"Input: digraph G {\ngraph [rankdir=LR]\n{0 H HT HTH [shape=doublecircle]}\n0 -&gt; H [label=H]\n0 -&gt; 0 [label=T]\nH -&gt; H [label=H]\nH -&gt; HT [label=T]\nHT -&gt; HTH [label=H]\nHT -&gt; 0 [label=T]\n}\" src=\"https:\/\/blog.yhuang.org\/wp-content\/uploads\/images\/df43149372f6033610ee6b9ee0c87df5.png\" \/><\/p>\n<p>They are pretty much the same, except A&#8217;s diagram has a transition that backtracks by one state where the analogous transition on B&#8217;s diagram backtracks by two. So indeed, A is more likely to stop first.<\/p>\n<p>An interesting thing happens if we\u00a0let\u00a0A and B continue flipping even after they are supposed to stop. This changes the destination of one transition in each state diagram. Now the two diagrams look more similar.<\/p>\n<p>Player A<br \/>\n<img decoding=\"async\" align=\"bottom\" alt=\"Input: digraph G {\ngraph [rankdir=LR]\n{0 H HH}\n0 -&gt; H [label=H]\n0 -&gt; 0 [label=T]\nH -&gt; HH [label=H]\nH -&gt; 0 [label=T]\nHH -&gt; HH [label=H]\nHH -&gt; 0 [label=T color=blue]\n}\" src=\"https:\/\/blog.yhuang.org\/wp-content\/uploads\/images\/1f05e52fe69f93b1f3ca986f4916b9b8.png\" \/><\/p>\n<p>Player B<br \/>\n<img decoding=\"async\" align=\"bottom\" alt=\"Input: digraph G {\ngraph [rankdir=LR]\n{0 H HT}\n0 -&gt; H [label=H]\n0 -&gt; 0 [label=T]\nH -&gt; H [label=H]\nH -&gt; HT [label=T]\nHT -&gt; H [label=H color=blue]\nHT -&gt; 0 [label=T]\n}\" src=\"https:\/\/blog.yhuang.org\/wp-content\/uploads\/images\/2485278455bd040486cf9dd6cb8c2592.png\" \/><\/p>\n<p>In fact, they are equivalent (after a rotational shift of the states). So asymptotically, the sequence &#8220;HTH&#8221;\u00a0occurs just as frequently as &#8220;HHT&#8221;.<\/p>\n<p>If we look at this a little more carefully, we find that it takes on average 8 flips to see the first &#8220;HHT&#8221; while it takes an average of 10 flips to see the first &#8220;HTH&#8221;. After that, however, both subsequences occur at a rate of every 8 flips (overlapping frames allowed), which of course makes perfect sense, since there are 8 such 3-flip sequences.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here it is:\u00a0 A has a fair coin and B has a fair coin. They flip coins together, but only keep track of their own sequences of heads and tails. A stops if the sequence &#8220;HHT&#8221; appears. B stops if the sequence &#8220;HTH&#8221; appears. Which player is more likely to stop first?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1456,1393,938,1455,1454,875,1457,1453,1458,1459],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-backtracks","tag-coin","tag-digraph","tag-heads-and-tails","tag-hht","tag-player","tag-player-player","tag-sequence-context","tag-state","tag-transition"],"_links":{"self":[{"href":"https:\/\/blog.yhuang.org\/index.php?rest_route=\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.yhuang.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.yhuang.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.yhuang.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.yhuang.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12"}],"version-history":[{"count":0,"href":"https:\/\/blog.yhuang.org\/index.php?rest_route=\/wp\/v2\/posts\/12\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.yhuang.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.yhuang.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.yhuang.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}