Conditional probability for consecutive Bernoulli trials

Multi tool use
Multi tool use

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





























    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

























      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















      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















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Sep 25 at 4:58









      Ben

      15.3k12181




      15.3k12181










      asked Sep 25 at 3:54









      Dihan

      184




      184




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          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
            Sep 25 at 6:17

















          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






















          • Thank you so much
            – Dihan
            Sep 25 at 6:16










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



          );













           

          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
          2
          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
            Sep 25 at 6:17














          up vote
          2
          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
            Sep 25 at 6:17












          up vote
          2
          down vote



          accepted







          up vote
          2
          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 Sep 25 at 4:56









          Ben

          15.3k12181




          15.3k12181











          • Thank you so much. make sense
            – Dihan
            Sep 25 at 6:17
















          • Thank you so much. make sense
            – Dihan
            Sep 25 at 6:17















          Thank you so much. make sense
          – Dihan
          Sep 25 at 6:17




          Thank you so much. make sense
          – Dihan
          Sep 25 at 6:17












          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






















          • Thank you so much
            – Dihan
            Sep 25 at 6:16














          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






















          • Thank you so much
            – Dihan
            Sep 25 at 6:16












          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














          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














          share|cite|improve this answer



          share|cite|improve this answer








          edited Sep 25 at 4:48

























          answered Sep 25 at 4:37









          Xiaomi

          3299




          3299











          • Thank you so much
            – Dihan
            Sep 25 at 6:16
















          • Thank you so much
            – Dihan
            Sep 25 at 6:16















          Thank you so much
          – Dihan
          Sep 25 at 6:16




          Thank you so much
          – Dihan
          Sep 25 at 6:16

















           

          draft saved


          draft discarded















































           


          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













































































          ZtvyxFo 9u2ETdFb3L64m1x2Z,FeW8dhOE KKZ5QV3HT,0nmfnwRqrccq
          id97cuD1ZTo4w2C 9wLVh7zEtzjukaEV,pD7irwdiFH iP47cah0Zl2,Ld4E9dl PTbh8r

          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          How many registers does an x86_64 CPU actually have?

          Displaying single band from multi-band raster using QGIS