What is the probability of the following event?

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











up vote
1
down vote

favorite
1












Let $X_1, X_2, X_3, X_4$ be independent Bernoulli random variables. Then
beginalign
Pr[X_i=1]=Pr[X_i=0]=1/2.
endalign
I want to compute the following probability
beginalign
Pr( X_1+X_2+X_3=2, X_2+X_4=1 ).
endalign
My solution: Suppose that $X_1+X_2+X_3=2$ and $X_2+X_4=1$. Then $(X_2, X_4)=(0,1)$ or $(1,0)$. The probabilities of $(X_2, X_4)=(0,1)$ and $(1,0)$ are both $1/2 times 1/2 = 1/4$. If $(X_2, X_4)=(0,1)$, then $X_1+X_2+X_3=X_1+X_3=2$. Therefore $X_1 = X_3 =1$. This happens with probability $1/4$. If $(X_2, X_4)=(1,0)$, then $X_1+X_2+X_3=X_1+1+X_3=2$. Therefore $(X_1, X_3) in (1,0), (0,1)$. This happens with probability $1/4$. Therefore
beginalign
Pr( X_1+X_2+X_3=2, X_2+X_4=1 ) = 1/16+2/16=3/16.
endalign
Is this correct? Thank you very much.







share|cite|improve this question























    up vote
    1
    down vote

    favorite
    1












    Let $X_1, X_2, X_3, X_4$ be independent Bernoulli random variables. Then
    beginalign
    Pr[X_i=1]=Pr[X_i=0]=1/2.
    endalign
    I want to compute the following probability
    beginalign
    Pr( X_1+X_2+X_3=2, X_2+X_4=1 ).
    endalign
    My solution: Suppose that $X_1+X_2+X_3=2$ and $X_2+X_4=1$. Then $(X_2, X_4)=(0,1)$ or $(1,0)$. The probabilities of $(X_2, X_4)=(0,1)$ and $(1,0)$ are both $1/2 times 1/2 = 1/4$. If $(X_2, X_4)=(0,1)$, then $X_1+X_2+X_3=X_1+X_3=2$. Therefore $X_1 = X_3 =1$. This happens with probability $1/4$. If $(X_2, X_4)=(1,0)$, then $X_1+X_2+X_3=X_1+1+X_3=2$. Therefore $(X_1, X_3) in (1,0), (0,1)$. This happens with probability $1/4$. Therefore
    beginalign
    Pr( X_1+X_2+X_3=2, X_2+X_4=1 ) = 1/16+2/16=3/16.
    endalign
    Is this correct? Thank you very much.







    share|cite|improve this question





















      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      Let $X_1, X_2, X_3, X_4$ be independent Bernoulli random variables. Then
      beginalign
      Pr[X_i=1]=Pr[X_i=0]=1/2.
      endalign
      I want to compute the following probability
      beginalign
      Pr( X_1+X_2+X_3=2, X_2+X_4=1 ).
      endalign
      My solution: Suppose that $X_1+X_2+X_3=2$ and $X_2+X_4=1$. Then $(X_2, X_4)=(0,1)$ or $(1,0)$. The probabilities of $(X_2, X_4)=(0,1)$ and $(1,0)$ are both $1/2 times 1/2 = 1/4$. If $(X_2, X_4)=(0,1)$, then $X_1+X_2+X_3=X_1+X_3=2$. Therefore $X_1 = X_3 =1$. This happens with probability $1/4$. If $(X_2, X_4)=(1,0)$, then $X_1+X_2+X_3=X_1+1+X_3=2$. Therefore $(X_1, X_3) in (1,0), (0,1)$. This happens with probability $1/4$. Therefore
      beginalign
      Pr( X_1+X_2+X_3=2, X_2+X_4=1 ) = 1/16+2/16=3/16.
      endalign
      Is this correct? Thank you very much.







      share|cite|improve this question











      Let $X_1, X_2, X_3, X_4$ be independent Bernoulli random variables. Then
      beginalign
      Pr[X_i=1]=Pr[X_i=0]=1/2.
      endalign
      I want to compute the following probability
      beginalign
      Pr( X_1+X_2+X_3=2, X_2+X_4=1 ).
      endalign
      My solution: Suppose that $X_1+X_2+X_3=2$ and $X_2+X_4=1$. Then $(X_2, X_4)=(0,1)$ or $(1,0)$. The probabilities of $(X_2, X_4)=(0,1)$ and $(1,0)$ are both $1/2 times 1/2 = 1/4$. If $(X_2, X_4)=(0,1)$, then $X_1+X_2+X_3=X_1+X_3=2$. Therefore $X_1 = X_3 =1$. This happens with probability $1/4$. If $(X_2, X_4)=(1,0)$, then $X_1+X_2+X_3=X_1+1+X_3=2$. Therefore $(X_1, X_3) in (1,0), (0,1)$. This happens with probability $1/4$. Therefore
      beginalign
      Pr( X_1+X_2+X_3=2, X_2+X_4=1 ) = 1/16+2/16=3/16.
      endalign
      Is this correct? Thank you very much.









      share|cite|improve this question










      share|cite|improve this question




      share|cite|improve this question









      asked 2 days ago









      LJR

      6,41841645




      6,41841645




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          2
          down vote













          Let's verify your result by simulation using a Python script:



          import numpy as np

          N = 10**5 # number of trials

          # list of N 4-ples (X1, X2, X3, X4)
          XX = [np.random.randint(2, size=4) for n in np.arange(N)]

          # list of trials outcomes
          P = list(map(lambda X: (X[0]+X[1]+X[2]==2)&(X[2]+X[3]==1), XX))

          # average of successes
          np.mean(P) # ~ 0.18772


          Since $frac316 simeq 0.18772$ this confirms your result.






          share|cite|improve this answer























          • thank you very much. Your codes are very helpful. Are these python codes?
            – LJR
            2 days ago










          • @LJR You're welcome! Yes they are! I'll edit the answer
            – Giulio Scattolin
            2 days ago

















          up vote
          2
          down vote













          Just add as a supplementary technique:



          You may also try to use the law of total probability with conditioning on $X_2$, since only $X_2$ are in common of the two events, then make use of the independence:



          $$ beginalign &PrX_1 + X_2 + X_3 = 2, X_2 + X_4 = 1 \
          =& PrX_2 = 0PrX_2 = 0 \
          &+ PrX_1 + X_2 + X_3 = 2, X_2 + X_4 = 1PrX_2 = 1 \
          =& PrX_1 + X_3 = 2, X_4 = 1PrX_2 = 0 \
          &+ PrX_2 = 1PrX_2 = 1 \
          =& PrX_1 + X_3 = 2PrX_4 = 1PrX_2 = 0 + \
          &+ PrX_1 + X_3 = 1PrX_4 = 0PrX_2 = 1 \
          =& frac 1 4times frac 1 2 times frac 1 2 + frac 1 2 times frac 1 2 times frac 1 2 \
          =& frac 3 16
          endalign$$



          So essentially you have counted the cases, just like what you have did.






          share|cite|improve this answer




























            up vote
            1
            down vote













            Yes, your solution is indeed correct!




            Minor comment: In the last sentence before the final expression "this" is probably referred to each of the outcomes $(1, 0)$ and $(0, 1)$ rather than to the event $(X_1, X_3) in (1, 0), (0, 1) $.






            share|cite|improve this answer

















            • 1




              @Pointguardo, yes, thank you very much for your comments.
              – LJR
              2 days ago










            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%2f2871949%2fwhat-is-the-probability-of-the-following-event%23new-answer', 'question_page');

            );

            Post as a guest






























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote













            Let's verify your result by simulation using a Python script:



            import numpy as np

            N = 10**5 # number of trials

            # list of N 4-ples (X1, X2, X3, X4)
            XX = [np.random.randint(2, size=4) for n in np.arange(N)]

            # list of trials outcomes
            P = list(map(lambda X: (X[0]+X[1]+X[2]==2)&(X[2]+X[3]==1), XX))

            # average of successes
            np.mean(P) # ~ 0.18772


            Since $frac316 simeq 0.18772$ this confirms your result.






            share|cite|improve this answer























            • thank you very much. Your codes are very helpful. Are these python codes?
              – LJR
              2 days ago










            • @LJR You're welcome! Yes they are! I'll edit the answer
              – Giulio Scattolin
              2 days ago














            up vote
            2
            down vote













            Let's verify your result by simulation using a Python script:



            import numpy as np

            N = 10**5 # number of trials

            # list of N 4-ples (X1, X2, X3, X4)
            XX = [np.random.randint(2, size=4) for n in np.arange(N)]

            # list of trials outcomes
            P = list(map(lambda X: (X[0]+X[1]+X[2]==2)&(X[2]+X[3]==1), XX))

            # average of successes
            np.mean(P) # ~ 0.18772


            Since $frac316 simeq 0.18772$ this confirms your result.






            share|cite|improve this answer























            • thank you very much. Your codes are very helpful. Are these python codes?
              – LJR
              2 days ago










            • @LJR You're welcome! Yes they are! I'll edit the answer
              – Giulio Scattolin
              2 days ago












            up vote
            2
            down vote










            up vote
            2
            down vote









            Let's verify your result by simulation using a Python script:



            import numpy as np

            N = 10**5 # number of trials

            # list of N 4-ples (X1, X2, X3, X4)
            XX = [np.random.randint(2, size=4) for n in np.arange(N)]

            # list of trials outcomes
            P = list(map(lambda X: (X[0]+X[1]+X[2]==2)&(X[2]+X[3]==1), XX))

            # average of successes
            np.mean(P) # ~ 0.18772


            Since $frac316 simeq 0.18772$ this confirms your result.






            share|cite|improve this answer















            Let's verify your result by simulation using a Python script:



            import numpy as np

            N = 10**5 # number of trials

            # list of N 4-ples (X1, X2, X3, X4)
            XX = [np.random.randint(2, size=4) for n in np.arange(N)]

            # list of trials outcomes
            P = list(map(lambda X: (X[0]+X[1]+X[2]==2)&(X[2]+X[3]==1), XX))

            # average of successes
            np.mean(P) # ~ 0.18772


            Since $frac316 simeq 0.18772$ this confirms your result.







            share|cite|improve this answer















            share|cite|improve this answer



            share|cite|improve this answer








            edited 2 days ago


























            answered 2 days ago









            Giulio Scattolin

            1568




            1568











            • thank you very much. Your codes are very helpful. Are these python codes?
              – LJR
              2 days ago










            • @LJR You're welcome! Yes they are! I'll edit the answer
              – Giulio Scattolin
              2 days ago
















            • thank you very much. Your codes are very helpful. Are these python codes?
              – LJR
              2 days ago










            • @LJR You're welcome! Yes they are! I'll edit the answer
              – Giulio Scattolin
              2 days ago















            thank you very much. Your codes are very helpful. Are these python codes?
            – LJR
            2 days ago




            thank you very much. Your codes are very helpful. Are these python codes?
            – LJR
            2 days ago












            @LJR You're welcome! Yes they are! I'll edit the answer
            – Giulio Scattolin
            2 days ago




            @LJR You're welcome! Yes they are! I'll edit the answer
            – Giulio Scattolin
            2 days ago










            up vote
            2
            down vote













            Just add as a supplementary technique:



            You may also try to use the law of total probability with conditioning on $X_2$, since only $X_2$ are in common of the two events, then make use of the independence:



            $$ beginalign &PrX_1 + X_2 + X_3 = 2, X_2 + X_4 = 1 \
            =& PrX_2 = 0PrX_2 = 0 \
            &+ PrX_1 + X_2 + X_3 = 2, X_2 + X_4 = 1PrX_2 = 1 \
            =& PrX_1 + X_3 = 2, X_4 = 1PrX_2 = 0 \
            &+ PrX_2 = 1PrX_2 = 1 \
            =& PrX_1 + X_3 = 2PrX_4 = 1PrX_2 = 0 + \
            &+ PrX_1 + X_3 = 1PrX_4 = 0PrX_2 = 1 \
            =& frac 1 4times frac 1 2 times frac 1 2 + frac 1 2 times frac 1 2 times frac 1 2 \
            =& frac 3 16
            endalign$$



            So essentially you have counted the cases, just like what you have did.






            share|cite|improve this answer

























              up vote
              2
              down vote













              Just add as a supplementary technique:



              You may also try to use the law of total probability with conditioning on $X_2$, since only $X_2$ are in common of the two events, then make use of the independence:



              $$ beginalign &PrX_1 + X_2 + X_3 = 2, X_2 + X_4 = 1 \
              =& PrX_2 = 0PrX_2 = 0 \
              &+ PrX_1 + X_2 + X_3 = 2, X_2 + X_4 = 1PrX_2 = 1 \
              =& PrX_1 + X_3 = 2, X_4 = 1PrX_2 = 0 \
              &+ PrX_2 = 1PrX_2 = 1 \
              =& PrX_1 + X_3 = 2PrX_4 = 1PrX_2 = 0 + \
              &+ PrX_1 + X_3 = 1PrX_4 = 0PrX_2 = 1 \
              =& frac 1 4times frac 1 2 times frac 1 2 + frac 1 2 times frac 1 2 times frac 1 2 \
              =& frac 3 16
              endalign$$



              So essentially you have counted the cases, just like what you have did.






              share|cite|improve this answer























                up vote
                2
                down vote










                up vote
                2
                down vote









                Just add as a supplementary technique:



                You may also try to use the law of total probability with conditioning on $X_2$, since only $X_2$ are in common of the two events, then make use of the independence:



                $$ beginalign &PrX_1 + X_2 + X_3 = 2, X_2 + X_4 = 1 \
                =& PrX_2 = 0PrX_2 = 0 \
                &+ PrX_1 + X_2 + X_3 = 2, X_2 + X_4 = 1PrX_2 = 1 \
                =& PrX_1 + X_3 = 2, X_4 = 1PrX_2 = 0 \
                &+ PrX_2 = 1PrX_2 = 1 \
                =& PrX_1 + X_3 = 2PrX_4 = 1PrX_2 = 0 + \
                &+ PrX_1 + X_3 = 1PrX_4 = 0PrX_2 = 1 \
                =& frac 1 4times frac 1 2 times frac 1 2 + frac 1 2 times frac 1 2 times frac 1 2 \
                =& frac 3 16
                endalign$$



                So essentially you have counted the cases, just like what you have did.






                share|cite|improve this answer













                Just add as a supplementary technique:



                You may also try to use the law of total probability with conditioning on $X_2$, since only $X_2$ are in common of the two events, then make use of the independence:



                $$ beginalign &PrX_1 + X_2 + X_3 = 2, X_2 + X_4 = 1 \
                =& PrX_2 = 0PrX_2 = 0 \
                &+ PrX_1 + X_2 + X_3 = 2, X_2 + X_4 = 1PrX_2 = 1 \
                =& PrX_1 + X_3 = 2, X_4 = 1PrX_2 = 0 \
                &+ PrX_2 = 1PrX_2 = 1 \
                =& PrX_1 + X_3 = 2PrX_4 = 1PrX_2 = 0 + \
                &+ PrX_1 + X_3 = 1PrX_4 = 0PrX_2 = 1 \
                =& frac 1 4times frac 1 2 times frac 1 2 + frac 1 2 times frac 1 2 times frac 1 2 \
                =& frac 3 16
                endalign$$



                So essentially you have counted the cases, just like what you have did.







                share|cite|improve this answer













                share|cite|improve this answer



                share|cite|improve this answer











                answered 2 days ago









                BGM

                3,450148




                3,450148




















                    up vote
                    1
                    down vote













                    Yes, your solution is indeed correct!




                    Minor comment: In the last sentence before the final expression "this" is probably referred to each of the outcomes $(1, 0)$ and $(0, 1)$ rather than to the event $(X_1, X_3) in (1, 0), (0, 1) $.






                    share|cite|improve this answer

















                    • 1




                      @Pointguardo, yes, thank you very much for your comments.
                      – LJR
                      2 days ago














                    up vote
                    1
                    down vote













                    Yes, your solution is indeed correct!




                    Minor comment: In the last sentence before the final expression "this" is probably referred to each of the outcomes $(1, 0)$ and $(0, 1)$ rather than to the event $(X_1, X_3) in (1, 0), (0, 1) $.






                    share|cite|improve this answer

















                    • 1




                      @Pointguardo, yes, thank you very much for your comments.
                      – LJR
                      2 days ago












                    up vote
                    1
                    down vote










                    up vote
                    1
                    down vote









                    Yes, your solution is indeed correct!




                    Minor comment: In the last sentence before the final expression "this" is probably referred to each of the outcomes $(1, 0)$ and $(0, 1)$ rather than to the event $(X_1, X_3) in (1, 0), (0, 1) $.






                    share|cite|improve this answer













                    Yes, your solution is indeed correct!




                    Minor comment: In the last sentence before the final expression "this" is probably referred to each of the outcomes $(1, 0)$ and $(0, 1)$ rather than to the event $(X_1, X_3) in (1, 0), (0, 1) $.







                    share|cite|improve this answer













                    share|cite|improve this answer



                    share|cite|improve this answer











                    answered 2 days ago









                    pointguard0

                    512215




                    512215







                    • 1




                      @Pointguardo, yes, thank you very much for your comments.
                      – LJR
                      2 days ago












                    • 1




                      @Pointguardo, yes, thank you very much for your comments.
                      – LJR
                      2 days ago







                    1




                    1




                    @Pointguardo, yes, thank you very much for your comments.
                    – LJR
                    2 days ago




                    @Pointguardo, yes, thank you very much for your comments.
                    – LJR
                    2 days ago












                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2871949%2fwhat-is-the-probability-of-the-following-event%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?