Expected number of Failures within K trials for Binomial RV












0












$begingroup$


Question:



Given a binomial random variable with probability of success p and probability of failure (1-p). What is the expected number of failures given that a success was observed within k trials and then trials were halted?



For example, if k=3 then the observations that qualify would be:



Failure, Failure, Success



Failure, Success



Success



Note that the following observations do NOT qualify even though the success occurs within the first k trials because the trials not halted after the first success:



Failure, Success, Failure



Success, Failure, Failure



Failure, Success, Success



ETC...



And of course these observations do NOT qualify because there are no successes in them at all:



Failure, Failure, Failure



Failure, Failure



My solution:



In the example for k=3, I think we can calculate the expected number of failures for k=3 in the following way. First, calculate the total probability of observations that qualify:



$$Total Conditional Probability = TCP = P(Failure, Failure, Success) + P(Failure, Success) + P(Success) = p(1-p)^2 + p(1-p) + p$$



Then, we can answer the question by calculating the expected number of failures for the all observations that qualify and normalize it by our probability space (TCP):



$$(P(Failure, Failure, Success)*NumFailures(Failure, Failure, Success) + P(Failure, Success)*NumFailures(Failure, Success) + P(Success)*NumFailures(Success))/TCP$$



$$(P(Failure, Failure, Success)*2 + P(Failure, Success)*1 + P(Success)*0)/TCP$$



$$frac{(p(1-p)^22 + p(1-p)1 + p0)}{TCP}$$



We then repeat this procedure using a general k. The formula for TCP is:



$$TCP = sum_{i=0}^{k-1}{(p(1-p)^i)}$$



And the expected number of failures for general k:



$$frac{sum_{i=0}^{k-1}{((p(1-p)^i)i)}}{TCP}$$



I would also like know if there is a way to simplify this formula, assuming it is correct. Thank you.










share|cite|improve this question









