Game - First person to throw consecutive heads












0














Player A and Player B play are playing a game. Player A goes first, and tosses a coin. Player B then tosses his first coin. Player A then tosses his second and so on until the game ends. The first person to toss consecutive heads wins. What is the probability that Player A wins?



For those curious, this question was asked in a finance interview.










share|cite|improve this question






















  • What are your thoughts?
    – lulu
    Nov 18 at 14:15










  • Originally got the answer 4/7 through P(Win) = P(HH) + P(Not HH)P(Not HH)P(HH) and so on, and using sum of an infinite series. Then realised that the outcomes TT,HT and TH are not equivalent, as TH then needs just one more head to win.
    – Connolly Devin
    Nov 18 at 14:17






  • 2




    This sort of problem is hard to attack with geometric series, for the reason you point out. Best to do it with states. Label a state according to; whose turn it is, how many more Heads $A$ needs and how many more Heads $B$ needs. There aren't very many states. Then look at the transitions between them.
    – lulu
    Nov 18 at 14:19












  • I was looking at the Markov chain method (have some exposure to Stochastic modelling and the likes), but was hoping there may be a trick to it - especially given it was asked as 1 of 10 questions during a short interview.
    – Connolly Devin
    Nov 18 at 14:21










  • Having both conducted (and taken) lots of such interviews, it's often the case that the interviewer is really after a robust and reasoned analysis of the problem. Yes, carrying through the steps might take a while but typically the interviewer will stop you at the outline stage.
    – lulu
    Nov 18 at 14:36


















0














Player A and Player B play are playing a game. Player A goes first, and tosses a coin. Player B then tosses his first coin. Player A then tosses his second and so on until the game ends. The first person to toss consecutive heads wins. What is the probability that Player A wins?



For those curious, this question was asked in a finance interview.










share|cite|improve this question






















  • What are your thoughts?
    – lulu
    Nov 18 at 14:15










  • Originally got the answer 4/7 through P(Win) = P(HH) + P(Not HH)P(Not HH)P(HH) and so on, and using sum of an infinite series. Then realised that the outcomes TT,HT and TH are not equivalent, as TH then needs just one more head to win.
    – Connolly Devin
    Nov 18 at 14:17






  • 2




    This sort of problem is hard to attack with geometric series, for the reason you point out. Best to do it with states. Label a state according to; whose turn it is, how many more Heads $A$ needs and how many more Heads $B$ needs. There aren't very many states. Then look at the transitions between them.
    – lulu
    Nov 18 at 14:19












  • I was looking at the Markov chain method (have some exposure to Stochastic modelling and the likes), but was hoping there may be a trick to it - especially given it was asked as 1 of 10 questions during a short interview.
    – Connolly Devin
    Nov 18 at 14:21










  • Having both conducted (and taken) lots of such interviews, it's often the case that the interviewer is really after a robust and reasoned analysis of the problem. Yes, carrying through the steps might take a while but typically the interviewer will stop you at the outline stage.
    – lulu
    Nov 18 at 14:36
















0












0








0







Player A and Player B play are playing a game. Player A goes first, and tosses a coin. Player B then tosses his first coin. Player A then tosses his second and so on until the game ends. The first person to toss consecutive heads wins. What is the probability that Player A wins?



For those curious, this question was asked in a finance interview.










share|cite|improve this question













Player A and Player B play are playing a game. Player A goes first, and tosses a coin. Player B then tosses his first coin. Player A then tosses his second and so on until the game ends. The first person to toss consecutive heads wins. What is the probability that Player A wins?



For those curious, this question was asked in a finance interview.







probability






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Nov 18 at 14:12









Connolly Devin

1




1












  • What are your thoughts?
    – lulu
    Nov 18 at 14:15










  • Originally got the answer 4/7 through P(Win) = P(HH) + P(Not HH)P(Not HH)P(HH) and so on, and using sum of an infinite series. Then realised that the outcomes TT,HT and TH are not equivalent, as TH then needs just one more head to win.
    – Connolly Devin
    Nov 18 at 14:17






  • 2




    This sort of problem is hard to attack with geometric series, for the reason you point out. Best to do it with states. Label a state according to; whose turn it is, how many more Heads $A$ needs and how many more Heads $B$ needs. There aren't very many states. Then look at the transitions between them.
    – lulu
    Nov 18 at 14:19












  • I was looking at the Markov chain method (have some exposure to Stochastic modelling and the likes), but was hoping there may be a trick to it - especially given it was asked as 1 of 10 questions during a short interview.
    – Connolly Devin
    Nov 18 at 14:21










  • Having both conducted (and taken) lots of such interviews, it's often the case that the interviewer is really after a robust and reasoned analysis of the problem. Yes, carrying through the steps might take a while but typically the interviewer will stop you at the outline stage.
    – lulu
    Nov 18 at 14:36




















  • What are your thoughts?
    – lulu
    Nov 18 at 14:15










  • Originally got the answer 4/7 through P(Win) = P(HH) + P(Not HH)P(Not HH)P(HH) and so on, and using sum of an infinite series. Then realised that the outcomes TT,HT and TH are not equivalent, as TH then needs just one more head to win.
    – Connolly Devin
    Nov 18 at 14:17






  • 2




    This sort of problem is hard to attack with geometric series, for the reason you point out. Best to do it with states. Label a state according to; whose turn it is, how many more Heads $A$ needs and how many more Heads $B$ needs. There aren't very many states. Then look at the transitions between them.
    – lulu
    Nov 18 at 14:19












  • I was looking at the Markov chain method (have some exposure to Stochastic modelling and the likes), but was hoping there may be a trick to it - especially given it was asked as 1 of 10 questions during a short interview.
    – Connolly Devin
    Nov 18 at 14:21










  • Having both conducted (and taken) lots of such interviews, it's often the case that the interviewer is really after a robust and reasoned analysis of the problem. Yes, carrying through the steps might take a while but typically the interviewer will stop you at the outline stage.
    – lulu
    Nov 18 at 14:36


















