Estimate the relationship between the probabilities of head of two biased coins












1














Question: Assume that $p$ and $q$ were uniformly sampled in $[0, 1]$ and two biased coins whose probabilities of head are $p$ and $q$, respectively, were made. However, we don't know what $p$ and $q$ are. To estimate them, each coin is tossed $n$ times, then we got $r_1$ heads for the coin whose probability of head is $p$ and $r_2$ heads for the other coin as a result. What is the probability that $p<q$?



I tried Bayes theorem to solve above question. Let $A$ and $B$ denote





  • $A$: An event that $p<q$


  • $B$: An event that we got the results of tosses as mentioned above


Then
$$ P(A) = frac{1}{2} quad text{and} quad P(B) = binom{n}{r_1}p^{r_1}(1-p)^{n-r_1}binom{n}{r_2}q^{r_2}(1-q)^{n-r_2} $$
trivially, and what I want to calculate is $P(A|B)$. However, I don't have any idea to get $P(B|A)$ to use Bayes theorem. How can I solve this?










share|cite|improve this question





























    1














    Question: Assume that $p$ and $q$ were uniformly sampled in $[0, 1]$ and two biased coins whose probabilities of head are $p$ and $q$, respectively, were made. However, we don't know what $p$ and $q$ are. To estimate them, each coin is tossed $n$ times, then we got $r_1$ heads for the coin whose probability of head is $p$ and $r_2$ heads for the other coin as a result. What is the probability that $p<q$?



    I tried Bayes theorem to solve above question. Let $A$ and $B$ denote





    • $A$: An event that $p<q$


    • $B$: An event that we got the results of tosses as mentioned above


    Then
    $$ P(A) = frac{1}{2} quad text{and} quad P(B) = binom{n}{r_1}p^{r_1}(1-p)^{n-r_1}binom{n}{r_2}q^{r_2}(1-q)^{n-r_2} $$
    trivially, and what I want to calculate is $P(A|B)$. However, I don't have any idea to get $P(B|A)$ to use Bayes theorem. How can I solve this?










    share|cite|improve this question



























      1












      1








      1







      Question: Assume that $p$ and $q$ were uniformly sampled in $[0, 1]$ and two biased coins whose probabilities of head are $p$ and $q$, respectively, were made. However, we don't know what $p$ and $q$ are. To estimate them, each coin is tossed $n$ times, then we got $r_1$ heads for the coin whose probability of head is $p$ and $r_2$ heads for the other coin as a result. What is the probability that $p<q$?



      I tried Bayes theorem to solve above question. Let $A$ and $B$ denote





      • $A$: An event that $p<q$


      • $B$: An event that we got the results of tosses as mentioned above


      Then
      $$ P(A) = frac{1}{2} quad text{and} quad P(B) = binom{n}{r_1}p^{r_1}(1-p)^{n-r_1}binom{n}{r_2}q^{r_2}(1-q)^{n-r_2} $$
      trivially, and what I want to calculate is $P(A|B)$. However, I don't have any idea to get $P(B|A)$ to use Bayes theorem. How can I solve this?










      share|cite|improve this question















      Question: Assume that $p$ and $q$ were uniformly sampled in $[0, 1]$ and two biased coins whose probabilities of head are $p$ and $q$, respectively, were made. However, we don't know what $p$ and $q$ are. To estimate them, each coin is tossed $n$ times, then we got $r_1$ heads for the coin whose probability of head is $p$ and $r_2$ heads for the other coin as a result. What is the probability that $p<q$?



      I tried Bayes theorem to solve above question. Let $A$ and $B$ denote





      • $A$: An event that $p<q$


      • $B$: An event that we got the results of tosses as mentioned above


      Then
      $$ P(A) = frac{1}{2} quad text{and} quad P(B) = binom{n}{r_1}p^{r_1}(1-p)^{n-r_1}binom{n}{r_2}q^{r_2}(1-q)^{n-r_2} $$
      trivially, and what I want to calculate is $P(A|B)$. However, I don't have any idea to get $P(B|A)$ to use Bayes theorem. How can I solve this?







      probability conditional-probability bayes-theorem






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Dec 7 at 7:39

























      asked Dec 4 at 5:57









      Jeongu Kim

      734




      734






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You are correct that $P(A)=1/2$, but your claimed formula for $P(B)$ is in fact the formula for $P(B|p,q)$, i.e. the probability of the event $B$ given that you know $p$ and $q$. Baye's theorem states that $P(A|B) = P(B|A) cdot P(A)/P(B)$. So you are left with computing $P(B|A)$ and $P(B)$. This boils down to computing the integral of $binom{n}{r_1}p^{r_1}(1-p)^{n-r_1}binom{n}{r_2}q^{r_2}(1-q)^{n-r_2}$ over $p$ and $q$ in the appropriate ranges. You will probably find the Beta function helpful.






          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%2f3025172%2festimate-the-relationship-between-the-probabilities-of-head-of-two-biased-coins%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









            0














            You are correct that $P(A)=1/2$, but your claimed formula for $P(B)$ is in fact the formula for $P(B|p,q)$, i.e. the probability of the event $B$ given that you know $p$ and $q$. Baye's theorem states that $P(A|B) = P(B|A) cdot P(A)/P(B)$. So you are left with computing $P(B|A)$ and $P(B)$. This boils down to computing the integral of $binom{n}{r_1}p^{r_1}(1-p)^{n-r_1}binom{n}{r_2}q^{r_2}(1-q)^{n-r_2}$ over $p$ and $q$ in the appropriate ranges. You will probably find the Beta function helpful.






            share|cite|improve this answer


























              0














              You are correct that $P(A)=1/2$, but your claimed formula for $P(B)$ is in fact the formula for $P(B|p,q)$, i.e. the probability of the event $B$ given that you know $p$ and $q$. Baye's theorem states that $P(A|B) = P(B|A) cdot P(A)/P(B)$. So you are left with computing $P(B|A)$ and $P(B)$. This boils down to computing the integral of $binom{n}{r_1}p^{r_1}(1-p)^{n-r_1}binom{n}{r_2}q^{r_2}(1-q)^{n-r_2}$ over $p$ and $q$ in the appropriate ranges. You will probably find the Beta function helpful.






              share|cite|improve this answer
























                0












                0








                0






                You are correct that $P(A)=1/2$, but your claimed formula for $P(B)$ is in fact the formula for $P(B|p,q)$, i.e. the probability of the event $B$ given that you know $p$ and $q$. Baye's theorem states that $P(A|B) = P(B|A) cdot P(A)/P(B)$. So you are left with computing $P(B|A)$ and $P(B)$. This boils down to computing the integral of $binom{n}{r_1}p^{r_1}(1-p)^{n-r_1}binom{n}{r_2}q^{r_2}(1-q)^{n-r_2}$ over $p$ and $q$ in the appropriate ranges. You will probably find the Beta function helpful.






                share|cite|improve this answer












                You are correct that $P(A)=1/2$, but your claimed formula for $P(B)$ is in fact the formula for $P(B|p,q)$, i.e. the probability of the event $B$ given that you know $p$ and $q$. Baye's theorem states that $P(A|B) = P(B|A) cdot P(A)/P(B)$. So you are left with computing $P(B|A)$ and $P(B)$. This boils down to computing the integral of $binom{n}{r_1}p^{r_1}(1-p)^{n-r_1}binom{n}{r_2}q^{r_2}(1-q)^{n-r_2}$ over $p$ and $q$ in the appropriate ranges. You will probably find the Beta function helpful.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Dec 4 at 8:12









                norfair

                99512




                99512






























                    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%2f3025172%2festimate-the-relationship-between-the-probabilities-of-head-of-two-biased-coins%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

                    Bressuire

                    Cabo Verde

                    Gyllenstierna