Game - First person to throw consecutive heads











up vote
0
down vote

favorite












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







New contributor




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




















  • What are your thoughts?
    – lulu
    21 hours ago










  • 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
    21 hours ago






  • 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
    20 hours ago












  • 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
    20 hours ago










  • 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
    20 hours ago

















up vote
0
down vote

favorite












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







New contributor




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




















  • What are your thoughts?
    – lulu
    21 hours ago










  • 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
    21 hours ago






  • 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
    20 hours ago












  • 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
    20 hours ago










  • 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
    20 hours ago















up vote
0
down vote

favorite









up vote
0
down vote

favorite











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







New contributor




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











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







New contributor




Connolly Devin 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 question







New contributor




Connolly Devin 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 question




share|cite|improve this question






New contributor




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









asked 21 hours ago









Connolly Devin

1




1




New contributor




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





New contributor





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






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












  • What are your thoughts?
    – lulu
    21 hours ago










  • 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
    21 hours ago






  • 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
    20 hours ago












  • 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
    20 hours ago










  • 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
    20 hours ago




















  • What are your thoughts?
    – lulu
    21 hours ago










  • 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
    21 hours ago






  • 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
    20 hours ago












  • 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
    20 hours ago










  • 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
    20 hours ago


















What are your thoughts?
– lulu
21 hours ago




What are your thoughts?
– lulu
21 hours ago












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
21 hours ago




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
21 hours ago




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
20 hours ago






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
20 hours ago














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
20 hours ago




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
20 hours ago












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
20 hours ago






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
20 hours ago












1 Answer
1






active

oldest

votes

















up vote
0
down vote













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























    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: 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
    });


    }
    });






    Connolly Devin is a new contributor. Be nice, and check out our Code of Conduct.










     

    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

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    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



























      up vote
      0
      down vote













      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

























        up vote
        0
        down vote










        up vote
        0
        down vote









        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 2 hours ago

























        answered 19 hours ago









        Christian Blatter

        170k7111323




        170k7111323






















            Connolly Devin is a new contributor. Be nice, and check out our Code of Conduct.










             

            draft saved


            draft discarded


















            Connolly Devin is a new contributor. Be nice, and check out our Code of Conduct.













            Connolly Devin is a new contributor. Be nice, and check out our Code of Conduct.












            Connolly Devin is a new contributor. Be nice, and check out our Code of Conduct.















             


            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

            MongoDB - Not Authorized To Execute Command

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

            Npm cannot find a required file even through it is in the searched directory