What are your thoughts?
– lulu
Nov 18 at 14:15




What are your thoughts?
– lulu
Nov 18 at 14:15












Originally got the answer 4/7 through P(Win) = P(HH) + P(Not HH)P(Not HH)P(HH) and so on, and using sum of an infinite series. Then realised that the outcomes TT,HT and TH are not equivalent, as TH then needs just one more head to win.
– Connolly Devin
Nov 18 at 14:17




Originally got the answer 4/7 through P(Win) = P(HH) + P(Not HH)P(Not HH)P(HH) and so on, and using sum of an infinite series. Then realised that the outcomes TT,HT and TH are not equivalent, as TH then needs just one more head to win.
– Connolly Devin
Nov 18 at 14:17




2




2




This sort of problem is hard to attack with geometric series, for the reason you point out. Best to do it with states. Label a state according to; whose turn it is, how many more Heads $A$ needs and how many more Heads $B$ needs. There aren't very many states. Then look at the transitions between them.
– lulu
Nov 18 at 14:19






This sort of problem is hard to attack with geometric series, for the reason you point out. Best to do it with states. Label a state according to; whose turn it is, how many more Heads $A$ needs and how many more Heads $B$ needs. There aren't very many states. Then look at the transitions between them.
– lulu
Nov 18 at 14:19














I was looking at the Markov chain method (have some exposure to Stochastic modelling and the likes), but was hoping there may be a trick to it - especially given it was asked as 1 of 10 questions during a short interview.
– Connolly Devin
Nov 18 at 14:21




I was looking at the Markov chain method (have some exposure to Stochastic modelling and the likes), but was hoping there may be a trick to it - especially given it was asked as 1 of 10 questions during a short interview.
– Connolly Devin
Nov 18 at 14:21












Having both conducted (and taken) lots of such interviews, it's often the case that the interviewer is really after a robust and reasoned analysis of the problem. Yes, carrying through the steps might take a while but typically the interviewer will stop you at the outline stage.
– lulu
Nov 18 at 14:36






Having both conducted (and taken) lots of such interviews, it's often the case that the interviewer is really after a robust and reasoned analysis of the problem. Yes, carrying through the steps might take a while but typically the interviewer will stop you at the outline stage.
– lulu
Nov 18 at 14:36












2 Answers
2






active

oldest

votes


















2














Denote by ${tt pxy}$ the probability that $A$ finally wins when the game is in the following state:




  • person $Pin{A,B}$ is the next to throw his coin,


  • $A$ has $xin{0,1}$ useful heads on the stack,


  • $B$ has $yin{0,1}$ useful heads on the stack.


The problem is to determine ${tt a00}$.
There are $8$ nonterminal states, leading to a system of $8$ linear equations. I let Mathematica solve it. The answer is ${tt a00}={14over25}$. Here is the output:



enter image description here






