Conditional probability for consecutive Bernoulli trials

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





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
3
down vote

favorite












Independent trials, each of which is a success with probability $p$, are performed until there are $k$ consecutive successes. Let $N_k$ denote the number of necessary trials to obtain $k$ consecutive
successes, and show that:



$$mathbbE(N_k|N_k−1) = N_k−1 + 1 + (1 − p)mathbbE(N_k).$$










share|cite|improve this question









New contributor




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

























    up vote
    3
    down vote

    favorite












    Independent trials, each of which is a success with probability $p$, are performed until there are $k$ consecutive successes. Let $N_k$ denote the number of necessary trials to obtain $k$ consecutive
    successes, and show that:



    $$mathbbE(N_k|N_k−1) = N_k−1 + 1 + (1 − p)mathbbE(N_k).$$










    share|cite|improve this question









    New contributor




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





















      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      Independent trials, each of which is a success with probability $p$, are performed until there are $k$ consecutive successes. Let $N_k$ denote the number of necessary trials to obtain $k$ consecutive
      successes, and show that:



      $$mathbbE(N_k|N_k−1) = N_k−1 + 1 + (1 − p)mathbbE(N_k).$$










      share|cite|improve this question









      New contributor




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











      Independent trials, each of which is a success with probability $p$, are performed until there are $k$ consecutive successes. Let $N_k$ denote the number of necessary trials to obtain $k$ consecutive
      successes, and show that:



      $$mathbbE(N_k|N_k−1) = N_k−1 + 1 + (1 − p)mathbbE(N_k).$$







      stochastic-processes conditional-expectation






      share|cite|improve this question









      New contributor




      Dihan 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




      Dihan 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








      edited 3 hours ago









      Ben

      14.9k12179




      14.9k12179






      New contributor




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









      asked 4 hours ago









      Dihan

      183




      183




      New contributor




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





      New contributor





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






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




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          You are conditioning on $N_k-1$, which means you are conditioning on the fact that you have $k-1$ consecutive successes. Let $X sim textBern(p)$ be the outcome of the next trial and consider the cases:



          • If $X=1$ then you now have $k$ consecutive successes;

          • If $X=0$ then you now have $0$ consecutive successes and you have to start all over again.

          Hence, by application of the law-of-total probability you have:



          $$beginequation beginaligned
          mathbbE(N_k|N_k-1)
          &= mathbbP(X=1|N_k-1) mathbbE(N_k|N_k-1,X=1) + mathbbP(X=0|N_k-1) mathbbE(N_k|N_k-1,X=0) \[6pt]
          &= p mathbbE(N_k|N_k-1,X=1) + (1-p) mathbbE(N_k|N_k-1,X=0) \[6pt]
          &= p(N_k-1+1) + (1-p) (N_k-1+1 + mathbbE(N_k)) \[6pt]
          &= p(N_k-1+1) + (1-p) (N_k-1+1) + (1-p) mathbbE(N_k) \[6pt]
          &= N_k-1+1 + (1-p) mathbbE(N_k). \[6pt]
          endaligned endequation$$






          share|cite|improve this answer




















          • Thank you so much. make sense
            – Dihan
            2 hours ago

















          up vote
          2
          down vote













          I'll give you the basic reasoning here, but you can write it out formally yourself.



          Let $N_k$ be the number of trials necessary to obtain $k$ consecutive successes.



          We want to show



          $$E[ N_k | N_k-1]= N_k-1 + 1 + (1-p)E[N_k]$$



          Firstly, given $N_k-1$, consider the possible values of $N_k-1+1$. If the trial immediately following the $N_k-1$'th trial is a success, then clearly $N_k = N_k-1+1$ with probability $p$.



          Next, suppose the trial following $N_k-1$ is a failure. So that we have $N_k-1+1$ total trails with the last one being a failure. Well, since the last one is a failure, then by the independence of each trial, under this situation we would have the conditional expected number of trials until $k$ consecutive successes as



          $$N_k-1 + 1 + E[N_k]$$



          Since we already have $N_k-1 + 1$ trials, but the last one being a failure "resets" our expectation back to $E[N_k]$.



          Hence you can express the original expectation as



          $$E[ N_k | N_k-1]= p(N_k-1 + 1) + (1-p)(N_k-1 + 1 + E[N_k])$$



          $$=N_k-1 + 1 + (1-p)E[N_k]$$



          This answer uses the law of total expectation: $E[ E[X|Y] ] = E[X]$. Here we take $Y$ as the result of the $N_k-1+1$ trial, and $X$ as $N_k|N_k-1$.






          share|cite|improve this answer










          New contributor




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

















          • Thank you so much
            – Dihan
            2 hours 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: "65"
          ;
          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: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Dihan 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%2fstats.stackexchange.com%2fquestions%2f368533%2fconditional-probability-for-consecutive-bernoulli-trials%23new-answer', 'question_page');

          );

          Post as a guest






























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          You are conditioning on $N_k-1$, which means you are conditioning on the fact that you have $k-1$ consecutive successes. Let $X sim textBern(p)$ be the outcome of the next trial and consider the cases:



          • If $X=1$ then you now have $k$ consecutive successes;

          • If $X=0$ then you now have $0$ consecutive successes and you have to start all over again.

          Hence, by application of the law-of-total probability you have:



          $$beginequation beginaligned
          mathbbE(N_k|N_k-1)
          &= mathbbP(X=1|N_k-1) mathbbE(N_k|N_k-1,X=1) + mathbbP(X=0|N_k-1) mathbbE(N_k|N_k-1,X=0) \[6pt]
          &= p mathbbE(N_k|N_k-1,X=1) + (1-p) mathbbE(N_k|N_k-1,X=0) \[6pt]
          &= p(N_k-1+1) + (1-p) (N_k-1+1 + mathbbE(N_k)) \[6pt]
          &= p(N_k-1+1) + (1-p) (N_k-1+1) + (1-p) mathbbE(N_k) \[6pt]
          &= N_k-1+1 + (1-p) mathbbE(N_k). \[6pt]
          endaligned endequation$$






          share|cite|improve this answer




















          • Thank you so much. make sense
            – Dihan
            2 hours ago














          up vote
          1
          down vote



          accepted










          You are conditioning on $N_k-1$, which means you are conditioning on the fact that you have $k-1$ consecutive successes. Let $X sim textBern(p)$ be the outcome of the next trial and consider the cases:



          • If $X=1$ then you now have $k$ consecutive successes;

          • If $X=0$ then you now have $0$ consecutive successes and you have to start all over again.

          Hence, by application of the law-of-total probability you have:



          $$beginequation beginaligned
          mathbbE(N_k|N_k-1)
          &= mathbbP(X=1|N_k-1) mathbbE(N_k|N_k-1,X=1) + mathbbP(X=0|N_k-1) mathbbE(N_k|N_k-1,X=0) \[6pt]
          &= p mathbbE(N_k|N_k-1,X=1) + (1-p) mathbbE(N_k|N_k-1,X=0) \[6pt]
          &= p(N_k-1+1) + (1-p) (N_k-1+1 + mathbbE(N_k)) \[6pt]
          &= p(N_k-1+1) + (1-p) (N_k-1+1) + (1-p) mathbbE(N_k) \[6pt]
          &= N_k-1+1 + (1-p) mathbbE(N_k). \[6pt]
          endaligned endequation$$






          share|cite|improve this answer




















          • Thank you so much. make sense
            – Dihan
            2 hours ago












          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          You are conditioning on $N_k-1$, which means you are conditioning on the fact that you have $k-1$ consecutive successes. Let $X sim textBern(p)$ be the outcome of the next trial and consider the cases:



          • If $X=1$ then you now have $k$ consecutive successes;

          • If $X=0$ then you now have $0$ consecutive successes and you have to start all over again.

          Hence, by application of the law-of-total probability you have:



          $$beginequation beginaligned
          mathbbE(N_k|N_k-1)
          &= mathbbP(X=1|N_k-1) mathbbE(N_k|N_k-1,X=1) + mathbbP(X=0|N_k-1) mathbbE(N_k|N_k-1,X=0) \[6pt]
          &= p mathbbE(N_k|N_k-1,X=1) + (1-p) mathbbE(N_k|N_k-1,X=0) \[6pt]
          &= p(N_k-1+1) + (1-p) (N_k-1+1 + mathbbE(N_k)) \[6pt]
          &= p(N_k-1+1) + (1-p) (N_k-1+1) + (1-p) mathbbE(N_k) \[6pt]
          &= N_k-1+1 + (1-p) mathbbE(N_k). \[6pt]
          endaligned endequation$$






          share|cite|improve this answer












          You are conditioning on $N_k-1$, which means you are conditioning on the fact that you have $k-1$ consecutive successes. Let $X sim textBern(p)$ be the outcome of the next trial and consider the cases:



          • If $X=1$ then you now have $k$ consecutive successes;

          • If $X=0$ then you now have $0$ consecutive successes and you have to start all over again.

          Hence, by application of the law-of-total probability you have:



          $$beginequation beginaligned
          mathbbE(N_k|N_k-1)
          &= mathbbP(X=1|N_k-1) mathbbE(N_k|N_k-1,X=1) + mathbbP(X=0|N_k-1) mathbbE(N_k|N_k-1,X=0) \[6pt]
          &= p mathbbE(N_k|N_k-1,X=1) + (1-p) mathbbE(N_k|N_k-1,X=0) \[6pt]
          &= p(N_k-1+1) + (1-p) (N_k-1+1 + mathbbE(N_k)) \[6pt]
          &= p(N_k-1+1) + (1-p) (N_k-1+1) + (1-p) mathbbE(N_k) \[6pt]
          &= N_k-1+1 + (1-p) mathbbE(N_k). \[6pt]
          endaligned endequation$$







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered 3 hours ago









          Ben

          14.9k12179




          14.9k12179











          • Thank you so much. make sense
            – Dihan
            2 hours ago
















          • Thank you so much. make sense
            – Dihan
            2 hours ago















          Thank you so much. make sense
          – Dihan
          2 hours ago




          Thank you so much. make sense
          – Dihan
          2 hours ago












          up vote
          2
          down vote













          I'll give you the basic reasoning here, but you can write it out formally yourself.



          Let $N_k$ be the number of trials necessary to obtain $k$ consecutive successes.



          We want to show



          $$E[ N_k | N_k-1]= N_k-1 + 1 + (1-p)E[N_k]$$



          Firstly, given $N_k-1$, consider the possible values of $N_k-1+1$. If the trial immediately following the $N_k-1$'th trial is a success, then clearly $N_k = N_k-1+1$ with probability $p$.



          Next, suppose the trial following $N_k-1$ is a failure. So that we have $N_k-1+1$ total trails with the last one being a failure. Well, since the last one is a failure, then by the independence of each trial, under this situation we would have the conditional expected number of trials until $k$ consecutive successes as



          $$N_k-1 + 1 + E[N_k]$$



          Since we already have $N_k-1 + 1$ trials, but the last one being a failure "resets" our expectation back to $E[N_k]$.



          Hence you can express the original expectation as



          $$E[ N_k | N_k-1]= p(N_k-1 + 1) + (1-p)(N_k-1 + 1 + E[N_k])$$



          $$=N_k-1 + 1 + (1-p)E[N_k]$$



          This answer uses the law of total expectation: $E[ E[X|Y] ] = E[X]$. Here we take $Y$ as the result of the $N_k-1+1$ trial, and $X$ as $N_k|N_k-1$.






          share|cite|improve this answer










          New contributor




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

















          • Thank you so much
            – Dihan
            2 hours ago














          up vote
          2
          down vote













          I'll give you the basic reasoning here, but you can write it out formally yourself.



          Let $N_k$ be the number of trials necessary to obtain $k$ consecutive successes.



          We want to show



          $$E[ N_k | N_k-1]= N_k-1 + 1 + (1-p)E[N_k]$$



          Firstly, given $N_k-1$, consider the possible values of $N_k-1+1$. If the trial immediately following the $N_k-1$'th trial is a success, then clearly $N_k = N_k-1+1$ with probability $p$.



          Next, suppose the trial following $N_k-1$ is a failure. So that we have $N_k-1+1$ total trails with the last one being a failure. Well, since the last one is a failure, then by the independence of each trial, under this situation we would have the conditional expected number of trials until $k$ consecutive successes as



          $$N_k-1 + 1 + E[N_k]$$



          Since we already have $N_k-1 + 1$ trials, but the last one being a failure "resets" our expectation back to $E[N_k]$.



          Hence you can express the original expectation as



          $$E[ N_k | N_k-1]= p(N_k-1 + 1) + (1-p)(N_k-1 + 1 + E[N_k])$$



          $$=N_k-1 + 1 + (1-p)E[N_k]$$



          This answer uses the law of total expectation: $E[ E[X|Y] ] = E[X]$. Here we take $Y$ as the result of the $N_k-1+1$ trial, and $X$ as $N_k|N_k-1$.






          share|cite|improve this answer










          New contributor




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

















          • Thank you so much
            – Dihan
            2 hours ago












          up vote
          2
          down vote










          up vote
          2
          down vote









          I'll give you the basic reasoning here, but you can write it out formally yourself.



          Let $N_k$ be the number of trials necessary to obtain $k$ consecutive successes.



          We want to show



          $$E[ N_k | N_k-1]= N_k-1 + 1 + (1-p)E[N_k]$$



          Firstly, given $N_k-1$, consider the possible values of $N_k-1+1$. If the trial immediately following the $N_k-1$'th trial is a success, then clearly $N_k = N_k-1+1$ with probability $p$.



          Next, suppose the trial following $N_k-1$ is a failure. So that we have $N_k-1+1$ total trails with the last one being a failure. Well, since the last one is a failure, then by the independence of each trial, under this situation we would have the conditional expected number of trials until $k$ consecutive successes as



          $$N_k-1 + 1 + E[N_k]$$



          Since we already have $N_k-1 + 1$ trials, but the last one being a failure "resets" our expectation back to $E[N_k]$.



          Hence you can express the original expectation as



          $$E[ N_k | N_k-1]= p(N_k-1 + 1) + (1-p)(N_k-1 + 1 + E[N_k])$$



          $$=N_k-1 + 1 + (1-p)E[N_k]$$



          This answer uses the law of total expectation: $E[ E[X|Y] ] = E[X]$. Here we take $Y$ as the result of the $N_k-1+1$ trial, and $X$ as $N_k|N_k-1$.






          share|cite|improve this answer










          New contributor




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









          I'll give you the basic reasoning here, but you can write it out formally yourself.



          Let $N_k$ be the number of trials necessary to obtain $k$ consecutive successes.



          We want to show



          $$E[ N_k | N_k-1]= N_k-1 + 1 + (1-p)E[N_k]$$



          Firstly, given $N_k-1$, consider the possible values of $N_k-1+1$. If the trial immediately following the $N_k-1$'th trial is a success, then clearly $N_k = N_k-1+1$ with probability $p$.



          Next, suppose the trial following $N_k-1$ is a failure. So that we have $N_k-1+1$ total trails with the last one being a failure. Well, since the last one is a failure, then by the independence of each trial, under this situation we would have the conditional expected number of trials until $k$ consecutive successes as



          $$N_k-1 + 1 + E[N_k]$$



          Since we already have $N_k-1 + 1$ trials, but the last one being a failure "resets" our expectation back to $E[N_k]$.



          Hence you can express the original expectation as



          $$E[ N_k | N_k-1]= p(N_k-1 + 1) + (1-p)(N_k-1 + 1 + E[N_k])$$



          $$=N_k-1 + 1 + (1-p)E[N_k]$$



          This answer uses the law of total expectation: $E[ E[X|Y] ] = E[X]$. Here we take $Y$ as the result of the $N_k-1+1$ trial, and $X$ as $N_k|N_k-1$.







          share|cite|improve this answer










          New contributor




          Xiaomi 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 answer



          share|cite|improve this answer








          edited 3 hours ago





















          New contributor




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









          answered 3 hours ago









          Xiaomi

          212




          212




          New contributor




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





          New contributor





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






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











          • Thank you so much
            – Dihan
            2 hours ago
















          • Thank you so much
            – Dihan
            2 hours ago















          Thank you so much
          – Dihan
          2 hours ago




          Thank you so much
          – Dihan
          2 hours ago










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









           

          draft saved


          draft discarded


















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












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











          Dihan 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%2fstats.stackexchange.com%2fquestions%2f368533%2fconditional-probability-for-consecutive-bernoulli-trials%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          List of Gilmore Girls characters

          Confectionery