One of two independent flip sequences reaches two heads simultaneously. What is the distribution of others tosses.

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











up vote
4
down vote

favorite












Two people start flipping fair coins. We wait for one of them to reach two heads in a row. When that happens, we look at the last two tosses of the other guy. The other guy might have HH, HT, TH and TT. Naively, we might think all of these four are equally likely. However, that would mean there is a 25% chance the two sequences would reach two heads simultaneously. Now that seems high and as a matter of fact is. If you look at the code here (method named get_loser_state_prob at the very end) -



https://github.com/ryu577/stochproc/blob/master/stochproc/competitivecointoss/simulation.py



you will see the distribution actually looks like this -



HH: 0.12
HT: 0.24
TH: 0.32
TT: 0.32



It's completely unintuitive to me why HT and TH should have different probabilities and the distribution in general is something I can't wrap my mind around. Can someone explain why we should expect -



1) HH should be the lowest



2) HT should be lower than TH



3) HT and TT should be roughly the same (since it's simulation, can't tell if they are exactly the same but certainly very close).










share|cite|improve this question

























    up vote
    4
    down vote

    favorite












    Two people start flipping fair coins. We wait for one of them to reach two heads in a row. When that happens, we look at the last two tosses of the other guy. The other guy might have HH, HT, TH and TT. Naively, we might think all of these four are equally likely. However, that would mean there is a 25% chance the two sequences would reach two heads simultaneously. Now that seems high and as a matter of fact is. If you look at the code here (method named get_loser_state_prob at the very end) -



    https://github.com/ryu577/stochproc/blob/master/stochproc/competitivecointoss/simulation.py



    you will see the distribution actually looks like this -



    HH: 0.12
    HT: 0.24
    TH: 0.32
    TT: 0.32



    It's completely unintuitive to me why HT and TH should have different probabilities and the distribution in general is something I can't wrap my mind around. Can someone explain why we should expect -



    1) HH should be the lowest



    2) HT should be lower than TH



    3) HT and TT should be roughly the same (since it's simulation, can't tell if they are exactly the same but certainly very close).










    share|cite|improve this question























      up vote
      4
      down vote

      favorite









      up vote
      4
      down vote

      favorite











      Two people start flipping fair coins. We wait for one of them to reach two heads in a row. When that happens, we look at the last two tosses of the other guy. The other guy might have HH, HT, TH and TT. Naively, we might think all of these four are equally likely. However, that would mean there is a 25% chance the two sequences would reach two heads simultaneously. Now that seems high and as a matter of fact is. If you look at the code here (method named get_loser_state_prob at the very end) -



      https://github.com/ryu577/stochproc/blob/master/stochproc/competitivecointoss/simulation.py



      you will see the distribution actually looks like this -



      HH: 0.12
      HT: 0.24
      TH: 0.32
      TT: 0.32



      It's completely unintuitive to me why HT and TH should have different probabilities and the distribution in general is something I can't wrap my mind around. Can someone explain why we should expect -



      1) HH should be the lowest



      2) HT should be lower than TH



      3) HT and TT should be roughly the same (since it's simulation, can't tell if they are exactly the same but certainly very close).










      share|cite|improve this question













      Two people start flipping fair coins. We wait for one of them to reach two heads in a row. When that happens, we look at the last two tosses of the other guy. The other guy might have HH, HT, TH and TT. Naively, we might think all of these four are equally likely. However, that would mean there is a 25% chance the two sequences would reach two heads simultaneously. Now that seems high and as a matter of fact is. If you look at the code here (method named get_loser_state_prob at the very end) -



      https://github.com/ryu577/stochproc/blob/master/stochproc/competitivecointoss/simulation.py



      you will see the distribution actually looks like this -



      HH: 0.12
      HT: 0.24
      TH: 0.32
      TT: 0.32



      It's completely unintuitive to me why HT and TH should have different probabilities and the distribution in general is something I can't wrap my mind around. Can someone explain why we should expect -



      1) HH should be the lowest



      2) HT should be lower than TH



      3) HT and TT should be roughly the same (since it's simulation, can't tell if they are exactly the same but certainly very close).







      probability probability-theory






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked 4 hours ago









      Rohit Pandey

      851818




      851818




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          3
          down vote













          So I actually double checked this because it seemed strange to me as well, but it is indeed true.



           result <- c()

          for(iter in 1:10000)
          temp <- TRUE
          x1 <- rep(0,2)
          x2 <- rep(0,2)
          while(temp)
          x1[2] <- x1[1]; x2[2] <- x2[1]
          x1[1] <- rbinom(1,1,0.5); x2[1] <- rbinom(1,1,0.5)

          if(sum(x1)==2)
          result <- c(result,sum(x2))
          temp <- FALSE
          else if(sum(x2)==2)
          result <- c(result,sum(x1))
          temp <- FALSE




          > sum(result==2)/length(result)
          [1] 0.1164 ## Probs of HH
          > sum(result==1)/length(result)
          [1] 0.565 ## Probs of HT or TH
          > sum(result==0)/length(result)
          [1] 0.3186 ## Probs of TT


          I think the basic reason for the asymmetry is because the fact the game ends on this round (as opposed to the previous round) means that both players had gotten at least one tails in the previous two rounds prior to the final round (otherwise the game would have ended the previous round).



          This means that each player has a higher probability of getting two tails in the final round, since his last two throws prior to the final round must be one of $HT, TH, TT$ and cannot be $HH$.



          Let $X$ be the last two throws of the loser before the final round, $Y$ be his final throw, and $Z$ his last two throws after the final round.



          Then



          $P(Z = HH) = P(X = TH, Y=H)$



          Since no other combination gives him two heads at the end. But now consider the probability his last two throws are tails



          $P(Z = TT) = P(X=TT, Y=T) + P(X = HT,Y=T)$



          Similarly



          $P(Z = HT) = P(X=TH, Y=T)$



          $P(Z = TH) = P(X=HT, Y=H) + P(X=TT,Y=H)$



          Hence there's a clear asymmetry between the probabilities of the final throw caused by the fact he must have at least one tails prior to the final throw.



          Notice how the simulation show $P(TH) > P(HT)$, and the above has two summands for $TH$ but only one for $HT$!






          share|cite|improve this answer








          New contributor




          Xiaomi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.
























            up vote
            1
            down vote













            In this answer a way to find the probabilities.



            Let $p$ denote the probability at start position, let $q$ denote the probability under condition that in the first round a tail and a head are thrown and let $r$ denote the probability under condition that in the first round two heads are thrown.



            If it concerns the probability on HH then:



            • $p=frac14p+frac12q+frac14r$

            • $q=frac14p+frac14q$

            • $r=frac14+frac14p$

            Solving this we find $p_HH=p=0.12$.




            If it concerns the probability on TH then:



            • $p=frac14p+frac12q+frac14r$

            • $q=frac14+frac14p+frac14q$

            • $r=frac14p$

            Solving this we find $p_TH=p=0.32$.




            If it concerns the probability on HT then:



            • $p=frac14p+frac12q+frac14r$

            • $q=frac14p+frac14q$

            • $r=frac12+frac14p$

            Solving this we find $p_HT=p=0.24$.




            If it concerns the probability on TT then:



            • $p=frac14p+frac12q+frac14r$

            • $q=frac14+frac14p+frac14q$

            • $r=frac14p$

            Solving this we find $p_TT=p=0.32$.






            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%2f2937672%2fone-of-two-independent-flip-sequences-reaches-two-heads-simultaneously-what-is%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
              3
              down vote













              So I actually double checked this because it seemed strange to me as well, but it is indeed true.



               result <- c()

              for(iter in 1:10000)
              temp <- TRUE
              x1 <- rep(0,2)
              x2 <- rep(0,2)
              while(temp)
              x1[2] <- x1[1]; x2[2] <- x2[1]
              x1[1] <- rbinom(1,1,0.5); x2[1] <- rbinom(1,1,0.5)

              if(sum(x1)==2)
              result <- c(result,sum(x2))
              temp <- FALSE
              else if(sum(x2)==2)
              result <- c(result,sum(x1))
              temp <- FALSE




              > sum(result==2)/length(result)
              [1] 0.1164 ## Probs of HH
              > sum(result==1)/length(result)
              [1] 0.565 ## Probs of HT or TH
              > sum(result==0)/length(result)
              [1] 0.3186 ## Probs of TT


              I think the basic reason for the asymmetry is because the fact the game ends on this round (as opposed to the previous round) means that both players had gotten at least one tails in the previous two rounds prior to the final round (otherwise the game would have ended the previous round).



              This means that each player has a higher probability of getting two tails in the final round, since his last two throws prior to the final round must be one of $HT, TH, TT$ and cannot be $HH$.



              Let $X$ be the last two throws of the loser before the final round, $Y$ be his final throw, and $Z$ his last two throws after the final round.



              Then



              $P(Z = HH) = P(X = TH, Y=H)$



              Since no other combination gives him two heads at the end. But now consider the probability his last two throws are tails



              $P(Z = TT) = P(X=TT, Y=T) + P(X = HT,Y=T)$



              Similarly



              $P(Z = HT) = P(X=TH, Y=T)$



              $P(Z = TH) = P(X=HT, Y=H) + P(X=TT,Y=H)$



              Hence there's a clear asymmetry between the probabilities of the final throw caused by the fact he must have at least one tails prior to the final throw.



              Notice how the simulation show $P(TH) > P(HT)$, and the above has two summands for $TH$ but only one for $HT$!






              share|cite|improve this answer








              New contributor




              Xiaomi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.





















                up vote
                3
                down vote













                So I actually double checked this because it seemed strange to me as well, but it is indeed true.



                 result <- c()

                for(iter in 1:10000)
                temp <- TRUE
                x1 <- rep(0,2)
                x2 <- rep(0,2)
                while(temp)
                x1[2] <- x1[1]; x2[2] <- x2[1]
                x1[1] <- rbinom(1,1,0.5); x2[1] <- rbinom(1,1,0.5)

                if(sum(x1)==2)
                result <- c(result,sum(x2))
                temp <- FALSE
                else if(sum(x2)==2)
                result <- c(result,sum(x1))
                temp <- FALSE




                > sum(result==2)/length(result)
                [1] 0.1164 ## Probs of HH
                > sum(result==1)/length(result)
                [1] 0.565 ## Probs of HT or TH
                > sum(result==0)/length(result)
                [1] 0.3186 ## Probs of TT


                I think the basic reason for the asymmetry is because the fact the game ends on this round (as opposed to the previous round) means that both players had gotten at least one tails in the previous two rounds prior to the final round (otherwise the game would have ended the previous round).



                This means that each player has a higher probability of getting two tails in the final round, since his last two throws prior to the final round must be one of $HT, TH, TT$ and cannot be $HH$.



                Let $X$ be the last two throws of the loser before the final round, $Y$ be his final throw, and $Z$ his last two throws after the final round.



                Then



                $P(Z = HH) = P(X = TH, Y=H)$



                Since no other combination gives him two heads at the end. But now consider the probability his last two throws are tails



                $P(Z = TT) = P(X=TT, Y=T) + P(X = HT,Y=T)$



                Similarly



                $P(Z = HT) = P(X=TH, Y=T)$



                $P(Z = TH) = P(X=HT, Y=H) + P(X=TT,Y=H)$



                Hence there's a clear asymmetry between the probabilities of the final throw caused by the fact he must have at least one tails prior to the final throw.



                Notice how the simulation show $P(TH) > P(HT)$, and the above has two summands for $TH$ but only one for $HT$!






                share|cite|improve this answer








                New contributor




                Xiaomi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.



















                  up vote
                  3
                  down vote










                  up vote
                  3
                  down vote









                  So I actually double checked this because it seemed strange to me as well, but it is indeed true.



                   result <- c()

                  for(iter in 1:10000)
                  temp <- TRUE
                  x1 <- rep(0,2)
                  x2 <- rep(0,2)
                  while(temp)
                  x1[2] <- x1[1]; x2[2] <- x2[1]
                  x1[1] <- rbinom(1,1,0.5); x2[1] <- rbinom(1,1,0.5)

                  if(sum(x1)==2)
                  result <- c(result,sum(x2))
                  temp <- FALSE
                  else if(sum(x2)==2)
                  result <- c(result,sum(x1))
                  temp <- FALSE




                  > sum(result==2)/length(result)
                  [1] 0.1164 ## Probs of HH
                  > sum(result==1)/length(result)
                  [1] 0.565 ## Probs of HT or TH
                  > sum(result==0)/length(result)
                  [1] 0.3186 ## Probs of TT


                  I think the basic reason for the asymmetry is because the fact the game ends on this round (as opposed to the previous round) means that both players had gotten at least one tails in the previous two rounds prior to the final round (otherwise the game would have ended the previous round).



                  This means that each player has a higher probability of getting two tails in the final round, since his last two throws prior to the final round must be one of $HT, TH, TT$ and cannot be $HH$.



                  Let $X$ be the last two throws of the loser before the final round, $Y$ be his final throw, and $Z$ his last two throws after the final round.



                  Then



                  $P(Z = HH) = P(X = TH, Y=H)$



                  Since no other combination gives him two heads at the end. But now consider the probability his last two throws are tails



                  $P(Z = TT) = P(X=TT, Y=T) + P(X = HT,Y=T)$



                  Similarly



                  $P(Z = HT) = P(X=TH, Y=T)$



                  $P(Z = TH) = P(X=HT, Y=H) + P(X=TT,Y=H)$



                  Hence there's a clear asymmetry between the probabilities of the final throw caused by the fact he must have at least one tails prior to the final throw.



                  Notice how the simulation show $P(TH) > P(HT)$, and the above has two summands for $TH$ but only one for $HT$!






                  share|cite|improve this answer








                  New contributor




                  Xiaomi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  So I actually double checked this because it seemed strange to me as well, but it is indeed true.



                   result <- c()

                  for(iter in 1:10000)
                  temp <- TRUE
                  x1 <- rep(0,2)
                  x2 <- rep(0,2)
                  while(temp)
                  x1[2] <- x1[1]; x2[2] <- x2[1]
                  x1[1] <- rbinom(1,1,0.5); x2[1] <- rbinom(1,1,0.5)

                  if(sum(x1)==2)
                  result <- c(result,sum(x2))
                  temp <- FALSE
                  else if(sum(x2)==2)
                  result <- c(result,sum(x1))
                  temp <- FALSE




                  > sum(result==2)/length(result)
                  [1] 0.1164 ## Probs of HH
                  > sum(result==1)/length(result)
                  [1] 0.565 ## Probs of HT or TH
                  > sum(result==0)/length(result)
                  [1] 0.3186 ## Probs of TT


                  I think the basic reason for the asymmetry is because the fact the game ends on this round (as opposed to the previous round) means that both players had gotten at least one tails in the previous two rounds prior to the final round (otherwise the game would have ended the previous round).



                  This means that each player has a higher probability of getting two tails in the final round, since his last two throws prior to the final round must be one of $HT, TH, TT$ and cannot be $HH$.



                  Let $X$ be the last two throws of the loser before the final round, $Y$ be his final throw, and $Z$ his last two throws after the final round.



                  Then



                  $P(Z = HH) = P(X = TH, Y=H)$



                  Since no other combination gives him two heads at the end. But now consider the probability his last two throws are tails



                  $P(Z = TT) = P(X=TT, Y=T) + P(X = HT,Y=T)$



                  Similarly



                  $P(Z = HT) = P(X=TH, Y=T)$



                  $P(Z = TH) = P(X=HT, Y=H) + P(X=TT,Y=H)$



                  Hence there's a clear asymmetry between the probabilities of the final throw caused by the fact he must have at least one tails prior to the final throw.



                  Notice how the simulation show $P(TH) > P(HT)$, and the above has two summands for $TH$ but only one for $HT$!







                  share|cite|improve this answer








                  New contributor




                  Xiaomi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|cite|improve this answer



                  share|cite|improve this answer






                  New contributor




                  Xiaomi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 2 hours ago









                  Xiaomi

                  1555




                  1555




                  New contributor




                  Xiaomi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  Xiaomi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  Xiaomi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.




















                      up vote
                      1
                      down vote













                      In this answer a way to find the probabilities.



                      Let $p$ denote the probability at start position, let $q$ denote the probability under condition that in the first round a tail and a head are thrown and let $r$ denote the probability under condition that in the first round two heads are thrown.



                      If it concerns the probability on HH then:



                      • $p=frac14p+frac12q+frac14r$

                      • $q=frac14p+frac14q$

                      • $r=frac14+frac14p$

                      Solving this we find $p_HH=p=0.12$.




                      If it concerns the probability on TH then:



                      • $p=frac14p+frac12q+frac14r$

                      • $q=frac14+frac14p+frac14q$

                      • $r=frac14p$

                      Solving this we find $p_TH=p=0.32$.




                      If it concerns the probability on HT then:



                      • $p=frac14p+frac12q+frac14r$

                      • $q=frac14p+frac14q$

                      • $r=frac12+frac14p$

                      Solving this we find $p_HT=p=0.24$.




                      If it concerns the probability on TT then:



                      • $p=frac14p+frac12q+frac14r$

                      • $q=frac14+frac14p+frac14q$

                      • $r=frac14p$

                      Solving this we find $p_TT=p=0.32$.






                      share|cite|improve this answer
























                        up vote
                        1
                        down vote













                        In this answer a way to find the probabilities.



                        Let $p$ denote the probability at start position, let $q$ denote the probability under condition that in the first round a tail and a head are thrown and let $r$ denote the probability under condition that in the first round two heads are thrown.



                        If it concerns the probability on HH then:



                        • $p=frac14p+frac12q+frac14r$

                        • $q=frac14p+frac14q$

                        • $r=frac14+frac14p$

                        Solving this we find $p_HH=p=0.12$.




                        If it concerns the probability on TH then:



                        • $p=frac14p+frac12q+frac14r$

                        • $q=frac14+frac14p+frac14q$

                        • $r=frac14p$

                        Solving this we find $p_TH=p=0.32$.




                        If it concerns the probability on HT then:



                        • $p=frac14p+frac12q+frac14r$

                        • $q=frac14p+frac14q$

                        • $r=frac12+frac14p$

                        Solving this we find $p_HT=p=0.24$.




                        If it concerns the probability on TT then:



                        • $p=frac14p+frac12q+frac14r$

                        • $q=frac14+frac14p+frac14q$

                        • $r=frac14p$

                        Solving this we find $p_TT=p=0.32$.






                        share|cite|improve this answer






















                          up vote
                          1
                          down vote










                          up vote
                          1
                          down vote









                          In this answer a way to find the probabilities.



                          Let $p$ denote the probability at start position, let $q$ denote the probability under condition that in the first round a tail and a head are thrown and let $r$ denote the probability under condition that in the first round two heads are thrown.



                          If it concerns the probability on HH then:



                          • $p=frac14p+frac12q+frac14r$

                          • $q=frac14p+frac14q$

                          • $r=frac14+frac14p$

                          Solving this we find $p_HH=p=0.12$.




                          If it concerns the probability on TH then:



                          • $p=frac14p+frac12q+frac14r$

                          • $q=frac14+frac14p+frac14q$

                          • $r=frac14p$

                          Solving this we find $p_TH=p=0.32$.




                          If it concerns the probability on HT then:



                          • $p=frac14p+frac12q+frac14r$

                          • $q=frac14p+frac14q$

                          • $r=frac12+frac14p$

                          Solving this we find $p_HT=p=0.24$.




                          If it concerns the probability on TT then:



                          • $p=frac14p+frac12q+frac14r$

                          • $q=frac14+frac14p+frac14q$

                          • $r=frac14p$

                          Solving this we find $p_TT=p=0.32$.






                          share|cite|improve this answer












                          In this answer a way to find the probabilities.



                          Let $p$ denote the probability at start position, let $q$ denote the probability under condition that in the first round a tail and a head are thrown and let $r$ denote the probability under condition that in the first round two heads are thrown.



                          If it concerns the probability on HH then:



                          • $p=frac14p+frac12q+frac14r$

                          • $q=frac14p+frac14q$

                          • $r=frac14+frac14p$

                          Solving this we find $p_HH=p=0.12$.




                          If it concerns the probability on TH then:



                          • $p=frac14p+frac12q+frac14r$

                          • $q=frac14+frac14p+frac14q$

                          • $r=frac14p$

                          Solving this we find $p_TH=p=0.32$.




                          If it concerns the probability on HT then:



                          • $p=frac14p+frac12q+frac14r$

                          • $q=frac14p+frac14q$

                          • $r=frac12+frac14p$

                          Solving this we find $p_HT=p=0.24$.




                          If it concerns the probability on TT then:



                          • $p=frac14p+frac12q+frac14r$

                          • $q=frac14+frac14p+frac14q$

                          • $r=frac14p$

                          Solving this we find $p_TT=p=0.32$.







                          share|cite|improve this answer












                          share|cite|improve this answer



                          share|cite|improve this answer










                          answered 22 mins ago









                          drhab

                          89.8k541123




                          89.8k541123



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2937672%2fone-of-two-independent-flip-sequences-reaches-two-heads-simultaneously-what-is%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              What does second last employer means? [closed]

                              List of Gilmore Girls characters

                              Confectionery