Expected number of transitions in a binary sequence












1












$begingroup$


Consider a randomly generated (iid) binary sequence of length $N$. What is the expected number of transitions in that sequence?



A transition occurs when a bit changes from $0$ to $1$ or from $1$ to $0$.



For example, consider the following binary sequence of length $5$.



$$10010$$



There are 3 transitions in the above sequence.










share|cite|improve this question









$endgroup$












  • $begingroup$
    If you're assuming that each bit is $0$ or $1$ with probability $1/2$ each, this needs to be stated explicitly.
    $endgroup$
    – Brian Tung
    Apr 22 '17 at 1:48












  • $begingroup$
    If that's the case, then you can proceed by generating a $N-1$ bit sequence, in which the $k$th bit is $0$ if the $k$th and $k+1$th bits of the original sequence are the same, and $1$ if they're different. Show that this derived sequence also consists of bits that are independently $0$ or $1$ with probability $1/2$ each, and figure out the expected number of $1$'s in the derived sequence.
    $endgroup$
    – Brian Tung
    Apr 22 '17 at 1:50
















1












$begingroup$


Consider a randomly generated (iid) binary sequence of length $N$. What is the expected number of transitions in that sequence?



A transition occurs when a bit changes from $0$ to $1$ or from $1$ to $0$.



For example, consider the following binary sequence of length $5$.



$$10010$$



There are 3 transitions in the above sequence.










share|cite|improve this question









$endgroup$












  • $begingroup$
    If you're assuming that each bit is $0$ or $1$ with probability $1/2$ each, this needs to be stated explicitly.
    $endgroup$
    – Brian Tung
    Apr 22 '17 at 1:48












  • $begingroup$
    If that's the case, then you can proceed by generating a $N-1$ bit sequence, in which the $k$th bit is $0$ if the $k$th and $k+1$th bits of the original sequence are the same, and $1$ if they're different. Show that this derived sequence also consists of bits that are independently $0$ or $1$ with probability $1/2$ each, and figure out the expected number of $1$'s in the derived sequence.
    $endgroup$
    – Brian Tung
    Apr 22 '17 at 1:50














1












1








1





$begingroup$


Consider a randomly generated (iid) binary sequence of length $N$. What is the expected number of transitions in that sequence?



A transition occurs when a bit changes from $0$ to $1$ or from $1$ to $0$.



For example, consider the following binary sequence of length $5$.



$$10010$$



There are 3 transitions in the above sequence.










share|cite|improve this question









$endgroup$




Consider a randomly generated (iid) binary sequence of length $N$. What is the expected number of transitions in that sequence?



A transition occurs when a bit changes from $0$ to $1$ or from $1$ to $0$.



For example, consider the following binary sequence of length $5$.



$$10010$$



There are 3 transitions in the above sequence.







probability combinatorics markov-chains






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Apr 22 '17 at 1:45









JustinJustin

1747




1747












  • $begingroup$
    If you're assuming that each bit is $0$ or $1$ with probability $1/2$ each, this needs to be stated explicitly.
    $endgroup$
    – Brian Tung
    Apr 22 '17 at 1:48












  • $begingroup$
    If that's the case, then you can proceed by generating a $N-1$ bit sequence, in which the $k$th bit is $0$ if the $k$th and $k+1$th bits of the original sequence are the same, and $1$ if they're different. Show that this derived sequence also consists of bits that are independently $0$ or $1$ with probability $1/2$ each, and figure out the expected number of $1$'s in the derived sequence.
    $endgroup$
    – Brian Tung
    Apr 22 '17 at 1:50


















  • $begingroup$
    If you're assuming that each bit is $0$ or $1$ with probability $1/2$ each, this needs to be stated explicitly.
    $endgroup$
    – Brian Tung
    Apr 22 '17 at 1:48












  • $begingroup$
    If that's the case, then you can proceed by generating a $N-1$ bit sequence, in which the $k$th bit is $0$ if the $k$th and $k+1$th bits of the original sequence are the same, and $1$ if they're different. Show that this derived sequence also consists of bits that are independently $0$ or $1$ with probability $1/2$ each, and figure out the expected number of $1$'s in the derived sequence.
    $endgroup$
    – Brian Tung
    Apr 22 '17 at 1:50
















$begingroup$
If you're assuming that each bit is $0$ or $1$ with probability $1/2$ each, this needs to be stated explicitly.
$endgroup$
– Brian Tung
Apr 22 '17 at 1:48






$begingroup$
If you're assuming that each bit is $0$ or $1$ with probability $1/2$ each, this needs to be stated explicitly.
$endgroup$
– Brian Tung
Apr 22 '17 at 1:48














$begingroup$
If that's the case, then you can proceed by generating a $N-1$ bit sequence, in which the $k$th bit is $0$ if the $k$th and $k+1$th bits of the original sequence are the same, and $1$ if they're different. Show that this derived sequence also consists of bits that are independently $0$ or $1$ with probability $1/2$ each, and figure out the expected number of $1$'s in the derived sequence.
$endgroup$
– Brian Tung
Apr 22 '17 at 1:50




$begingroup$
If that's the case, then you can proceed by generating a $N-1$ bit sequence, in which the $k$th bit is $0$ if the $k$th and $k+1$th bits of the original sequence are the same, and $1$ if they're different. Show that this derived sequence also consists of bits that are independently $0$ or $1$ with probability $1/2$ each, and figure out the expected number of $1$'s in the derived sequence.
$endgroup$
– Brian Tung
Apr 22 '17 at 1:50










