Probability of a sequence of coin tosses ending in $HHT$ (I win) or $THH$(You win)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I'm still learning undergraduate probability. I was asked this probability puzzle in a recent quantitative developer interview. I solved the first part of the question, using brute-force. I think, brute-force very quickly becomes unwieldy for the sequence ending $THH$ - not sure if my answer is correct.




A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?




Solution.



$beginaligned
P(xHHT)&=P(H^2T)+P(H^3T)+P(H^4T)+ldots \
&=frac12^3+frac12^4 + frac12^5 + ldots \
&=frac1/81-1/2\
&=frac14
endaligned$



For the second part, $P(xTHH)$, I have drawn a state-diagram, but there are just too many possible combinations for a sequence ending in $THH$. Is there an easier, or perhaps an intuitive way to look at this? Any hints in the right direction would be great!







share|cite|improve this question





















  • @DougM, rephrasing the question! It's any sequence ending in the suffix $HHT$ or $THH$.
    – Quasar
    Jul 25 at 18:46














up vote
1
down vote

favorite












I'm still learning undergraduate probability. I was asked this probability puzzle in a recent quantitative developer interview. I solved the first part of the question, using brute-force. I think, brute-force very quickly becomes unwieldy for the sequence ending $THH$ - not sure if my answer is correct.




A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?




Solution.



$beginaligned
P(xHHT)&=P(H^2T)+P(H^3T)+P(H^4T)+ldots \
&=frac12^3+frac12^4 + frac12^5 + ldots \
&=frac1/81-1/2\
&=frac14
endaligned$



For the second part, $P(xTHH)$, I have drawn a state-diagram, but there are just too many possible combinations for a sequence ending in $THH$. Is there an easier, or perhaps an intuitive way to look at this? Any hints in the right direction would be great!







share|cite|improve this question





















  • @DougM, rephrasing the question! It's any sequence ending in the suffix $HHT$ or $THH$.
    – Quasar
    Jul 25 at 18:46












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I'm still learning undergraduate probability. I was asked this probability puzzle in a recent quantitative developer interview. I solved the first part of the question, using brute-force. I think, brute-force very quickly becomes unwieldy for the sequence ending $THH$ - not sure if my answer is correct.




A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?




Solution.



$beginaligned
P(xHHT)&=P(H^2T)+P(H^3T)+P(H^4T)+ldots \
&=frac12^3+frac12^4 + frac12^5 + ldots \
&=frac1/81-1/2\
&=frac14
endaligned$



For the second part, $P(xTHH)$, I have drawn a state-diagram, but there are just too many possible combinations for a sequence ending in $THH$. Is there an easier, or perhaps an intuitive way to look at this? Any hints in the right direction would be great!







share|cite|improve this question













I'm still learning undergraduate probability. I was asked this probability puzzle in a recent quantitative developer interview. I solved the first part of the question, using brute-force. I think, brute-force very quickly becomes unwieldy for the sequence ending $THH$ - not sure if my answer is correct.




A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?




Solution.



$beginaligned
P(xHHT)&=P(H^2T)+P(H^3T)+P(H^4T)+ldots \
&=frac12^3+frac12^4 + frac12^5 + ldots \
&=frac1/81-1/2\
&=frac14
endaligned$



For the second part, $P(xTHH)$, I have drawn a state-diagram, but there are just too many possible combinations for a sequence ending in $THH$. Is there an easier, or perhaps an intuitive way to look at this? Any hints in the right direction would be great!









share|cite|improve this question












share|cite|improve this question




share|cite|improve this question








edited Jul 25 at 18:48
























asked Jul 25 at 18:32









Quasar

697412




697412











  • @DougM, rephrasing the question! It's any sequence ending in the suffix $HHT$ or $THH$.
    – Quasar
    Jul 25 at 18:46
















  • @DougM, rephrasing the question! It's any sequence ending in the suffix $HHT$ or $THH$.
    – Quasar
    Jul 25 at 18:46















@DougM, rephrasing the question! It's any sequence ending in the suffix $HHT$ or $THH$.
– Quasar
Jul 25 at 18:46




@DougM, rephrasing the question! It's any sequence ending in the suffix $HHT$ or $THH$.
– Quasar
Jul 25 at 18:46










2 Answers
2






active

oldest

votes

















up vote
4
down vote



accepted










Note: the only way you can possibly get $HHT$ before $THH$ is if the first two tosses are $HH$.



Pf: Suppose you get $HHT$ first. Then look at the first occurrence of $HHT$. Go back through the sequence. If you ever encounter a $T$, you must have $THH$ starting with the first $T$ you find. Thus, you can never find a $T$. In particular the first two tosses must both be $H$.



