4

I have tried to solve some recursion: $$f_n = \frac{2n-1}{n}f_{n-1} - \frac{n-1}{n} f_{n-2} + 1, \quad f_0 = 0, f_1 = 1$$ I would like to use a generating function: $$F(x) = \sum_{n=0}^{\infty}f_nx^n$$ Then: $F(x) = f_0 + f_1x + \sum_{n=2}^{\infty} \frac{2n-1}{n}f_{n-1}x^n - \sum_{n=2}^{\infty}\frac{n-1}{n} f_{n-2}x^n + \sum_{n=2}^{\infty}1x^n$

But As You see I have a problem. Could you help me ?

xawey
  • 163
  • 1
    Multiply your recurrence relation by $n$ to turn all coefficients in front of $f_{n-k}$ polynomial in $n$. When you express this relation using the generating function, replace each occurrence of $n$ in the coefficients by the operator $x\frac{d}{dx}$. At the end, you obtain a first order ODE for $F(x)$. It should not be very difficult to solve that. – achille hui Aug 09 '14 at 22:52

2 Answers2

3

You have: $$ x\, F'(x) = \sum_{n=1}^{+\infty} n\,f_n\, x^n,$$ $$ x\, F(x) = \sum_{n=1}^{+\infty} f_{n-1} x^n,$$ $$ x^2\, F'(x) + x F(x) = \sum_{n=1}^{+\infty}n\, f_{n-1}\, x^n,$$ $$ x^2 F(x) = \sum_{n=2}^{+\infty} f_{n-2} x^n,$$ $$ 2x^2 F(x) + x^3 F'(x) = \sum_{n=2}^{+\infty} n f_{n-2} x^n.$$ The recursion now gives: $$ xF'(x)-x = 2(x^2 F'(x)+xF(x))-xF(x)-(2x^2 F(x)+x^3 F'(x))+x^2F(x)+\sum_{n=2}^{+\infty}n x^n$$ or just: $$ (1-x)^2 F'(x) = (1-x)F(x)+\sum_{n=1}^{+\infty}(n+1)x^n$$ $$ F'(x) = \frac{F(x)}{(1-x)}-\frac{1}{(1-x)^2}+\frac{1}{(1-x)^4}.$$ By setting $F(x)=G(x)-\frac{1}{2(1-x)}+\frac{1}{2(1-x)^3}$ we get the ODE: $$ G'(x) = \frac{G(x)}{1-x},$$ so: $$ F(x) = \frac{K}{1-x}+\frac{1}{2(1-x)^3}.$$ Since $F(x)$ has an only pole of order three in $x=1$, we have that $f_n$ is a second degree-polynomial in $n$. By interpolating the first three values we further get: $$ f_n = \frac{n(n+3)}{4}.$$

Jack D'Aurizio
  • 353,855
  • I wonder if and where I made a mistake since I arrive to $$F(x)=\frac{1}{2 (x-1)}-\frac{1}{2 (x-1)^3}=\frac{(x-2) x}{2 (x-1)^3}$$ – Claude Leibovici Aug 10 '14 at 04:53
  • Probably the mistake is mine, anyway we both have that $f_n$ is a polynomial in $n$. Having degree two in your case, one in mine. – Jack D'Aurizio Aug 10 '14 at 05:07
  • To check who is right, we just need to interpolate the first four values of $f_i$ ;) – Jack D'Aurizio Aug 10 '14 at 05:09
  • What I find is $f_n=\frac{1}{4} n (n+3)$ – Claude Leibovici Aug 10 '14 at 05:12
  • $f_2=\frac{5}{2}$, so you are right, $f_n$ is a second-degree polynomial in $n$. If you find the mistake in the above lines, feel free to fix it. – Jack D'Aurizio Aug 10 '14 at 05:16
  • Thanks for giving me this freedom ! The problem is that I am unable to find a mistake in your answer !! Cheers :-) – Claude Leibovici Aug 10 '14 at 05:18
  • Mistake found and fixed! – Jack D'Aurizio Aug 10 '14 at 05:28
  • I don't understand your solution after: " The recursion now gives: " What does mean xF'(x) - x – xawey Aug 10 '14 at 17:16
  • The recursion can be written as $nf_n = 2nf_{n-1}-f_{n-1}-nf_{n-2}+f_{n-2}$. Compare the coefficients starting from $n=2$. – Jack D'Aurizio Aug 10 '14 at 17:24
  • Did you forget about 'n' ? From my point of view: $nf_n = 2nf_{n-1} - f_{n-1} - nf_{n-2} + f_{n-2} + n$ – xawey Aug 10 '14 at 23:19
  • Yes, yes, sure. – Jack D'Aurizio Aug 10 '14 at 23:37
  • Ok, thanks for your help, but I don't understand your idea afer: $$xF'(x)-x = 2(x^2 F'(x)+xF(x))-xF(x)-(2x^2 F(x)+x^3 F'(x))+x^2F(x)+\sum_{n=2}^{+\infty}n x^n $$ Could you try to help me ? – xawey Aug 10 '14 at 23:44
  • You have that $nf_n$ is the coefficient of $x^n$ in something, $2nf_{n-1}$ is the coeffient of $x^n$ in something else, then you have that a certain linear combination of functions is zero. That linear combination. – Jack D'Aurizio Aug 10 '14 at 23:48
  • This is the main idea behind the use of generating functions: they map recurrences into differential equations. – Jack D'Aurizio Aug 10 '14 at 23:48
  • Okey, "Since $F(x)$ has an only pole of order three in $x=1$, we have that fn is a second degree-polynomial in n. By interpolating the first three values we further get:" This is very difficult to me. – xawey Aug 11 '14 at 00:04
  • Start noticing what the coefficient of $\frac{1}{(1-x)^k}$ are, for a given $k$. – Jack D'Aurizio Aug 11 '14 at 00:05
  • I know, $\frac{1}{(1-x)^k}$ is connected with $\sum_{n=0}^{\infty} {k+n-1\choose n}x^n$ The thing that I don't understand is " $F(x)=G(x)-\frac{1}{2(1-x)}+\frac{1}{2(1-x)^3}$" – xawey Aug 11 '14 at 09:01
  • It is just a substitution I used to get rid of the inhomogeneous part of the differential equation. – Jack D'Aurizio Aug 11 '14 at 09:03
  • If I properly understand: (1) You see that $f_n$ will be polynomial because of form of recursion (2) You see that it will be degree 2 beacause of (1-x)^3 ? – xawey Aug 11 '14 at 09:46
  • Exacly. The presence of a triple pole in $x=1$ gives that the coefficients grow like a second-degree polynomial. – Jack D'Aurizio Aug 11 '14 at 09:56
2

I may have something that helps you. You can equivalently write your equations in the form $S^2 f_{n} = \frac{2n + 3}{n+2} S f_n - \frac{n+1}{n+2} f_n + 1$, where $S f_n = f_{n+1}$. Now we have $\left[(n+2)S^2 - (2n+3) S + (n+1) \right] f_n = \left[(n+2)S - (n+1) \right](S-1) f_n = 1$. Define $g_n = (S-1)f_n = f_{n+1} - f_n$. The equation reduces to $(n+2) g_{n+1} - (n+1) g_n = 1$. Solve for $g_n$ and after that solve $g_n = (S-1)f_n$ for $f_n$.