3

In the appendix of the book http://www.math.upenn.edu/~wilf/DownldGF.html, page 194, the author mentioned that in Mma 2.0 (very old. :P), there is the function which can get the generating functions directly from recurrence relationship, like the example given therein:

GeneratingFunction[{f[n+2]==f[n+1]+f[n], f[0]==0, f[1]==1},f[n],n,x]

But the same function does not seem to do the kind of job anymore in mma 7.0/8.0. Does anyone know how to get the equivalent function? many thanks.

1 Answer 1

4

The GeneratingFunction scope has changed. Here you may find the obsolete legacy documentation (by the middle of the document).

Now you can do the same, but in two steps. First solve the recurrence relation with RSolve and the find the Generating Function. Like this:

GeneratingFunction[
 RSolve[{f[n + 2] == f[n + 1] + f[n], f[0] == 0, f[1] == 1}, f[n], n], 
n, x]  

Out

{{GeneratingFunction[f[n], n, x] -> -(x/(-1 + x + x^2))}}
Sign up to request clarification or add additional context in comments.

4 Comments

You probably don't want to use RSolve[] since that will actually solve the recurrence, when all you really need is the knowledge of the difference equation. The documentation has the identical example: GeneratingFunction[DifferenceRoot[Function[{y, m}, {y[m + 2] == y[m + 1] + y[m], y[0] == 0, y[1] == 1}]][n], n, z]
@Simon Good point! never used it. Seems better that RSolve if you don't want explicit forms
@Simon, was wondering if this extends (seems not), or any other method to solve GF for more than one variables, for example, f[m, n] == f[m, n - 1] + f[m - 1, n], f[0, n] ==1, f[m, 0] == 1
@Quiang Haha ... That was your other question :) ... And it seems not working

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.