2 Answers
2






active

oldest

votes


















3












$begingroup$

There are $N-1$ adjacent pairs of bits, and each pair is a transition with probability $frac12$ (or, in general, with probability $2p(1-p)$, where $p$ is the probability of a $1$), so the expected number of transitions is $frac{N-1}{2}$.



In the case where $p = frac12$, the distribution is binomial; in general, it's not, because adjacent transitions are not independent. (Imagine $p=0.01$; then any transition from $0$ to $1$ is overwhelmingly likely to be followed by a transition back to $0$.)






share|cite|improve this answer











$endgroup$





















    1












    $begingroup$

    Assuming the probability of 0 and 1 is equal, and the sequence is memory-less, then the average number of transitions will be (n-1)/2. For each transition for one bit to the next the probability of the next bit being different from the current bit is 1/2, and therefore it counts as 1/2 the transition. For n bits you have (n-1) possible transitions, with a probability of 1/2 for each.






    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%2f2245869%2fexpected-number-of-transitions-in-a-binary-sequence%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3












      $begingroup$

      There are $N-1$ adjacent pairs of bits, and each pair is a transition with probability $frac12$ (or, in general, with probability $2p(1-p)$, where $p$ is the probability of a $1$), so the expected number of transitions is $frac{N-1}{2}$.



      In the case where $p = frac12$, the distribution is binomial; in general, it's not, because adjacent transitions are not independent. (Imagine $p=0.01$; then any transition from $0$ to $1$ is overwhelmingly likely to be followed by a transition back to $0$.)






      share|cite|improve this answer











      $endgroup$


















        3












        $begingroup$

        There are $N-1$ adjacent pairs of bits, and each pair is a transition with probability $frac12$ (or, in general, with probability $2p(1-p)$, where $p$ is the probability of a $1$), so the expected number of transitions is $frac{N-1}{2}$.



        In the case where $p = frac12$, the distribution is binomial; in general, it's not, because adjacent transitions are not independent. (Imagine $p=0.01$; then any transition from $0$ to $1$ is overwhelmingly likely to be followed by a transition back to $0$.)






        share|cite|improve this answer











        $endgroup$
















          3












          3








          3





          $begingroup$

          There are $N-1$ adjacent pairs of bits, and each pair is a transition with probability $frac12$ (or, in general, with probability $2p(1-p)$, where $p$ is the probability of a $1$), so the expected number of transitions is $frac{N-1}{2}$.



          In the case where $p = frac12$, the distribution is binomial; in general, it's not, because adjacent transitions are not independent. (Imagine $p=0.01$; then any transition from $0$ to $1$ is overwhelmingly likely to be followed by a transition back to $0$.)






          share|cite|improve this answer











          $endgroup$



          There are $N-1$ adjacent pairs of bits, and each pair is a transition with probability $frac12$ (or, in general, with probability $2p(1-p)$, where $p$ is the probability of a $1$), so the expected number of transitions is $frac{N-1}{2}$.



          In the case where $p = frac12$, the distribution is binomial; in general, it's not, because adjacent transitions are not independent. (Imagine $p=0.01$; then any transition from $0$ to $1$ is overwhelmingly likely to be followed by a transition back to $0$.)







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Apr 22 '17 at 2:04

























          answered Apr 22 '17 at 1:49









          Misha LavrovMisha Lavrov

          47.9k657107




          47.9k657107























              1












              $begingroup$

              Assuming the probability of 0 and 1 is equal, and the sequence is memory-less, then the average number of transitions will be (n-1)/2. For each transition for one bit to the next the probability of the next bit being different from the current bit is 1/2, and therefore it counts as 1/2 the transition. For n bits you have (n-1) possible transitions, with a probability of 1/2 for each.






              share|cite|improve this answer









              $endgroup$


















                1












                $begingroup$

                Assuming the probability of 0 and 1 is equal, and the sequence is memory-less, then the average number of transitions will be (n-1)/2. For each transition for one bit to the next the probability of the next bit being different from the current bit is 1/2, and therefore it counts as 1/2 the transition. For n bits you have (n-1) possible transitions, with a probability of 1/2 for each.






                share|cite|improve this answer









                $endgroup$
















                  1












                  1








                  1





                  $begingroup$

                  Assuming the probability of 0 and 1 is equal, and the sequence is memory-less, then the average number of transitions will be (n-1)/2. For each transition for one bit to the next the probability of the next bit being different from the current bit is 1/2, and therefore it counts as 1/2 the transition. For n bits you have (n-1) possible transitions, with a probability of 1/2 for each.






                  share|cite|improve this answer









                  $endgroup$



                  Assuming the probability of 0 and 1 is equal, and the sequence is memory-less, then the average number of transitions will be (n-1)/2. For each transition for one bit to the next the probability of the next bit being different from the current bit is 1/2, and therefore it counts as 1/2 the transition. For n bits you have (n-1) possible transitions, with a probability of 1/2 for each.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Jan 27 at 8:03









                  Yishai KaganYishai Kagan

                  111




                  111






























                      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%2f2245869%2fexpected-number-of-transitions-in-a-binary-sequence%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

                      'app-layout' is not a known element: how to share Component with different Modules

                      android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

                      WPF add header to Image with URL pettitions [duplicate]