Finding the generating function for the Catalan number sequence











up vote
2
down vote

favorite












I know that generating function for the Catalan number sequence is $$f(x) = frac{1 -sqrt{4x}}{2x}$$ but I wan to prove it.



So the sequence for the Catalan numbers is $$1,1,2,5,14....$$ as we all know.



Now I have to find a generating function that generates this sequence.



I read that we can prove it this way: Asssume that $f(x)$ is the generating function for the Catalan sequence then by the Cauchy product rule it can be shown that $xf(x)^2 = f(x) − 1$



And so this implies that $$xf(x)^2 - f(x) + 1 = 0$$ and so we can get that $$f(x) = frac{1-sqrt{4x}}{2x}$$



But I can't get to understand how is that possible ? Like assume that $f(x)$ is the generating function for the Catalan sequence, then how come by the Cauchy product we have that $xf(x)^2 = f(x) − 1$



I know that if we multiply the sequence $$1,1,2,5,14,....$$



By itself we would get in the resulting sequence $$1,1,5,14,...$$



Because we have that $c_k = a_0b_k + a_1b_{k-1}+ ........ + a_kb_0$ using the cauchy product formula but still how do we have that $xf(x)^2 = f(x) − 1$



and how did we get that
$$f(x) = frac{1-sqrt{4x}}{2x}$$
from



$xf(x)^2 = f(x) − 1$ ? did we use the quadratic formula some how ?










share|cite|improve this question






















  • From oeis.org/A000108 : G.f.: A(x) = (1 - sqrt(1 - 4*x)) / (2*x). G.f. A(x) satisfies A = 1 + x*A^2.
    – Lisa
    Dec 1 '15 at 22:06










  • The first part of this answer gives the derivation in quite a bit of detail.
    – Brian M. Scott
    Dec 2 '15 at 6:57















up vote
2
down vote

favorite












I know that generating function for the Catalan number sequence is $$f(x) = frac{1 -sqrt{4x}}{2x}$$ but I wan to prove it.



So the sequence for the Catalan numbers is $$1,1,2,5,14....$$ as we all know.



Now I have to find a generating function that generates this sequence.



I read that we can prove it this way: Asssume that $f(x)$ is the generating function for the Catalan sequence then by the Cauchy product rule it can be shown that $xf(x)^2 = f(x) − 1$



And so this implies that $$xf(x)^2 - f(x) + 1 = 0$$ and so we can get that $$f(x) = frac{1-sqrt{4x}}{2x}$$



But I can't get to understand how is that possible ? Like assume that $f(x)$ is the generating function for the Catalan sequence, then how come by the Cauchy product we have that $xf(x)^2 = f(x) − 1$



I know that if we multiply the sequence $$1,1,2,5,14,....$$



By itself we would get in the resulting sequence $$1,1,5,14,...$$



Because we have that $c_k = a_0b_k + a_1b_{k-1}+ ........ + a_kb_0$ using the cauchy product formula but still how do we have that $xf(x)^2 = f(x) − 1$



and how did we get that
$$f(x) = frac{1-sqrt{4x}}{2x}$$
from



$xf(x)^2 = f(x) − 1$ ? did we use the quadratic formula some how ?










share|cite|improve this question






















  • From oeis.org/A000108 : G.f.: A(x) = (1 - sqrt(1 - 4*x)) / (2*x). G.f. A(x) satisfies A = 1 + x*A^2.
    – Lisa
    Dec 1 '15 at 22:06










  • The first part of this answer gives the derivation in quite a bit of detail.
    – Brian M. Scott
    Dec 2 '15 at 6:57













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I know that generating function for the Catalan number sequence is $$f(x) = frac{1 -sqrt{4x}}{2x}$$ but I wan to prove it.



So the sequence for the Catalan numbers is $$1,1,2,5,14....$$ as we all know.



Now I have to find a generating function that generates this sequence.



I read that we can prove it this way: Asssume that $f(x)$ is the generating function for the Catalan sequence then by the Cauchy product rule it can be shown that $xf(x)^2 = f(x) − 1$



