Find the generating function for the number of ways to climb n stairs












0












$begingroup$



Problem : Write the recurrence relation for the sequence $left( a _ { 0 } , a _ { 1 } , ldots right)$ where $a _ { n }$ is the number of ways we can climb $n$ stairs so that in each step we climb 1 or 3 stairs. Write the generating function for this sequence.







Solution : The recurrence relation is $a_{n+3} = a_{n+2} + a_n$. The sequence we obtain as $left( c _ { n } right) -$ $left( b _ { n } right) - left( a _ { n } right) ,$ where $left( c _ { n } right)$ is $left( a _ { n } right)$ shifted to the right by $3 ,$ and $left( b _ { n } right)$ is $left( a _ { n } right)$ shifted to the right by 1 is $( - 1,0,0,0 , ldots )$. Thus, $x ^ { 3 } F ( x ) - x ^ { 2 } F ( x ) - F ( x ) = - 1 ,$ and hence, $F ( x ) = frac { 1 } { 1 - x ^ { 2 } - x ^ { 3 } }$




I don't seem to understand why $c_n$ is $a_n$ shifted to the right by 3, and $b_n$ is $a_n$ shifted to the right by 1. Furthermore I don't understand why the sequence would be $( - 1,0,0,0 , ldots )$.










share|cite|improve this question









