How many binary sequences of length n are there, such that they contain precisely k 01 pairs? [closed]












0












$begingroup$


How many binary sequences of length n are there, such that they contain precisely k 01 pairs? How to approach it? I have no idea how to deal with it.










share|cite|improve this question









$endgroup$



closed as off-topic by Did, mrtaurho, Saad, Karn Watcharasupat, Lord_Farin Dec 24 '18 at 9:02


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Did, mrtaurho, Saad, Karn Watcharasupat, Lord_Farin

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1




    $begingroup$
    This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc.
    $endgroup$
    – Did
    Dec 23 '18 at 21:35
















0












$begingroup$


How many binary sequences of length n are there, such that they contain precisely k 01 pairs? How to approach it? I have no idea how to deal with it.










share|cite|improve this question









$endgroup$



closed as off-topic by Did, mrtaurho, Saad, Karn Watcharasupat, Lord_Farin Dec 24 '18 at 9:02


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Did, mrtaurho, Saad, Karn Watcharasupat, Lord_Farin

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1




    $begingroup$
    This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc.
    $endgroup$
    – Did
    Dec 23 '18 at 21:35














0












0








0





$begingroup$


How many binary sequences of length n are there, such that they contain precisely k 01 pairs? How to approach it? I have no idea how to deal with it.










share|cite|improve this question









$endgroup$




How many binary sequences of length n are there, such that they contain precisely k 01 pairs? How to approach it? I have no idea how to deal with it.







sequences-and-series combinatorics discrete-mathematics






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Dec 7 '18 at 13:13









lellerleller

221




221




closed as off-topic by Did, mrtaurho, Saad, Karn Watcharasupat, Lord_Farin Dec 24 '18 at 9:02


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Did, mrtaurho, Saad, Karn Watcharasupat, Lord_Farin

If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by Did, mrtaurho, Saad, Karn Watcharasupat, Lord_Farin Dec 24 '18 at 9:02


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Did, mrtaurho, Saad, Karn Watcharasupat, Lord_Farin

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 1




    $begingroup$
    This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc.
    $endgroup$
    – Did
    Dec 23 '18 at 21:35














  • 1




    $begingroup$
    This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc.
    $endgroup$
    – Did
    Dec 23 '18 at 21:35








1




1




$begingroup$
This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc.
$endgroup$
– Did
Dec 23 '18 at 21:35




$begingroup$
This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc.
$endgroup$
– Did
Dec 23 '18 at 21:35










3 Answers
3






active

oldest

votes


















1












$begingroup$

Hint:



A binary sequence of length $n$ that starts with a $0$ and has $k$
$01$ pairs can be represented by a tuple $left(a_{1},dots,a_{m}right)$
where $minleft{ 2k,2k+1right} $ and the $a_{i}$ are positive
integers with $sum_{i=1}^{m}a_{i}=n$.



Examples for $n=11$ and $k=3$:





  • $00101101110$ is represented by $(2,1,1,2,1,3,1)$


  • $00101101111$ is represented by $(2,1,1,2,1,4)$


A binary sequence of length $n$ that starts with a $1$ and has $k$
$01$ pairs can be represented by a tuple $left(a_{1},dots,a_{m}right)$
where $minleft{ 2k+1,2k+2right} $ and the $a_{i}$ are positive
integers with $sum_{i=1}^{m}a_{i}=n$.



Examples for $n=11$ and $k=2$:





  • $11101101110$ is represented by $(3,1,2,1,3,1)$


  • $11101101111$ is represented by $(3,1,2,1,4)$




So to be counted are the number of such sums $sum_{i=1}^{m}a_{i}=n$.



This can be done by applying stars and bars.






share|cite|improve this answer