And so this implies that $$xf(x)^2 - f(x) + 1 = 0$$ and so we can get that $$f(x) = frac{1-sqrt{4x}}{2x}$$



But I can't get to understand how is that possible ? Like assume that $f(x)$ is the generating function for the Catalan sequence, then how come by the Cauchy product we have that $xf(x)^2 = f(x) − 1$



I know that if we multiply the sequence $$1,1,2,5,14,....$$



By itself we would get in the resulting sequence $$1,1,5,14,...$$



Because we have that $c_k = a_0b_k + a_1b_{k-1}+ ........ + a_kb_0$ using the cauchy product formula but still how do we have that $xf(x)^2 = f(x) − 1$



and how did we get that
$$f(x) = frac{1-sqrt{4x}}{2x}$$
from



$xf(x)^2 = f(x) − 1$ ? did we use the quadratic formula some how ?










share|cite|improve this question













I know that generating function for the Catalan number sequence is $$f(x) = frac{1 -sqrt{4x}}{2x}$$ but I wan to prove it.



So the sequence for the Catalan numbers is $$1,1,2,5,14....$$ as we all know.



Now I have to find a generating function that generates this sequence.



I read that we can prove it this way: Asssume that $f(x)$ is the generating function for the Catalan sequence then by the Cauchy product rule it can be shown that $xf(x)^2 = f(x) − 1$



And so this implies that $$xf(x)^2 - f(x) + 1 = 0$$ and so we can get that $$f(x) = frac{1-sqrt{4x}}{2x}$$



But I can't get to understand how is that possible ? Like assume that $f(x)$ is the generating function for the Catalan sequence, then how come by the Cauchy product we have that $xf(x)^2 = f(x) − 1$



I know that if we multiply the sequence $$1,1,2,5,14,....$$



By itself we would get in the resulting sequence $$1,1,5,14,...$$



Because we have that $c_k = a_0b_k + a_1b_{k-1}+ ........ + a_kb_0$ using the cauchy product formula but still how do we have that $xf(x)^2 = f(x) − 1$



and how did we get that
$$f(x) = frac{1-sqrt{4x}}{2x}$$
from



$xf(x)^2 = f(x) − 1$ ? did we use the quadratic formula some how ?







combinatorics discrete-mathematics generating-functions catalan-numbers






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Dec 1 '15 at 22:03









alkabary

4,0741437




4,0741437












  • From oeis.org/A000108 : G.f.: A(x) = (1 - sqrt(1 - 4*x)) / (2*x). G.f. A(x) satisfies A = 1 + x*A^2.
    – Lisa
    Dec 1 '15 at 22:06










  • The first part of this answer gives the derivation in quite a bit of detail.
    – Brian M. Scott
    Dec 2 '15 at 6:57


















  • From oeis.org/A000108 : G.f.: A(x) = (1 - sqrt(1 - 4*x)) / (2*x). G.f. A(x) satisfies A = 1 + x*A^2.
    – Lisa
    Dec 1 '15 at 22:06










  • The first part of this answer gives the derivation in quite a bit of detail.
    – Brian M. Scott
    Dec 2 '15 at 6:57
















From oeis.org/A000108 : G.f.: A(x) = (1 - sqrt(1 - 4*x)) / (2*x). G.f. A(x) satisfies A = 1 + x*A^2.
– Lisa
Dec 1 '15 at 22:06




From oeis.org/A000108 : G.f.: A(x) = (1 - sqrt(1 - 4*x)) / (2*x). G.f. A(x) satisfies A = 1 + x*A^2.
– Lisa
Dec 1 '15 at 22:06












The first part of this answer gives the derivation in quite a bit of detail.
– Brian M. Scott
Dec 2 '15 at 6:57




The first part of this answer gives the derivation in quite a bit of detail.
– Brian M. Scott
Dec 2 '15 at 6:57










1 Answer
1






active

oldest

votes

















up vote
3
down vote