$endgroup$

















    0












    $begingroup$


    Question:



    Given a binomial random variable with probability of success p and probability of failure (1-p). What is the expected number of failures given that a success was observed within k trials and then trials were halted?



    For example, if k=3 then the observations that qualify would be:



    Failure, Failure, Success



    Failure, Success



    Success



    Note that the following observations do NOT qualify even though the success occurs within the first k trials because the trials not halted after the first success:



    Failure, Success, Failure



    Success, Failure, Failure



    Failure, Success, Success



    ETC...



    And of course these observations do NOT qualify because there are no successes in them at all:



    Failure, Failure, Failure



    Failure, Failure



    My solution:



    In the example for k=3, I think we can calculate the expected number of failures for k=3 in the following way. First, calculate the total probability of observations that qualify:



    $$Total Conditional Probability = TCP = P(Failure, Failure, Success) + P(Failure, Success) + P(Success) = p(1-p)^2 + p(1-p) + p$$



    Then, we can answer the question by calculating the expected number of failures for the all observations that qualify and normalize it by our probability space (TCP):



    $$(P(Failure, Failure, Success)*NumFailures(Failure, Failure, Success) + P(Failure, Success)*NumFailures(Failure, Success) + P(Success)*NumFailures(Success))/TCP$$



    $$(P(Failure, Failure, Success)*2 + P(Failure, Success)*1 + P(Success)*0)/TCP$$



    $$frac{(p(1-p)^22 + p(1-p)1 + p0)}{TCP}$$



    We then repeat this procedure using a general k. The formula for TCP is:



    $$TCP = sum_{i=0}^{k-1}{(p(1-p)^i)}$$



    And the expected number of failures for general k:



    $$frac{sum_{i=0}^{k-1}{((p(1-p)^i)i)}}{TCP}$$



    I would also like know if there is a way to simplify this formula, assuming it is correct. Thank you.










    share|cite|improve this question









    $endgroup$















      0












      0








      0





      $begingroup$


      Question:



      Given a binomial random variable with probability of success p and probability of failure (1-p). What is the expected number of failures given that a success was observed within k trials and then trials were halted?



      For example, if k=3 then the observations that qualify would be:



      Failure, Failure, Success



      Failure, Success



      Success



      Note that the following observations do NOT qualify even though the success occurs within the first k trials because the trials not halted after the first success:



      Failure, Success, Failure



      Success, Failure, Failure



      Failure, Success, Success



      ETC...



      And of course these observations do NOT qualify because there are no successes in them at all:



      Failure, Failure, Failure



      Failure, Failure



      My solution:



      In the example for k=3, I think we can calculate the expected number of failures for k=3 in the following way. First, calculate the total probability of observations that qualify:



      $$Total Conditional Probability = TCP = P(Failure, Failure, Success) + P(Failure, Success) + P(Success) = p(1-p)^2 + p(1-p) + p$$



      Then, we can answer the question by calculating the expected number of failures for the all observations that qualify and normalize it by our probability space (TCP):



      $$(P(Failure, Failure, Success)*NumFailures(Failure, Failure, Success) + P(Failure, Success)*NumFailures(Failure, Success) + P(Success)*NumFailures(Success))/TCP$$



      $$(P(Failure, Failure, Success)*2 + P(Failure, Success)*1 + P(Success)*0)/TCP$$



      $$frac{(p(1-p)^22 + p(1-p)1 + p0)}{TCP}$$



      We then repeat this procedure using a general k. The formula for TCP is:



      $$TCP = sum_{i=0}^{k-1}{(p(1-p)^i)}$$



      And the expected number of failures for general k:



      $$frac{sum_{i=0}^{k-1}{((p(1-p)^i)i)}}{TCP}$$



      I would also like know if there is a way to simplify this formula, assuming it is correct. Thank you.










      share|cite|improve this question









      $endgroup$




      Question:



      Given a binomial random variable with probability of success p and probability of failure (1-p). What is the expected number of failures given that a success was observed within k trials and then trials were halted?



      For example, if k=3 then the observations that qualify would be:



      Failure, Failure, Success



      Failure, Success



      Success



      Note that the following observations do NOT qualify even though the success occurs within the first k trials because the trials not halted after the first success:



      Failure, Success, Failure



      Success, Failure, Failure



      Failure, Success, Success



      ETC...



      And of course these observations do NOT qualify because there are no successes in them at all:



      Failure, Failure, Failure



      Failure, Failure



      My solution:



      In the example for k=3, I think we can calculate the expected number of failures for k=3 in the following way. First, calculate the total probability of observations that qualify:



      $$Total Conditional Probability = TCP = P(Failure, Failure, Success) + P(Failure, Success) + P(Success) = p(1-p)^2 + p(1-p) + p$$



      Then, we can answer the question by calculating the expected number of failures for the all observations that qualify and normalize it by our probability space (TCP):



      $$(P(Failure, Failure, Success)*NumFailures(Failure, Failure, Success) + P(Failure, Success)*NumFailures(Failure, Success) + P(Success)*NumFailures(Success))/TCP$$



      $$(P(Failure, Failure, Success)*2 + P(Failure, Success)*1 + P(Success)*0)/TCP$$



      $$frac{(p(1-p)^22 + p(1-p)1 + p0)}{TCP}$$



      We then repeat this procedure using a general k. The formula for TCP is:



      $$TCP = sum_{i=0}^{k-1}{(p(1-p)^i)}$$



      And the expected number of failures for general k:



      $$frac{sum_{i=0}^{k-1}{((p(1-p)^i)i)}}{TCP}$$



      I would also like know if there is a way to simplify this formula, assuming it is correct. Thank you.







      probability random-variables conditional-probability binomial-distribution expected-value






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Dec 4 '18 at 19:38









      Helpless oneHelpless one

      1




      1






















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          A binomial random variable counts the number of "successes" among a fixed number of trials $n$, without regard to the order in which the outcomes of those trials occur.



          Since you stop observing trials after the first success is observed, a more appropriate probability model is a geometric random variable, which in your case would count the number of failures before the first success is observed. This is given by $$Pr[Y = y] = p (1-p)^y, quad y in {0, 1, 2, 3, ldots}.$$ Your question then amounts to $$operatorname{E}[Y mid Y le k-1];$$ this is the conditional expectation of the number of failures given that there are at most $k-1$ such failures (which implies that the first success occurs by the $k^{rm th}$ trial). To calculate this, note $$Pr[Y le k-1] = sum_{y=0}^{k-1} Pr[Y = y] = sum_{y=0}^{k-1} p(1-p)^y = 1 - (1-p)^k.$$ Thus $$operatorname{E}[Y mid Y le k-1]Pr[Y le k-1] = sum_{y=0}^{k-1} operatorname{E}[Y mid Y = y]Pr[Y = y] = sum_{y=0}^{k-1} y p(1-p)^y = frac{1-p - (1-p)^k(1-p+kp)}{p}.$$ Therefore, $$operatorname{E}[Y mid Y le k-1] = frac{1}{p} + k - 1 - frac{k}{1-(1-p)^k}.$$ So for $k = 3$ and $p = 1/5$, we have $52/61$.






          share|cite|improve this answer









          $endgroup$













            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%2f3026045%2fexpected-number-of-failures-within-k-trials-for-binomial-rv%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












            $begingroup$

            A binomial random variable counts the number of "successes" among a fixed number of trials $n$, without regard to the order in which the outcomes of those trials occur.



            Since you stop observing trials after the first success is observed, a more appropriate probability model is a geometric random variable, which in your case would count the number of failures before the first success is observed. This is given by $$Pr[Y = y] = p (1-p)^y, quad y in {0, 1, 2, 3, ldots}.$$ Your question then amounts to $$operatorname{E}[Y mid Y le k-1];$$ this is the conditional expectation of the number of failures given that there are at most $k-1$ such failures (which implies that the first success occurs by the $k^{rm th}$ trial). To calculate this, note $$Pr[Y le k-1] = sum_{y=0}^{k-1} Pr[Y = y] = sum_{y=0}^{k-1} p(1-p)^y = 1 - (1-p)^k.$$ Thus $$operatorname{E}[Y mid Y le k-1]Pr[Y le k-1] = sum_{y=0}^{k-1} operatorname{E}[Y mid Y = y]Pr[Y = y] = sum_{y=0}^{k-1} y p(1-p)^y = frac{1-p - (1-p)^k(1-p+kp)}{p}.$$ Therefore, $$operatorname{E}[Y mid Y le k-1] = frac{1}{p} + k - 1 - frac{k}{1-(1-p)^k}.$$ So for $k = 3$ and $p = 1/5$, we have $52/61$.






            share|cite|improve this answer









            $endgroup$


















              0












              $begingroup$

              A binomial random variable counts the number of "successes" among a fixed number of trials $n$, without regard to the order in which the outcomes of those trials occur.



              Since you stop observing trials after the first success is observed, a more appropriate probability model is a geometric random variable, which in your case would count the number of failures before the first success is observed. This is given by $$Pr[Y = y] = p (1-p)^y, quad y in {0, 1, 2, 3, ldots}.$$ Your question then amounts to $$operatorname{E}[Y mid Y le k-1];$$ this is the conditional expectation of the number of failures given that there are at most $k-1$ such failures (which implies that the first success occurs by the $k^{rm th}$ trial). To calculate this, note $$Pr[Y le k-1] = sum_{y=0}^{k-1} Pr[Y = y] = sum_{y=0}^{k-1} p(1-p)^y = 1 - (1-p)^k.$$ Thus $$operatorname{E}[Y mid Y le k-1]Pr[Y le k-1] = sum_{y=0}^{k-1} operatorname{E}[Y mid Y = y]Pr[Y = y] = sum_{y=0}^{k-1} y p(1-p)^y = frac{1-p - (1-p)^k(1-p+kp)}{p}.$$ Therefore, $$operatorname{E}[Y mid Y le k-1] = frac{1}{p} + k - 1 - frac{k}{1-(1-p)^k}.$$ So for $k = 3$ and $p = 1/5$, we have $52/61$.






              share|cite|improve this answer









              $endgroup$
















                0












                0








                0





                $begingroup$

                A binomial random variable counts the number of "successes" among a fixed number of trials $n$, without regard to the order in which the outcomes of those trials occur.



                Since you stop observing trials after the first success is observed, a more appropriate probability model is a geometric random variable, which in your case would count the number of failures before the first success is observed. This is given by $$Pr[Y = y] = p (1-p)^y, quad y in {0, 1, 2, 3, ldots}.$$ Your question then amounts to $$operatorname{E}[Y mid Y le k-1];$$ this is the conditional expectation of the number of failures given that there are at most $k-1$ such failures (which implies that the first success occurs by the $k^{rm th}$ trial). To calculate this, note $$Pr[Y le k-1] = sum_{y=0}^{k-1} Pr[Y = y] = sum_{y=0}^{k-1} p(1-p)^y = 1 - (1-p)^k.$$ Thus $$operatorname{E}[Y mid Y le k-1]Pr[Y le k-1] = sum_{y=0}^{k-1} operatorname{E}[Y mid Y = y]Pr[Y = y] = sum_{y=0}^{k-1} y p(1-p)^y = frac{1-p - (1-p)^k(1-p+kp)}{p}.$$ Therefore, $$operatorname{E}[Y mid Y le k-1] = frac{1}{p} + k - 1 - frac{k}{1-(1-p)^k}.$$ So for $k = 3$ and $p = 1/5$, we have $52/61$.






                share|cite|improve this answer









                $endgroup$



                A binomial random variable counts the number of "successes" among a fixed number of trials $n$, without regard to the order in which the outcomes of those trials occur.



                Since you stop observing trials after the first success is observed, a more appropriate probability model is a geometric random variable, which in your case would count the number of failures before the first success is observed. This is given by $$Pr[Y = y] = p (1-p)^y, quad y in {0, 1, 2, 3, ldots}.$$ Your question then amounts to $$operatorname{E}[Y mid Y le k-1];$$ this is the conditional expectation of the number of failures given that there are at most $k-1$ such failures (which implies that the first success occurs by the $k^{rm th}$ trial). To calculate this, note $$Pr[Y le k-1] = sum_{y=0}^{k-1} Pr[Y = y] = sum_{y=0}^{k-1} p(1-p)^y = 1 - (1-p)^k.$$ Thus $$operatorname{E}[Y mid Y le k-1]Pr[Y le k-1] = sum_{y=0}^{k-1} operatorname{E}[Y mid Y = y]Pr[Y = y] = sum_{y=0}^{k-1} y p(1-p)^y = frac{1-p - (1-p)^k(1-p+kp)}{p}.$$ Therefore, $$operatorname{E}[Y mid Y le k-1] = frac{1}{p} + k - 1 - frac{k}{1-(1-p)^k}.$$ So for $k = 3$ and $p = 1/5$, we have $52/61$.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Dec 4 '18 at 23:09









                heropupheropup

                63.2k662101




                63.2k662101






























                    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.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3026045%2fexpected-number-of-failures-within-k-trials-for-binomial-rv%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

                    Willebadessen

                    Ida-Boy-Ed-Garten

                    Residenzschloss Arolsen