share|cite|improve this answer































    0














    The other way to solve the problem albeit it is more calculation intensive.



    The pmf of obtaining two consecutive heads in k trials $$P_{N}(k) = frac{F_{k-1}}{2^k}$$ where $F_k$ is the Fibonacci Sequence.



    It is the same for both A and B to get two consecutive heads. Since A starts,



    Probability that A wins $$sum_{k=2}^{infty} frac{F_{k-1}}{2^k} left(1-sum_{i=1}^{k-1}frac{F_{i-1}}{2^{i}}right)$$



    Attached you will see the image where the calcuatlion is done and is in agreement with @Christian Blatter.



    enter image description here






    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',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      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%2f3003586%2fgame-first-person-to-throw-consecutive-heads%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      Denote by ${tt pxy}$ the probability that $A$ finally wins when the game is in the following state:




      • person $Pin{A,B}$ is the next to throw his coin,


      • $A$ has $xin{0,1}$ useful heads on the stack,


      • $B$ has $yin{0,1}$ useful heads on the stack.


      The problem is to determine ${tt a00}$.
      There are $8$ nonterminal states, leading to a system of $8$ linear equations. I let Mathematica solve it. The answer is ${tt a00}={14over25}$. Here is the output:



      enter image description here






      share|cite|improve this answer




























        2














        Denote by ${tt pxy}$ the probability that $A$ finally wins when the game is in the following state:




        • person $Pin{A,B}$ is the next to throw his coin,


        • $A$ has $xin{0,1}$ useful heads on the stack,


        • $B$ has $yin{0,1}$ useful heads on the stack.


        The problem is to determine ${tt a00}$.
        There are $8$ nonterminal states, leading to a system of $8$ linear equations. I let Mathematica solve it. The answer is ${tt a00}={14over25}$. Here is the output:



        enter image description here






        share|cite|improve this answer


























          2












          2








          2






          Denote by ${tt pxy}$ the probability that $A$ finally wins when the game is in the following state:




          • person $Pin{A,B}$ is the next to throw his coin,


          • $A$ has $xin{0,1}$ useful heads on the stack,


          • $B$ has $yin{0,1}$ useful heads on the stack.


          The problem is to determine ${tt a00}$.
          There are $8$ nonterminal states, leading to a system of $8$ linear equations. I let Mathematica solve it. The answer is ${tt a00}={14over25}$. Here is the output:



          enter image description here






          share|cite|improve this answer














          Denote by ${tt pxy}$ the probability that $A$ finally wins when the game is in the following state:




          • person $Pin{A,B}$ is the next to throw his coin,


          • $A$ has $xin{0,1}$ useful heads on the stack,


          • $B$ has $yin{0,1}$ useful heads on the stack.


          The problem is to determine ${tt a00}$.
          There are $8$ nonterminal states, leading to a system of $8$ linear equations. I let Mathematica solve it. The answer is ${tt a00}={14over25}$. Here is the output:



          enter image description here







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Nov 19 at 9:00

























          answered Nov 18 at 15:42









          Christian Blatter

          172k7112325




          172k7112325























              0














              The other way to solve the problem albeit it is more calculation intensive.



              The pmf of obtaining two consecutive heads in k trials $$P_{N}(k) = frac{F_{k-1}}{2^k}$$ where $F_k$ is the Fibonacci Sequence.



              It is the same for both A and B to get two consecutive heads. Since A starts,



              Probability that A wins $$sum_{k=2}^{infty} frac{F_{k-1}}{2^k} left(1-sum_{i=1}^{k-1}frac{F_{i-1}}{2^{i}}right)$$



              Attached you will see the image where the calcuatlion is done and is in agreement with @Christian Blatter.



              enter image description here






              share|cite|improve this answer




























                0














                The other way to solve the problem albeit it is more calculation intensive.



                The pmf of obtaining two consecutive heads in k trials $$P_{N}(k) = frac{F_{k-1}}{2^k}$$ where $F_k$ is the Fibonacci Sequence.



                It is the same for both A and B to get two consecutive heads. Since A starts,



                Probability that A wins $$sum_{k=2}^{infty} frac{F_{k-1}}{2^k} left(1-sum_{i=1}^{k-1}frac{F_{i-1}}{2^{i}}right)$$



                Attached you will see the image where the calcuatlion is done and is in agreement with @Christian Blatter.



                enter image description here






                share|cite|improve this answer


























                  0












                  0








                  0






                  The other way to solve the problem albeit it is more calculation intensive.



                  The pmf of obtaining two consecutive heads in k trials $$P_{N}(k) = frac{F_{k-1}}{2^k}$$ where $F_k$ is the Fibonacci Sequence.



                  It is the same for both A and B to get two consecutive heads. Since A starts,



                  Probability that A wins $$sum_{k=2}^{infty} frac{F_{k-1}}{2^k} left(1-sum_{i=1}^{k-1}frac{F_{i-1}}{2^{i}}right)$$



                  Attached you will see the image where the calcuatlion is done and is in agreement with @Christian Blatter.



                  enter image description here






                  share|cite|improve this answer














                  The other way to solve the problem albeit it is more calculation intensive.



                  The pmf of obtaining two consecutive heads in k trials $$P_{N}(k) = frac{F_{k-1}}{2^k}$$ where $F_k$ is the Fibonacci Sequence.



                  It is the same for both A and B to get two consecutive heads. Since A starts,



                  Probability that A wins $$sum_{k=2}^{infty} frac{F_{k-1}}{2^k} left(1-sum_{i=1}^{k-1}frac{F_{i-1}}{2^{i}}right)$$



                  Attached you will see the image where the calcuatlion is done and is in agreement with @Christian Blatter.



                  enter image description here







                  share|cite|improve this answer














                  share|cite|improve this answer



                  share|cite|improve this answer








                  edited Nov 20 at 6:10

























                  answered Nov 19 at 13:07









                  Satish Ramanathan

                  9,41531323




                  9,41531323






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Mathematics Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3003586%2fgame-first-person-to-throw-consecutive-heads%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      AnyDesk - Fatal Program Failure

                      How to calibrate 16:9 built-in touch-screen to a 4:3 resolution?

                      QoS: MAC-Priority for clients behind a repeater