The $n^{th}$ catalan number $C_n$ is the number of ways to arrange $2n$ parentheses in a way that makes sense. For example, there are exactly $2$ ways for $n=2$: (()) and ()(). This gives us a recursive way to calculate $C_n$. To find $C_3$, note that there will be a first time in each sequence of parentheses when every left parenthesis is matched by a right parenthesis. In (())(), this happens for the first time after (()). So each sequence starts off with (x), where x is a valid, possibly empty, sequence of parentheses. There are $C_2$ ways for x to have length 2. There are $C_1$ ways for x to have length 1, and $C_1$ ways to fill in the last 2 parentheses in the sequence. There are $C_0$ ways for x to be empty, and $C_2$ ways to fill in the last four parentheses. So we have $C_3=C_2C_0+C_1C_1+C_0C_2$. This can give us the formula we want in general, $C_n=sum_{i=0}^{n-1}C_iC_{n-i-1}$. So if we start with the generating function $f(x)=sum_{i=0}^{infty} C_ix^i$ and square it, we get $f(x)^2=sum_{i=0}^{infty} (sum_{j=0}^{i}C_iC_{i-j})x^i=sum_{i=0}^{infty} C_{i+1}x^i=frac{f(x)-1}{x}$. Rearranging,



$xf(x)^2-f(x)+1=0$

Now you have a quadratic equation in $f(x)$, so you can use the quadratic formula to get: $$f(x)=frac{1-sqrt{1-4x}}{2x}$$






