# From generating functions to recurrence

I am quite new to generating functions and I don't understand how one comes from the generating function equation to the recurrence:

$A = \sum_{n\geq 0} a_nx^n$

Now if $A=A(2xA'-A)+x$ holds, why is it easy to conclude that $a_n = \sum^{n-1}_{k=1} (2k-1)a_ka_{n-k}$ ?

-

## 1 Answer

The most important property of generating functions is that their multiplication is translated to a convolution of the corresponding sequences:

If

$$f(x)=\sum_{n=0}^\infty a_nx^n$$ $$g(x)=\sum_{n=0}^\infty b_nx^n$$

Then $h(x)=f(x)g(x)$ can be written as:

$h(x)=\sum_{n=0}^\infty (\sum_{k=0}^n a_ib_{n-i})x^n$

The sum in the middle - $\sum_{k=0}^n a_ib_{n-i}$ is what I call "convolution". It comes from the rules of multiplying power series (very similar to multiplying polynomials).

Now, if $A=\sum_{n=0}^\infty a_nx^n$, then by deriving "term-term" we have:

$$A^\prime = \sum_{n=1}^\infty a_nnx^{n-1}$$

And so:

$$2xA^\prime = \sum_{n=1}^\infty 2na_nx^x$$

And so

$$2xA^\prime-A = \sum_{n=1}^\infty (2n-1)a_nx^x$$

And the result follows.

If you're new to generating function - congratulations! This is a fascinating subject which at first glance might seem intimidating, but is actually very elegant and beautiful. I suggest Wilf's "generatingfunctionology" or Stanley's "Enumerative Combinatorics", or Flajolet and Sedgewick's "Analytic Combinatorics" (both the letter books can be quite a challenge, but are worth it).

-

thank you very much for the nice answer, I am currently reading generatingfunctionology. – stefan Feb 1 '12 at 21:37
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 7, "mathjax_display_tex": 5, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9057886600494385, "perplexity_flag": "middle"}