Generating functions ( recurrence relations )

463 Views Asked by At

Find $a_n$ using Generating Functions : $a_n = -a_{n-1} + 2a_{n−2}$, $n\ge2$ and $a_0 = 1$, $a_1 = 2$.

Approach : So I will form a characteristic equation $ r^2 + r - 2 = 0$ whose roots are $r_1 = -2$, $r_2 = 1$.

So my general solution is $a_n = α_1r_1^n + α_2r_2^n$.

$a_n = α_1(-2)^n + α_2(1)^n$

When $a_0 = 1$, then $1 = α_1(-2)^0 + α_2(1)^0$, then $α_2 = 1 - α_1 $.

When $a_1 = 2$, then $2 = α_1(-2)^1 + α_2(1)^1$, then $-2α_1 + 1 - α_1 = 2$.

$α_1 = -1/3$ and $α_2 = 4/3 $

So $a_n = -1/3r_1^n + 4/3r_2^n$.

Can anyone tell me if it is correct or not and any help will be appreciated :) .

Also, if I have $a_{n+2}=a_{n+1}+2a_n$. Can someone tell me if its char. equation should be like $r^2-r-2 = 0$? Just asking because of the addition symbol rather than subtraction.

2

There are 2 best solutions below

0
On

If you really want to use generating functions to get $a_n$. In general with a recurrence relation with initial conditions $a_0$ and $a_1$ and \begin{equation} a_n = r_1a_{n-1}+r_2a_{n-2} \end{equation} you can write the generating function as \begin{equation} G(x) = \frac{-a_0-a_1x+a_0r_1x}{r_2x^2+r_1x-1} \end{equation} so your question will have \begin{equation} G(x) = \frac{1+3x}{1+x-2x^2} = 1 + 2x +0x^2 + 4x^3 -4x^4 + \cdots \end{equation} where the coefficients of the expansion are the sequence $a_n$. To extract the coefficients we can see that \begin{equation} \frac{1}{n!}\frac{d^nG(x)}{dx^n}\bigg|_{x=0} =a_n \end{equation} however working out the $n^{th}$ derivative if a function can be tricky.

0
On

I understand that you are seeking a solution with generating functions, but I find the approach to these Fibonacci-type problems to be much more direct with a generalized Binet formula.

Here is a formal derivation of your result. The sequence you have found is a generalization of the Fibonacci sequence.

There have been many extensions of the sequence with adjustable (integer) coefficients and different (integer) initial conditions, e.g., $f_n=af_{n-1}+bf_{n-2}$. (You can look up Pell, Jacobsthal, Lucas, Pell-Lucas, and Jacobsthal-Lucas sequences.) Maynard has extended the analysis to $a,b\in\mathbb{R}$, (Ref: Maynard, P. (2008), “Generalised Binet Formulae,” $Applied \ Probability \ Trust$; available at http://ms.appliedprobability.org/data/files/Articles%2040/40-3-2.pdf.)

We have extended Maynard's analysis to include arbitrary $f_0,f_1\in\mathbb{R}$. It is relatively straightforward to show that

$$f_n=\left(f_1-\frac{af_0}{2}\right) \frac{\alpha^n-\beta^n}{\alpha-\beta}+\frac{f_0}{2} (\alpha^n+\beta^n) $$

where $\alpha,\beta=(a\pm\sqrt{a^2+4b})/2$.

The result is written in this form to underscore that it is the sum of a Fibonacci-type and Lucas-type Binet-like terms. It will also reduce to the standard Fibonacci and Lucas sequences for $a=b=1$, $f_1=1$, and $f_0=0 \text{ or }2$, respectively.

So, specializing to your case, we can say

$$ \alpha,\beta=(a\pm\sqrt{a^2+4b})/2=(-1\pm\sqrt{1+8})/2=1,-2 $$

Then we readily derive the desired result

$$ a_n=\frac{4}{3}-\frac{1}{3}(-2)^n$$

This proves the OP's assertion. Moreover, it applies to all such problems.

Disclosure: this post is derived largely from a previous one: Decimal Fibonacci Number?