share|cite|improve this answer























    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',
    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%2f1555547%2ffinding-the-generating-function-for-the-catalan-number-sequence%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote













    The $n^{th}$ catalan number $C_n$ is the number of ways to arrange $2n$ parentheses in a way that makes sense. For example, there are exactly $2$ ways for $n=2$: (()) and ()(). This gives us a recursive way to calculate $C_n$. To find $C_3$, note that there will be a first time in each sequence of parentheses when every left parenthesis is matched by a right parenthesis. In (())(), this happens for the first time after (()). So each sequence starts off with (x), where x is a valid, possibly empty, sequence of parentheses. There are $C_2$ ways for x to have length 2. There are $C_1$ ways for x to have length 1, and $C_1$ ways to fill in the last 2 parentheses in the sequence. There are $C_0$ ways for x to be empty, and $C_2$ ways to fill in the last four parentheses. So we have $C_3=C_2C_0+C_1C_1+C_0C_2$. This can give us the formula we want in general, $C_n=sum_{i=0}^{n-1}C_iC_{n-i-1}$. So if we start with the generating function $f(x)=sum_{i=0}^{infty} C_ix^i$ and square it, we get $f(x)^2=sum_{i=0}^{infty} (sum_{j=0}^{i}C_iC_{i-j})x^i=sum_{i=0}^{infty} C_{i+1}x^i=frac{f(x)-1}{x}$. Rearranging,



    $xf(x)^2-f(x)+1=0$

    Now you have a quadratic equation in $f(x)$, so you can use the quadratic formula to get: $$f(x)=frac{1-sqrt{1-4x}}{2x}$$






    share|cite|improve this answer



























      up vote
      3
      down vote













      The $n^{th}$ catalan number $C_n$ is the number of ways to arrange $2n$ parentheses in a way that makes sense. For example, there are exactly $2$ ways for $n=2$: (()) and ()(). This gives us a recursive way to calculate $C_n$. To find $C_3$, note that there will be a first time in each sequence of parentheses when every left parenthesis is matched by a right parenthesis. In (())(), this happens for the first time after (()). So each sequence starts off with (x), where x is a valid, possibly empty, sequence of parentheses. There are $C_2$ ways for x to have length 2. There are $C_1$ ways for x to have length 1, and $C_1$ ways to fill in the last 2 parentheses in the sequence. There are $C_0$ ways for x to be empty, and $C_2$ ways to fill in the last four parentheses. So we have $C_3=C_2C_0+C_1C_1+C_0C_2$. This can give us the formula we want in general, $C_n=sum_{i=0}^{n-1}C_iC_{n-i-1}$. So if we start with the generating function $f(x)=sum_{i=0}^{infty} C_ix^i$ and square it, we get $f(x)^2=sum_{i=0}^{infty} (sum_{j=0}^{i}C_iC_{i-j})x^i=sum_{i=0}^{infty} C_{i+1}x^i=frac{f(x)-1}{x}$. Rearranging,



      $xf(x)^2-f(x)+1=0$

      Now you have a quadratic equation in $f(x)$, so you can use the quadratic formula to get: $$f(x)=frac{1-sqrt{1-4x}}{2x}$$






      share|cite|improve this answer

























        up vote
        3
        down vote










        up vote
        3
        down vote









        The $n^{th}$ catalan number $C_n$ is the number of ways to arrange $2n$ parentheses in a way that makes sense. For example, there are exactly $2$ ways for $n=2$: (()) and ()(). This gives us a recursive way to calculate $C_n$. To find $C_3$, note that there will be a first time in each sequence of parentheses when every left parenthesis is matched by a right parenthesis. In (())(), this happens for the first time after (()). So each sequence starts off with (x), where x is a valid, possibly empty, sequence of parentheses. There are $C_2$ ways for x to have length 2. There are $C_1$ ways for x to have length 1, and $C_1$ ways to fill in the last 2 parentheses in the sequence. There are $C_0$ ways for x to be empty, and $C_2$ ways to fill in the last four parentheses. So we have $C_3=C_2C_0+C_1C_1+C_0C_2$. This can give us the formula we want in general, $C_n=sum_{i=0}^{n-1}C_iC_{n-i-1}$. So if we start with the generating function $f(x)=sum_{i=0}^{infty} C_ix^i$ and square it, we get $f(x)^2=sum_{i=0}^{infty} (sum_{j=0}^{i}C_iC_{i-j})x^i=sum_{i=0}^{infty} C_{i+1}x^i=frac{f(x)-1}{x}$. Rearranging,



        $xf(x)^2-f(x)+1=0$

        Now you have a quadratic equation in $f(x)$, so you can use the quadratic formula to get: $$f(x)=frac{1-sqrt{1-4x}}{2x}$$






        share|cite|improve this answer














        The $n^{th}$ catalan number $C_n$ is the number of ways to arrange $2n$ parentheses in a way that makes sense. For example, there are exactly $2$ ways for $n=2$: (()) and ()(). This gives us a recursive way to calculate $C_n$. To find $C_3$, note that there will be a first time in each sequence of parentheses when every left parenthesis is matched by a right parenthesis. In (())(), this happens for the first time after (()). So each sequence starts off with (x), where x is a valid, possibly empty, sequence of parentheses. There are $C_2$ ways for x to have length 2. There are $C_1$ ways for x to have length 1, and $C_1$ ways to fill in the last 2 parentheses in the sequence. There are $C_0$ ways for x to be empty, and $C_2$ ways to fill in the last four parentheses. So we have $C_3=C_2C_0+C_1C_1+C_0C_2$. This can give us the formula we want in general, $C_n=sum_{i=0}^{n-1}C_iC_{n-i-1}$. So if we start with the generating function $f(x)=sum_{i=0}^{infty} C_ix^i$ and square it, we get $f(x)^2=sum_{i=0}^{infty} (sum_{j=0}^{i}C_iC_{i-j})x^i=sum_{i=0}^{infty} C_{i+1}x^i=frac{f(x)-1}{x}$. Rearranging,



        $xf(x)^2-f(x)+1=0$

        Now you have a quadratic equation in $f(x)$, so you can use the quadratic formula to get: $$f(x)=frac{1-sqrt{1-4x}}{2x}$$







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Nov 17 at 19:57









        user50393

        134




        134










        answered Dec 1 '15 at 22:48









        Timur vural

        763




        763






























            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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.


            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%2f1555547%2ffinding-the-generating-function-for-the-catalan-number-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

            Probability when a professor distributes a quiz and homework assignment to a class of n students.

            Aardman Animations

            Are they similar matrix