$endgroup$

















    0












    $begingroup$



    Problem : Write the recurrence relation for the sequence $left( a _ { 0 } , a _ { 1 } , ldots right)$ where $a _ { n }$ is the number of ways we can climb $n$ stairs so that in each step we climb 1 or 3 stairs. Write the generating function for this sequence.







    Solution : The recurrence relation is $a_{n+3} = a_{n+2} + a_n$. The sequence we obtain as $left( c _ { n } right) -$ $left( b _ { n } right) - left( a _ { n } right) ,$ where $left( c _ { n } right)$ is $left( a _ { n } right)$ shifted to the right by $3 ,$ and $left( b _ { n } right)$ is $left( a _ { n } right)$ shifted to the right by 1 is $( - 1,0,0,0 , ldots )$. Thus, $x ^ { 3 } F ( x ) - x ^ { 2 } F ( x ) - F ( x ) = - 1 ,$ and hence, $F ( x ) = frac { 1 } { 1 - x ^ { 2 } - x ^ { 3 } }$




    I don't seem to understand why $c_n$ is $a_n$ shifted to the right by 3, and $b_n$ is $a_n$ shifted to the right by 1. Furthermore I don't understand why the sequence would be $( - 1,0,0,0 , ldots )$.










    share|cite|improve this question









    $endgroup$















      0












      0








      0


      0



      $begingroup$



      Problem : Write the recurrence relation for the sequence $left( a _ { 0 } , a _ { 1 } , ldots right)$ where $a _ { n }$ is the number of ways we can climb $n$ stairs so that in each step we climb 1 or 3 stairs. Write the generating function for this sequence.







      Solution : The recurrence relation is $a_{n+3} = a_{n+2} + a_n$. The sequence we obtain as $left( c _ { n } right) -$ $left( b _ { n } right) - left( a _ { n } right) ,$ where $left( c _ { n } right)$ is $left( a _ { n } right)$ shifted to the right by $3 ,$ and $left( b _ { n } right)$ is $left( a _ { n } right)$ shifted to the right by 1 is $( - 1,0,0,0 , ldots )$. Thus, $x ^ { 3 } F ( x ) - x ^ { 2 } F ( x ) - F ( x ) = - 1 ,$ and hence, $F ( x ) = frac { 1 } { 1 - x ^ { 2 } - x ^ { 3 } }$




      I don't seem to understand why $c_n$ is $a_n$ shifted to the right by 3, and $b_n$ is $a_n$ shifted to the right by 1. Furthermore I don't understand why the sequence would be $( - 1,0,0,0 , ldots )$.










      share|cite|improve this question









      $endgroup$





      Problem : Write the recurrence relation for the sequence $left( a _ { 0 } , a _ { 1 } , ldots right)$ where $a _ { n }$ is the number of ways we can climb $n$ stairs so that in each step we climb 1 or 3 stairs. Write the generating function for this sequence.







      Solution : The recurrence relation is $a_{n+3} = a_{n+2} + a_n$. The sequence we obtain as $left( c _ { n } right) -$ $left( b _ { n } right) - left( a _ { n } right) ,$ where $left( c _ { n } right)$ is $left( a _ { n } right)$ shifted to the right by $3 ,$ and $left( b _ { n } right)$ is $left( a _ { n } right)$ shifted to the right by 1 is $( - 1,0,0,0 , ldots )$. Thus, $x ^ { 3 } F ( x ) - x ^ { 2 } F ( x ) - F ( x ) = - 1 ,$ and hence, $F ( x ) = frac { 1 } { 1 - x ^ { 2 } - x ^ { 3 } }$




      I don't seem to understand why $c_n$ is $a_n$ shifted to the right by 3, and $b_n$ is $a_n$ shifted to the right by 1. Furthermore I don't understand why the sequence would be $( - 1,0,0,0 , ldots )$.







      combinatorics discrete-mathematics permutations






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Dec 23 '18 at 14:22









      NotAbelianGroupNotAbelianGroup

      20911




      20911






















          2 Answers
          2






          active

          oldest

          votes


















          2












          $begingroup$

          We can write the recurrence relation as
          $$
          a_n=a_{n-1}+a_{n-3}quad (a_0=1, a_1=1,a_2=1)
          $$

          for $ngeq 3$. We can make the change of index $nto n+3$ to rewrite the recurrence relation as
          $$
          a_{n+3}=a_{n+2}+a_nquad (nge 0).tag{1}
          $$

          At this point multiply both sides of (1) by $x^n$ and sum on $ngeq 0$ (where we put $A(x)=sum_{n=0}^infty a_n x^n$ to get that
          $$
          frac{A(x)-a_0-a_1x-a_2x^2}{x^3}=frac{A(x)-a_0-a_1x}{x^2}+A(x)
          $$

          Solve for $A(x)$ to get that
          $$
          A(x)=frac{1}{1-x-x^3}.
          $$

          Note that this answer makes sense the problem is equivalent to the number of ways to write $n$ as an ordered sum of ones and threes and this formulation is also apparent from writing
          $$
          A(x)=frac{1}{1-(x+x^3)}=sum_{m=0}^infty (x+x^3)^m.
          $$

          and taking the coefficient of $x^n$ of the RHS.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            Thank you for your clear answer. Do you have an idea why the generating sequence would be (-1, 0, 0, 0, ...) ? $a_0 = 1$ (one way to climb 0 stairs), $a_1 = 1$ (one way to climb one stairs), etc. Then the generating sequence is ($a_0$, $a_1 - a_0$, $a_2$ - $a_1$, $a_3 - a_2 - a_0$, ...) which is (1,0,0,0,...) and not (-1,0,0,0,...)
            $endgroup$
            – NotAbelianGroup
            Dec 23 '18 at 16:58





















          1












          $begingroup$

          The point is that you can go in step of ones up to any $n$.

          So you can go to $n+3$ from $n+2$ in only one way: through a step of 1.

          You can also go to $n+3$ from $n$ with a step of 3, but you shall not add the possibility
          to go there by three consecutive 1-steps, because this way is already accounted in the sequence
          $n to n+1 to n+2 to n+3$.
          Thus the recurrence is actually
          $$
          a_{,n + 3} = a_{,n + 2} + a_{,n}
          $$



          But the construction reported is obscure to me as well. I would do in the following way.



          Being a third grade recurrence, you need to fix three initial conditions.

          These shall be
          $$
          a_{,n} = 0quad left| {,n le 0} right.quad a_{,1} = 1quad a_{,2} = 1quad a_{,3} = 2
          $$

          and the recurrence shall be better written so as to include the initial conditions as
          $$
          a_{,n} = a_{,n - 1} + a_{,n - 3} + left[ {n = 1} right] + left[ {n = 3} right]quad left| {;0 le n} right.
          $$

          where $[P]$ denotes the Iverson bracket
          $$
          left[ P right] = left{ {begin{array}{*{20}c}
          1 & {P = TRUE} \
          0 & {P = FALSE} \
          end{array} } right.
          $$



          Then
          $$
          eqalign{
          & 0 = sumlimits_{0, le ,n} {a_{,n} ,x^{,n} } - sumlimits_{0, le ,n} {a_{,n - 1} ,x^{,n} } - sumlimits_{0, le ,n} {a_{,n - 3} ,x^{,n} }
          - sumlimits_{0, le ,n} {left[ {n = 1} right],x^{,n} } - sumlimits_{0, le ,n} {left[ {n = 3} right],x^{,n} } = cr
          & = G(x) - xsumlimits_{0, le ,n} {a_{,n - 1} ,x^{,n - 1} } - x^{,3} sumlimits_{0, le ,n} {a_{,n - 3} ,x^{,n - 3} } - x - x^{,3} = cr
          & = G(x)left( {1 - x - 2x^{,3} } right) - x - x^{,3} quad Rightarrow cr
          & Rightarrow quad G(x) = {{x + x^{,3} } over {1 - x - x^{,3} }} = {1 over {1 - left( {x + x^{,3} } right)}} - 1quad Rightarrow cr
          & Rightarrow quad left{ {a_{,n} } right}
          = left{ {{rm 0}{rm , 1}{rm , 1}{rm , 2}{rm , 3}{rm , 4}{rm , 6}{rm , 9}{rm , 13}{rm , 19}{rm , 28}{rm , 41}{rm , } cdots } right} cr}
          $$



          So that the given $F(x)$ equals $G(x)+1$






          share|cite|improve this answer









          $endgroup$














            Your Answer








            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%2f3050378%2ffind-the-generating-function-for-the-number-of-ways-to-climb-n-stairs%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









            2












            $begingroup$

            We can write the recurrence relation as
            $$
            a_n=a_{n-1}+a_{n-3}quad (a_0=1, a_1=1,a_2=1)
            $$

            for $ngeq 3$. We can make the change of index $nto n+3$ to rewrite the recurrence relation as
            $$
            a_{n+3}=a_{n+2}+a_nquad (nge 0).tag{1}
            $$

            At this point multiply both sides of (1) by $x^n$ and sum on $ngeq 0$ (where we put $A(x)=sum_{n=0}^infty a_n x^n$ to get that
            $$
            frac{A(x)-a_0-a_1x-a_2x^2}{x^3}=frac{A(x)-a_0-a_1x}{x^2}+A(x)
            $$

            Solve for $A(x)$ to get that
            $$
            A(x)=frac{1}{1-x-x^3}.
            $$

            Note that this answer makes sense the problem is equivalent to the number of ways to write $n$ as an ordered sum of ones and threes and this formulation is also apparent from writing
            $$
            A(x)=frac{1}{1-(x+x^3)}=sum_{m=0}^infty (x+x^3)^m.
            $$

            and taking the coefficient of $x^n$ of the RHS.






            share|cite|improve this answer









            $endgroup$













            • $begingroup$
              Thank you for your clear answer. Do you have an idea why the generating sequence would be (-1, 0, 0, 0, ...) ? $a_0 = 1$ (one way to climb 0 stairs), $a_1 = 1$ (one way to climb one stairs), etc. Then the generating sequence is ($a_0$, $a_1 - a_0$, $a_2$ - $a_1$, $a_3 - a_2 - a_0$, ...) which is (1,0,0,0,...) and not (-1,0,0,0,...)
              $endgroup$
              – NotAbelianGroup
              Dec 23 '18 at 16:58


















            2












            $begingroup$

            We can write the recurrence relation as
            $$
            a_n=a_{n-1}+a_{n-3}quad (a_0=1, a_1=1,a_2=1)
            $$

            for $ngeq 3$. We can make the change of index $nto n+3$ to rewrite the recurrence relation as
            $$
            a_{n+3}=a_{n+2}+a_nquad (nge 0).tag{1}
            $$

            At this point multiply both sides of (1) by $x^n$ and sum on $ngeq 0$ (where we put $A(x)=sum_{n=0}^infty a_n x^n$ to get that
            $$
            frac{A(x)-a_0-a_1x-a_2x^2}{x^3}=frac{A(x)-a_0-a_1x}{x^2}+A(x)
            $$

            Solve for $A(x)$ to get that
            $$
            A(x)=frac{1}{1-x-x^3}.
            $$

            Note that this answer makes sense the problem is equivalent to the number of ways to write $n$ as an ordered sum of ones and threes and this formulation is also apparent from writing
            $$
            A(x)=frac{1}{1-(x+x^3)}=sum_{m=0}^infty (x+x^3)^m.
            $$

            and taking the coefficient of $x^n$ of the RHS.






            share|cite|improve this answer









            $endgroup$













            • $begingroup$
              Thank you for your clear answer. Do you have an idea why the generating sequence would be (-1, 0, 0, 0, ...) ? $a_0 = 1$ (one way to climb 0 stairs), $a_1 = 1$ (one way to climb one stairs), etc. Then the generating sequence is ($a_0$, $a_1 - a_0$, $a_2$ - $a_1$, $a_3 - a_2 - a_0$, ...) which is (1,0,0,0,...) and not (-1,0,0,0,...)
              $endgroup$
              – NotAbelianGroup
              Dec 23 '18 at 16:58
















            2












            2








            2





            $begingroup$

            We can write the recurrence relation as
            $$
            a_n=a_{n-1}+a_{n-3}quad (a_0=1, a_1=1,a_2=1)
            $$

            for $ngeq 3$. We can make the change of index $nto n+3$ to rewrite the recurrence relation as
            $$
            a_{n+3}=a_{n+2}+a_nquad (nge 0).tag{1}
            $$

            At this point multiply both sides of (1) by $x^n$ and sum on $ngeq 0$ (where we put $A(x)=sum_{n=0}^infty a_n x^n$ to get that
            $$
            frac{A(x)-a_0-a_1x-a_2x^2}{x^3}=frac{A(x)-a_0-a_1x}{x^2}+A(x)
            $$

            Solve for $A(x)$ to get that
            $$
            A(x)=frac{1}{1-x-x^3}.
            $$

            Note that this answer makes sense the problem is equivalent to the number of ways to write $n$ as an ordered sum of ones and threes and this formulation is also apparent from writing
            $$
            A(x)=frac{1}{1-(x+x^3)}=sum_{m=0}^infty (x+x^3)^m.
            $$

            and taking the coefficient of $x^n$ of the RHS.






            share|cite|improve this answer









            $endgroup$



            We can write the recurrence relation as
            $$
            a_n=a_{n-1}+a_{n-3}quad (a_0=1, a_1=1,a_2=1)
            $$

            for $ngeq 3$. We can make the change of index $nto n+3$ to rewrite the recurrence relation as
            $$
            a_{n+3}=a_{n+2}+a_nquad (nge 0).tag{1}
            $$

            At this point multiply both sides of (1) by $x^n$ and sum on $ngeq 0$ (where we put $A(x)=sum_{n=0}^infty a_n x^n$ to get that
            $$
            frac{A(x)-a_0-a_1x-a_2x^2}{x^3}=frac{A(x)-a_0-a_1x}{x^2}+A(x)
            $$

            Solve for $A(x)$ to get that
            $$
            A(x)=frac{1}{1-x-x^3}.
            $$

            Note that this answer makes sense the problem is equivalent to the number of ways to write $n$ as an ordered sum of ones and threes and this formulation is also apparent from writing
            $$
            A(x)=frac{1}{1-(x+x^3)}=sum_{m=0}^infty (x+x^3)^m.
            $$

            and taking the coefficient of $x^n$ of the RHS.







            share|cite|improve this answer












            share|cite|improve this answer



            share|cite|improve this answer










            answered Dec 23 '18 at 16:39









            Foobaz JohnFoobaz John

            23k41552




            23k41552












            • $begingroup$
              Thank you for your clear answer. Do you have an idea why the generating sequence would be (-1, 0, 0, 0, ...) ? $a_0 = 1$ (one way to climb 0 stairs), $a_1 = 1$ (one way to climb one stairs), etc. Then the generating sequence is ($a_0$, $a_1 - a_0$, $a_2$ - $a_1$, $a_3 - a_2 - a_0$, ...) which is (1,0,0,0,...) and not (-1,0,0,0,...)
              $endgroup$
              – NotAbelianGroup
              Dec 23 '18 at 16:58




















            • $begingroup$
              Thank you for your clear answer. Do you have an idea why the generating sequence would be (-1, 0, 0, 0, ...) ? $a_0 = 1$ (one way to climb 0 stairs), $a_1 = 1$ (one way to climb one stairs), etc. Then the generating sequence is ($a_0$, $a_1 - a_0$, $a_2$ - $a_1$, $a_3 - a_2 - a_0$, ...) which is (1,0,0,0,...) and not (-1,0,0,0,...)
              $endgroup$
              – NotAbelianGroup
              Dec 23 '18 at 16:58


















            $begingroup$
            Thank you for your clear answer. Do you have an idea why the generating sequence would be (-1, 0, 0, 0, ...) ? $a_0 = 1$ (one way to climb 0 stairs), $a_1 = 1$ (one way to climb one stairs), etc. Then the generating sequence is ($a_0$, $a_1 - a_0$, $a_2$ - $a_1$, $a_3 - a_2 - a_0$, ...) which is (1,0,0,0,...) and not (-1,0,0,0,...)
            $endgroup$
            – NotAbelianGroup
            Dec 23 '18 at 16:58






            $begingroup$
            Thank you for your clear answer. Do you have an idea why the generating sequence would be (-1, 0, 0, 0, ...) ? $a_0 = 1$ (one way to climb 0 stairs), $a_1 = 1$ (one way to climb one stairs), etc. Then the generating sequence is ($a_0$, $a_1 - a_0$, $a_2$ - $a_1$, $a_3 - a_2 - a_0$, ...) which is (1,0,0,0,...) and not (-1,0,0,0,...)
            $endgroup$
            – NotAbelianGroup
            Dec 23 '18 at 16:58













            1












            $begingroup$

            The point is that you can go in step of ones up to any $n$.

            So you can go to $n+3$ from $n+2$ in only one way: through a step of 1.

            You can also go to $n+3$ from $n$ with a step of 3, but you shall not add the possibility
            to go there by three consecutive 1-steps, because this way is already accounted in the sequence
            $n to n+1 to n+2 to n+3$.
            Thus the recurrence is actually
            $$
            a_{,n + 3} = a_{,n + 2} + a_{,n}
            $$



            But the construction reported is obscure to me as well. I would do in the following way.



            Being a third grade recurrence, you need to fix three initial conditions.

            These shall be
            $$
            a_{,n} = 0quad left| {,n le 0} right.quad a_{,1} = 1quad a_{,2} = 1quad a_{,3} = 2
            $$

            and the recurrence shall be better written so as to include the initial conditions as
            $$
            a_{,n} = a_{,n - 1} + a_{,n - 3} + left[ {n = 1} right] + left[ {n = 3} right]quad left| {;0 le n} right.
            $$

            where $[P]$ denotes the Iverson bracket
            $$
            left[ P right] = left{ {begin{array}{*{20}c}
            1 & {P = TRUE} \
            0 & {P = FALSE} \
            end{array} } right.
            $$



            Then
            $$
            eqalign{
            & 0 = sumlimits_{0, le ,n} {a_{,n} ,x^{,n} } - sumlimits_{0, le ,n} {a_{,n - 1} ,x^{,n} } - sumlimits_{0, le ,n} {a_{,n - 3} ,x^{,n} }
            - sumlimits_{0, le ,n} {left[ {n = 1} right],x^{,n} } - sumlimits_{0, le ,n} {left[ {n = 3} right],x^{,n} } = cr
            & = G(x) - xsumlimits_{0, le ,n} {a_{,n - 1} ,x^{,n - 1} } - x^{,3} sumlimits_{0, le ,n} {a_{,n - 3} ,x^{,n - 3} } - x - x^{,3} = cr
            & = G(x)left( {1 - x - 2x^{,3} } right) - x - x^{,3} quad Rightarrow cr
            & Rightarrow quad G(x) = {{x + x^{,3} } over {1 - x - x^{,3} }} = {1 over {1 - left( {x + x^{,3} } right)}} - 1quad Rightarrow cr
            & Rightarrow quad left{ {a_{,n} } right}
            = left{ {{rm 0}{rm , 1}{rm , 1}{rm , 2}{rm , 3}{rm , 4}{rm , 6}{rm , 9}{rm , 13}{rm , 19}{rm , 28}{rm , 41}{rm , } cdots } right} cr}
            $$



            So that the given $F(x)$ equals $G(x)+1$






            share|cite|improve this answer









            $endgroup$


















              1












              $begingroup$

              The point is that you can go in step of ones up to any $n$.

              So you can go to $n+3$ from $n+2$ in only one way: through a step of 1.

              You can also go to $n+3$ from $n$ with a step of 3, but you shall not add the possibility
              to go there by three consecutive 1-steps, because this way is already accounted in the sequence
              $n to n+1 to n+2 to n+3$.
              Thus the recurrence is actually
              $$
              a_{,n + 3} = a_{,n + 2} + a_{,n}
              $$



              But the construction reported is obscure to me as well. I would do in the following way.



              Being a third grade recurrence, you need to fix three initial conditions.

              These shall be
              $$
              a_{,n} = 0quad left| {,n le 0} right.quad a_{,1} = 1quad a_{,2} = 1quad a_{,3} = 2
              $$

              and the recurrence shall be better written so as to include the initial conditions as
              $$
              a_{,n} = a_{,n - 1} + a_{,n - 3} + left[ {n = 1} right] + left[ {n = 3} right]quad left| {;0 le n} right.
              $$

              where $[P]$ denotes the Iverson bracket
              $$
              left[ P right] = left{ {begin{array}{*{20}c}
              1 & {P = TRUE} \
              0 & {P = FALSE} \
              end{array} } right.
              $$



              Then
              $$
              eqalign{
              & 0 = sumlimits_{0, le ,n} {a_{,n} ,x^{,n} } - sumlimits_{0, le ,n} {a_{,n - 1} ,x^{,n} } - sumlimits_{0, le ,n} {a_{,n - 3} ,x^{,n} }
              - sumlimits_{0, le ,n} {left[ {n = 1} right],x^{,n} } - sumlimits_{0, le ,n} {left[ {n = 3} right],x^{,n} } = cr
              & = G(x) - xsumlimits_{0, le ,n} {a_{,n - 1} ,x^{,n - 1} } - x^{,3} sumlimits_{0, le ,n} {a_{,n - 3} ,x^{,n - 3} } - x - x^{,3} = cr
              & = G(x)left( {1 - x - 2x^{,3} } right) - x - x^{,3} quad Rightarrow cr
              & Rightarrow quad G(x) = {{x + x^{,3} } over {1 - x - x^{,3} }} = {1 over {1 - left( {x + x^{,3} } right)}} - 1quad Rightarrow cr
              & Rightarrow quad left{ {a_{,n} } right}
              = left{ {{rm 0}{rm , 1}{rm , 1}{rm , 2}{rm , 3}{rm , 4}{rm , 6}{rm , 9}{rm , 13}{rm , 19}{rm , 28}{rm , 41}{rm , } cdots } right} cr}
              $$



              So that the given $F(x)$ equals $G(x)+1$






              share|cite|improve this answer









              $endgroup$
















                1












                1








                1





                $begingroup$

                The point is that you can go in step of ones up to any $n$.

                So you can go to $n+3$ from $n+2$ in only one way: through a step of 1.

                You can also go to $n+3$ from $n$ with a step of 3, but you shall not add the possibility
                to go there by three consecutive 1-steps, because this way is already accounted in the sequence
                $n to n+1 to n+2 to n+3$.
                Thus the recurrence is actually
                $$
                a_{,n + 3} = a_{,n + 2} + a_{,n}
                $$



                But the construction reported is obscure to me as well. I would do in the following way.



                Being a third grade recurrence, you need to fix three initial conditions.

                These shall be
                $$
                a_{,n} = 0quad left| {,n le 0} right.quad a_{,1} = 1quad a_{,2} = 1quad a_{,3} = 2
                $$

                and the recurrence shall be better written so as to include the initial conditions as
                $$
                a_{,n} = a_{,n - 1} + a_{,n - 3} + left[ {n = 1} right] + left[ {n = 3} right]quad left| {;0 le n} right.
                $$

                where $[P]$ denotes the Iverson bracket
                $$
                left[ P right] = left{ {begin{array}{*{20}c}
                1 & {P = TRUE} \
                0 & {P = FALSE} \
                end{array} } right.
                $$



                Then
                $$
                eqalign{
                & 0 = sumlimits_{0, le ,n} {a_{,n} ,x^{,n} } - sumlimits_{0, le ,n} {a_{,n - 1} ,x^{,n} } - sumlimits_{0, le ,n} {a_{,n - 3} ,x^{,n} }
                - sumlimits_{0, le ,n} {left[ {n = 1} right],x^{,n} } - sumlimits_{0, le ,n} {left[ {n = 3} right],x^{,n} } = cr
                & = G(x) - xsumlimits_{0, le ,n} {a_{,n - 1} ,x^{,n - 1} } - x^{,3} sumlimits_{0, le ,n} {a_{,n - 3} ,x^{,n - 3} } - x - x^{,3} = cr
                & = G(x)left( {1 - x - 2x^{,3} } right) - x - x^{,3} quad Rightarrow cr
                & Rightarrow quad G(x) = {{x + x^{,3} } over {1 - x - x^{,3} }} = {1 over {1 - left( {x + x^{,3} } right)}} - 1quad Rightarrow cr
                & Rightarrow quad left{ {a_{,n} } right}
                = left{ {{rm 0}{rm , 1}{rm , 1}{rm , 2}{rm , 3}{rm , 4}{rm , 6}{rm , 9}{rm , 13}{rm , 19}{rm , 28}{rm , 41}{rm , } cdots } right} cr}
                $$



                So that the given $F(x)$ equals $G(x)+1$






                share|cite|improve this answer









                $endgroup$



                The point is that you can go in step of ones up to any $n$.

                So you can go to $n+3$ from $n+2$ in only one way: through a step of 1.

                You can also go to $n+3$ from $n$ with a step of 3, but you shall not add the possibility
                to go there by three consecutive 1-steps, because this way is already accounted in the sequence
                $n to n+1 to n+2 to n+3$.
                Thus the recurrence is actually
                $$
                a_{,n + 3} = a_{,n + 2} + a_{,n}
                $$



                But the construction reported is obscure to me as well. I would do in the following way.



                Being a third grade recurrence, you need to fix three initial conditions.

                These shall be
                $$
                a_{,n} = 0quad left| {,n le 0} right.quad a_{,1} = 1quad a_{,2} = 1quad a_{,3} = 2
                $$

                and the recurrence shall be better written so as to include the initial conditions as
                $$
                a_{,n} = a_{,n - 1} + a_{,n - 3} + left[ {n = 1} right] + left[ {n = 3} right]quad left| {;0 le n} right.
                $$

                where $[P]$ denotes the Iverson bracket
                $$
                left[ P right] = left{ {begin{array}{*{20}c}
                1 & {P = TRUE} \
                0 & {P = FALSE} \
                end{array} } right.
                $$



                Then
                $$
                eqalign{
                & 0 = sumlimits_{0, le ,n} {a_{,n} ,x^{,n} } - sumlimits_{0, le ,n} {a_{,n - 1} ,x^{,n} } - sumlimits_{0, le ,n} {a_{,n - 3} ,x^{,n} }
                - sumlimits_{0, le ,n} {left[ {n = 1} right],x^{,n} } - sumlimits_{0, le ,n} {left[ {n = 3} right],x^{,n} } = cr
                & = G(x) - xsumlimits_{0, le ,n} {a_{,n - 1} ,x^{,n - 1} } - x^{,3} sumlimits_{0, le ,n} {a_{,n - 3} ,x^{,n - 3} } - x - x^{,3} = cr
                & = G(x)left( {1 - x - 2x^{,3} } right) - x - x^{,3} quad Rightarrow cr
                & Rightarrow quad G(x) = {{x + x^{,3} } over {1 - x - x^{,3} }} = {1 over {1 - left( {x + x^{,3} } right)}} - 1quad Rightarrow cr
                & Rightarrow quad left{ {a_{,n} } right}
                = left{ {{rm 0}{rm , 1}{rm , 1}{rm , 2}{rm , 3}{rm , 4}{rm , 6}{rm , 9}{rm , 13}{rm , 19}{rm , 28}{rm , 41}{rm , } cdots } right} cr}
                $$



                So that the given $F(x)$ equals $G(x)+1$







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Dec 23 '18 at 17:33









                G CabG Cab

                20.5k31342




                20.5k31342






























                    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%2f3050378%2ffind-the-generating-function-for-the-number-of-ways-to-climb-n-stairs%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

                    Plaza Victoria

                    In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

                    How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...