Conversely, if the first two tosses are $HH$ then $THH$ can not come first.



Thus the answer is clearly $frac 14$.






share|cite|improve this answer




























    up vote
    1
    down vote














    A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?




    Hint: if and only if the first two tosses are $HH$, player 1 wins. In all other cases player two wins.






    share|cite|improve this answer





















      Your Answer




      StackExchange.ifUsing("editor", function ()
      return StackExchange.using("mathjaxEditing", function ()
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
      );
      );
      , "mathjax-editing");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "69"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      noCode: true, onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );








       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2862698%2fprobability-of-a-sequence-of-coin-tosses-ending-in-hht-i-win-or-thhyou-wi%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      4
      down vote



      accepted










      Note: the only way you can possibly get $HHT$ before $THH$ is if the first two tosses are $HH$.



      Pf: Suppose you get $HHT$ first. Then look at the first occurrence of $HHT$. Go back through the sequence. If you ever encounter a $T$, you must have $THH$ starting with the first $T$ you find. Thus, you can never find a $T$. In particular the first two tosses must both be $H$.



      Conversely, if the first two tosses are $HH$ then $THH$ can not come first.



      Thus the answer is clearly $frac 14$.






      share|cite|improve this answer

























        up vote
        4
        down vote



        accepted










        Note: the only way you can possibly get $HHT$ before $THH$ is if the first two tosses are $HH$.



        Pf: Suppose you get $HHT$ first. Then look at the first occurrence of $HHT$. Go back through the sequence. If you ever encounter a $T$, you must have $THH$ starting with the first $T$ you find. Thus, you can never find a $T$. In particular the first two tosses must both be $H$.



        Conversely, if the first two tosses are $HH$ then $THH$ can not come first.



        Thus the answer is clearly $frac 14$.






        share|cite|improve this answer























          up vote
          4
          down vote



          accepted







          up vote
          4
          down vote



          accepted






          Note: the only way you can possibly get $HHT$ before $THH$ is if the first two tosses are $HH$.



          Pf: Suppose you get $HHT$ first. Then look at the first occurrence of $HHT$. Go back through the sequence. If you ever encounter a $T$, you must have $THH$ starting with the first $T$ you find. Thus, you can never find a $T$. In particular the first two tosses must both be $H$.



          Conversely, if the first two tosses are $HH$ then $THH$ can not come first.



          Thus the answer is clearly $frac 14$.






          share|cite|improve this answer













          Note: the only way you can possibly get $HHT$ before $THH$ is if the first two tosses are $HH$.



          Pf: Suppose you get $HHT$ first. Then look at the first occurrence of $HHT$. Go back through the sequence. If you ever encounter a $T$, you must have $THH$ starting with the first $T$ you find. Thus, you can never find a $T$. In particular the first two tosses must both be $H$.



          Conversely, if the first two tosses are $HH$ then $THH$ can not come first.



          Thus the answer is clearly $frac 14$.







          share|cite|improve this answer













          share|cite|improve this answer



          share|cite|improve this answer











          answered Jul 25 at 18:51









          lulu

          34.9k14071




          34.9k14071




















              up vote
              1
              down vote














              A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?




              Hint: if and only if the first two tosses are $HH$, player 1 wins. In all other cases player two wins.






              share|cite|improve this answer

























                up vote
                1
                down vote














                A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?




                Hint: if and only if the first two tosses are $HH$, player 1 wins. In all other cases player two wins.






                share|cite|improve this answer























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote










                  A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?




                  Hint: if and only if the first two tosses are $HH$, player 1 wins. In all other cases player two wins.






                  share|cite|improve this answer














                  A coin is flipped infinitely until you or I win. If at any point, the last three tosses in the sequence are $HHT$, I win. If at any point, the last three tosses in the sequence are $THH$, you win. Which sequence is more likely?




                  Hint: if and only if the first two tosses are $HH$, player 1 wins. In all other cases player two wins.







                  share|cite|improve this answer













                  share|cite|improve this answer



                  share|cite|improve this answer











                  answered Jul 25 at 18:57









                  orlp

                  6,6051228




                  6,6051228






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2862698%2fprobability-of-a-sequence-of-coin-tosses-ending-in-hht-i-win-or-thhyou-wi%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Comments

                      Popular posts from this blog

                      What is the equation of a 3D cone with generalised tilt?

                      Color the edges and diagonals of a regular polygon

                      Relationship between determinant of matrix and determinant of adjoint?