$endgroup$





















    1












    $begingroup$

    Using $z$ for zeros and $w$ for ones we have from first principles the
    generating function



    $$(1+w+w^2+cdots) sum_{qge 0} (z+z^2+cdots)^q (w+w^2+cdots)^q u^q
    \ times (1+z+z^2+cdots).$$



    Here the variable $u$ marks $01$ pairs. This is



    $$frac{1}{1-w}
    left(sum_{qge 0} frac{z^q}{(1-z)^q} frac{w^q}{(1-w)^q} u^qright)
    frac{1}{1-z}
    \ = frac{1}{1-w}
    frac{1}{1-uzw/(1-z)/(1-w)}
    frac{1}{1-z}
    \ = frac{1}{(1-w)(1-z)-uzw}.$$



    At this point we no longer need the distinction between zeros and
    ones, getting



    $$frac{1}{(1-z)^2-uz^2}.$$



    As a sanity check we should get all of them when we put $u=1$ and
    indeed we have



    $$frac{1}{1-2z+(1-u)z^2} = frac{1}{1-2z},$$



    accounting for all $2^n$ strings. To extract the coefficient we write



    $$frac{1}{(1-z)^2} frac{1}{1-uz^2/(1-z)^2}$$



    so that



    $$[z^n] [u^k]frac{1}{(1-z)^2} frac{1}{1-uz^2/(1-z)^2}
    = [z^n] frac{1}{(1-z)^2} frac{z^{2k}}{(1-z)^{2k}}
    \ = [z^n] frac{z^{2k}}{(1-z)^{2k+2}}
    = [z^{n-2k}] frac{1}{(1-z)^{2k+2}}
    = {n-2k+2k+1choose 2k+1}.$$



    This is



    $$bbox[5px,border:2px solid #00A000]{
    {n+1choose 2k+1}.}$$






    share|cite|improve this answer









    $endgroup$





















      0












      $begingroup$

      HINT



      You are restricting/mandating $k$ pairs in the string to be a $10$ pair ... instead of being just any pair. So, what should be the number of all bit strings of length $n$ containing at least $k$ $10$ pairs compared to the number of all bit strings of length $n$ without any restrictions? And how do you get from that to the number of strings of length $n$ that have exactly $k$ $10$ pairs?






      share|cite|improve this answer











      $endgroup$













      • $begingroup$
        But I need only k number of 01 pairs. I do not understand the hint
        $endgroup$
        – leller
        Dec 7 '18 at 13:21










      • $begingroup$
        @leller Yes, I understand. With the hint, you can figure out how many strings have at least $k$ pairs. But using the same method you can figure out how many strings have at least $k+1$ pairs. And given that, you can figure out how many strings have exactly $k$ pairs.
        $endgroup$
        – Bram28
        Dec 7 '18 at 14:34




















      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1












      $begingroup$

      Hint:



      A binary sequence of length $n$ that starts with a $0$ and has $k$
      $01$ pairs can be represented by a tuple $left(a_{1},dots,a_{m}right)$
      where $minleft{ 2k,2k+1right} $ and the $a_{i}$ are positive
      integers with $sum_{i=1}^{m}a_{i}=n$.



      Examples for $n=11$ and $k=3$:





      • $00101101110$ is represented by $(2,1,1,2,1,3,1)$


      • $00101101111$ is represented by $(2,1,1,2,1,4)$


      A binary sequence of length $n$ that starts with a $1$ and has $k$
      $01$ pairs can be represented by a tuple $left(a_{1},dots,a_{m}right)$
      where $minleft{ 2k+1,2k+2right} $ and the $a_{i}$ are positive
      integers with $sum_{i=1}^{m}a_{i}=n$.



      Examples for $n=11$ and $k=2$:





      • $11101101110$ is represented by $(3,1,2,1,3,1)$


      • $11101101111$ is represented by $(3,1,2,1,4)$




      So to be counted are the number of such sums $sum_{i=1}^{m}a_{i}=n$.



      This can be done by applying stars and bars.






      share|cite|improve this answer









      $endgroup$


















        1












        $begingroup$

        Hint:



        A binary sequence of length $n$ that starts with a $0$ and has $k$
        $01$ pairs can be represented by a tuple $left(a_{1},dots,a_{m}right)$
        where $minleft{ 2k,2k+1right} $ and the $a_{i}$ are positive
        integers with $sum_{i=1}^{m}a_{i}=n$.



        Examples for $n=11$ and $k=3$:





        • $00101101110$ is represented by $(2,1,1,2,1,3,1)$


        • $00101101111$ is represented by $(2,1,1,2,1,4)$


        A binary sequence of length $n$ that starts with a $1$ and has $k$
        $01$ pairs can be represented by a tuple $left(a_{1},dots,a_{m}right)$
        where $minleft{ 2k+1,2k+2right} $ and the $a_{i}$ are positive
        integers with $sum_{i=1}^{m}a_{i}=n$.



        Examples for $n=11$ and $k=2$:





        • $11101101110$ is represented by $(3,1,2,1,3,1)$


        • $11101101111$ is represented by $(3,1,2,1,4)$




        So to be counted are the number of such sums $sum_{i=1}^{m}a_{i}=n$.



        This can be done by applying stars and bars.






        share|cite|improve this answer









        $endgroup$
















          1












          1








          1





          $begingroup$

          Hint:



          A binary sequence of length $n$ that starts with a $0$ and has $k$
          $01$ pairs can be represented by a tuple $left(a_{1},dots,a_{m}right)$
          where $minleft{ 2k,2k+1right} $ and the $a_{i}$ are positive
          integers with $sum_{i=1}^{m}a_{i}=n$.



          Examples for $n=11$ and $k=3$:





          • $00101101110$ is represented by $(2,1,1,2,1,3,1)$


          • $00101101111$ is represented by $(2,1,1,2,1,4)$


          A binary sequence of length $n$ that starts with a $1$ and has $k$
          $01$ pairs can be represented by a tuple $left(a_{1},dots,a_{m}right)$
          where $minleft{ 2k+1,2k+2right} $ and the $a_{i}$ are positive
          integers with $sum_{i=1}^{m}a_{i}=n$.



          Examples for $n=11$ and $k=2$:





          • $11101101110$ is represented by $(3,1,2,1,3,1)$


          • $11101101111$ is represented by $(3,1,2,1,4)$




          So to be counted are the number of such sums $sum_{i=1}^{m}a_{i}=n$.



          This can be done by applying stars and bars.






          share|cite|improve this answer









          $endgroup$



          Hint:



          A binary sequence of length $n$ that starts with a $0$ and has $k$
          $01$ pairs can be represented by a tuple $left(a_{1},dots,a_{m}right)$
          where $minleft{ 2k,2k+1right} $ and the $a_{i}$ are positive
          integers with $sum_{i=1}^{m}a_{i}=n$.



          Examples for $n=11$ and $k=3$:





          • $00101101110$ is represented by $(2,1,1,2,1,3,1)$


          • $00101101111$ is represented by $(2,1,1,2,1,4)$


          A binary sequence of length $n$ that starts with a $1$ and has $k$
          $01$ pairs can be represented by a tuple $left(a_{1},dots,a_{m}right)$
          where $minleft{ 2k+1,2k+2right} $ and the $a_{i}$ are positive
          integers with $sum_{i=1}^{m}a_{i}=n$.



          Examples for $n=11$ and $k=2$:





          • $11101101110$ is represented by $(3,1,2,1,3,1)$


          • $11101101111$ is represented by $(3,1,2,1,4)$




          So to be counted are the number of such sums $sum_{i=1}^{m}a_{i}=n$.



          This can be done by applying stars and bars.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Dec 7 '18 at 14:45









          drhabdrhab

          99.3k544130




          99.3k544130























              1












              $begingroup$

              Using $z$ for zeros and $w$ for ones we have from first principles the
              generating function



              $$(1+w+w^2+cdots) sum_{qge 0} (z+z^2+cdots)^q (w+w^2+cdots)^q u^q
              \ times (1+z+z^2+cdots).$$



              Here the variable $u$ marks $01$ pairs. This is



              $$frac{1}{1-w}
              left(sum_{qge 0} frac{z^q}{(1-z)^q} frac{w^q}{(1-w)^q} u^qright)
              frac{1}{1-z}
              \ = frac{1}{1-w}
              frac{1}{1-uzw/(1-z)/(1-w)}
              frac{1}{1-z}
              \ = frac{1}{(1-w)(1-z)-uzw}.$$



              At this point we no longer need the distinction between zeros and
              ones, getting



              $$frac{1}{(1-z)^2-uz^2}.$$



              As a sanity check we should get all of them when we put $u=1$ and
              indeed we have



              $$frac{1}{1-2z+(1-u)z^2} = frac{1}{1-2z},$$



              accounting for all $2^n$ strings. To extract the coefficient we write



              $$frac{1}{(1-z)^2} frac{1}{1-uz^2/(1-z)^2}$$



              so that



              $$[z^n] [u^k]frac{1}{(1-z)^2} frac{1}{1-uz^2/(1-z)^2}
              = [z^n] frac{1}{(1-z)^2} frac{z^{2k}}{(1-z)^{2k}}
              \ = [z^n] frac{z^{2k}}{(1-z)^{2k+2}}
              = [z^{n-2k}] frac{1}{(1-z)^{2k+2}}
              = {n-2k+2k+1choose 2k+1}.$$



              This is



              $$bbox[5px,border:2px solid #00A000]{
              {n+1choose 2k+1}.}$$






              share|cite|improve this answer









              $endgroup$


















                1












                $begingroup$

                Using $z$ for zeros and $w$ for ones we have from first principles the
                generating function



                $$(1+w+w^2+cdots) sum_{qge 0} (z+z^2+cdots)^q (w+w^2+cdots)^q u^q
                \ times (1+z+z^2+cdots).$$



                Here the variable $u$ marks $01$ pairs. This is



                $$frac{1}{1-w}
                left(sum_{qge 0} frac{z^q}{(1-z)^q} frac{w^q}{(1-w)^q} u^qright)
                frac{1}{1-z}
                \ = frac{1}{1-w}
                frac{1}{1-uzw/(1-z)/(1-w)}
                frac{1}{1-z}
                \ = frac{1}{(1-w)(1-z)-uzw}.$$



                At this point we no longer need the distinction between zeros and
                ones, getting



                $$frac{1}{(1-z)^2-uz^2}.$$



                As a sanity check we should get all of them when we put $u=1$ and
                indeed we have



                $$frac{1}{1-2z+(1-u)z^2} = frac{1}{1-2z},$$



                accounting for all $2^n$ strings. To extract the coefficient we write



                $$frac{1}{(1-z)^2} frac{1}{1-uz^2/(1-z)^2}$$



                so that



                $$[z^n] [u^k]frac{1}{(1-z)^2} frac{1}{1-uz^2/(1-z)^2}
                = [z^n] frac{1}{(1-z)^2} frac{z^{2k}}{(1-z)^{2k}}
                \ = [z^n] frac{z^{2k}}{(1-z)^{2k+2}}
                = [z^{n-2k}] frac{1}{(1-z)^{2k+2}}
                = {n-2k+2k+1choose 2k+1}.$$



                This is



                $$bbox[5px,border:2px solid #00A000]{
                {n+1choose 2k+1}.}$$






                share|cite|improve this answer









                $endgroup$
















                  1












                  1








                  1





                  $begingroup$

                  Using $z$ for zeros and $w$ for ones we have from first principles the
                  generating function



                  $$(1+w+w^2+cdots) sum_{qge 0} (z+z^2+cdots)^q (w+w^2+cdots)^q u^q
                  \ times (1+z+z^2+cdots).$$



                  Here the variable $u$ marks $01$ pairs. This is



                  $$frac{1}{1-w}
                  left(sum_{qge 0} frac{z^q}{(1-z)^q} frac{w^q}{(1-w)^q} u^qright)
                  frac{1}{1-z}
                  \ = frac{1}{1-w}
                  frac{1}{1-uzw/(1-z)/(1-w)}
                  frac{1}{1-z}
                  \ = frac{1}{(1-w)(1-z)-uzw}.$$



                  At this point we no longer need the distinction between zeros and
                  ones, getting



                  $$frac{1}{(1-z)^2-uz^2}.$$



                  As a sanity check we should get all of them when we put $u=1$ and
                  indeed we have



                  $$frac{1}{1-2z+(1-u)z^2} = frac{1}{1-2z},$$



                  accounting for all $2^n$ strings. To extract the coefficient we write



                  $$frac{1}{(1-z)^2} frac{1}{1-uz^2/(1-z)^2}$$



                  so that



                  $$[z^n] [u^k]frac{1}{(1-z)^2} frac{1}{1-uz^2/(1-z)^2}
                  = [z^n] frac{1}{(1-z)^2} frac{z^{2k}}{(1-z)^{2k}}
                  \ = [z^n] frac{z^{2k}}{(1-z)^{2k+2}}
                  = [z^{n-2k}] frac{1}{(1-z)^{2k+2}}
                  = {n-2k+2k+1choose 2k+1}.$$



                  This is



                  $$bbox[5px,border:2px solid #00A000]{
                  {n+1choose 2k+1}.}$$






                  share|cite|improve this answer









                  $endgroup$



                  Using $z$ for zeros and $w$ for ones we have from first principles the
                  generating function



                  $$(1+w+w^2+cdots) sum_{qge 0} (z+z^2+cdots)^q (w+w^2+cdots)^q u^q
                  \ times (1+z+z^2+cdots).$$



                  Here the variable $u$ marks $01$ pairs. This is



                  $$frac{1}{1-w}
                  left(sum_{qge 0} frac{z^q}{(1-z)^q} frac{w^q}{(1-w)^q} u^qright)
                  frac{1}{1-z}
                  \ = frac{1}{1-w}
                  frac{1}{1-uzw/(1-z)/(1-w)}
                  frac{1}{1-z}
                  \ = frac{1}{(1-w)(1-z)-uzw}.$$



                  At this point we no longer need the distinction between zeros and
                  ones, getting



                  $$frac{1}{(1-z)^2-uz^2}.$$



                  As a sanity check we should get all of them when we put $u=1$ and
                  indeed we have



                  $$frac{1}{1-2z+(1-u)z^2} = frac{1}{1-2z},$$



                  accounting for all $2^n$ strings. To extract the coefficient we write



                  $$frac{1}{(1-z)^2} frac{1}{1-uz^2/(1-z)^2}$$



                  so that



                  $$[z^n] [u^k]frac{1}{(1-z)^2} frac{1}{1-uz^2/(1-z)^2}
                  = [z^n] frac{1}{(1-z)^2} frac{z^{2k}}{(1-z)^{2k}}
                  \ = [z^n] frac{z^{2k}}{(1-z)^{2k+2}}
                  = [z^{n-2k}] frac{1}{(1-z)^{2k+2}}
                  = {n-2k+2k+1choose 2k+1}.$$



                  This is



                  $$bbox[5px,border:2px solid #00A000]{
                  {n+1choose 2k+1}.}$$







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Dec 7 '18 at 15:50









                  Marko RiedelMarko Riedel

                  39.5k339108




                  39.5k339108























                      0












                      $begingroup$

                      HINT



                      You are restricting/mandating $k$ pairs in the string to be a $10$ pair ... instead of being just any pair. So, what should be the number of all bit strings of length $n$ containing at least $k$ $10$ pairs compared to the number of all bit strings of length $n$ without any restrictions? And how do you get from that to the number of strings of length $n$ that have exactly $k$ $10$ pairs?






                      share|cite|improve this answer











                      $endgroup$













                      • $begingroup$
                        But I need only k number of 01 pairs. I do not understand the hint
                        $endgroup$
                        – leller
                        Dec 7 '18 at 13:21










                      • $begingroup$
                        @leller Yes, I understand. With the hint, you can figure out how many strings have at least $k$ pairs. But using the same method you can figure out how many strings have at least $k+1$ pairs. And given that, you can figure out how many strings have exactly $k$ pairs.
                        $endgroup$
                        – Bram28
                        Dec 7 '18 at 14:34


















                      0












                      $begingroup$

                      HINT



                      You are restricting/mandating $k$ pairs in the string to be a $10$ pair ... instead of being just any pair. So, what should be the number of all bit strings of length $n$ containing at least $k$ $10$ pairs compared to the number of all bit strings of length $n$ without any restrictions? And how do you get from that to the number of strings of length $n$ that have exactly $k$ $10$ pairs?






                      share|cite|improve this answer











                      $endgroup$













                      • $begingroup$
                        But I need only k number of 01 pairs. I do not understand the hint
                        $endgroup$
                        – leller
                        Dec 7 '18 at 13:21










                      • $begingroup$
                        @leller Yes, I understand. With the hint, you can figure out how many strings have at least $k$ pairs. But using the same method you can figure out how many strings have at least $k+1$ pairs. And given that, you can figure out how many strings have exactly $k$ pairs.
                        $endgroup$
                        – Bram28
                        Dec 7 '18 at 14:34
















                      0












                      0








                      0





                      $begingroup$

                      HINT



                      You are restricting/mandating $k$ pairs in the string to be a $10$ pair ... instead of being just any pair. So, what should be the number of all bit strings of length $n$ containing at least $k$ $10$ pairs compared to the number of all bit strings of length $n$ without any restrictions? And how do you get from that to the number of strings of length $n$ that have exactly $k$ $10$ pairs?






                      share|cite|improve this answer











                      $endgroup$



                      HINT



                      You are restricting/mandating $k$ pairs in the string to be a $10$ pair ... instead of being just any pair. So, what should be the number of all bit strings of length $n$ containing at least $k$ $10$ pairs compared to the number of all bit strings of length $n$ without any restrictions? And how do you get from that to the number of strings of length $n$ that have exactly $k$ $10$ pairs?







                      share|cite|improve this answer














                      share|cite|improve this answer



                      share|cite|improve this answer








                      edited Dec 7 '18 at 13:25

























                      answered Dec 7 '18 at 13:20









                      Bram28Bram28

                      60.6k44590




                      60.6k44590












                      • $begingroup$
                        But I need only k number of 01 pairs. I do not understand the hint
                        $endgroup$
                        – leller
                        Dec 7 '18 at 13:21










                      • $begingroup$
                        @leller Yes, I understand. With the hint, you can figure out how many strings have at least $k$ pairs. But using the same method you can figure out how many strings have at least $k+1$ pairs. And given that, you can figure out how many strings have exactly $k$ pairs.
                        $endgroup$
                        – Bram28
                        Dec 7 '18 at 14:34




















                      • $begingroup$
                        But I need only k number of 01 pairs. I do not understand the hint
                        $endgroup$
                        – leller
                        Dec 7 '18 at 13:21










                      • $begingroup$
                        @leller Yes, I understand. With the hint, you can figure out how many strings have at least $k$ pairs. But using the same method you can figure out how many strings have at least $k+1$ pairs. And given that, you can figure out how many strings have exactly $k$ pairs.
                        $endgroup$
                        – Bram28
                        Dec 7 '18 at 14:34


















                      $begingroup$
                      But I need only k number of 01 pairs. I do not understand the hint
                      $endgroup$
                      – leller
                      Dec 7 '18 at 13:21




                      $begingroup$
                      But I need only k number of 01 pairs. I do not understand the hint
                      $endgroup$
                      – leller
                      Dec 7 '18 at 13:21












                      $begingroup$
                      @leller Yes, I understand. With the hint, you can figure out how many strings have at least $k$ pairs. But using the same method you can figure out how many strings have at least $k+1$ pairs. And given that, you can figure out how many strings have exactly $k$ pairs.
                      $endgroup$
                      – Bram28
                      Dec 7 '18 at 14:34






                      $begingroup$
                      @leller Yes, I understand. With the hint, you can figure out how many strings have at least $k$ pairs. But using the same method you can figure out how many strings have at least $k+1$ pairs. And given that, you can figure out how many strings have exactly $k$ pairs.
                      $endgroup$
                      – Bram28
                      Dec 7 '18 at 14:34





                      Popular posts from this blog

                      To store a contact into the json file from server.js file using a class in NodeJS

                      Redirect URL with Chrome Remote Debugging Android Devices

                      Dieringhausen