How to go about solving this recurrence relation?

685 Views Asked by At

In my discrete math class we were given the problem of finding an explicit formula for this recurrence relation and proving its correctness via induction. $$a_n=2a_{n-1}+a_{n-2}+1, a_1 = 1, a_2=1.$$ I feel confident that I could prove the correctness of the formula through induction but I have no idea what the formula is. What kind of strategy should I use for solving recurrence relations like this?

2

There are 2 best solutions below

0
On

If you let $b_n=a_n+\frac 12$, the constant disappears. Then the characteristic polynomial is $r^2-2r-1=0$. Find its roots.

0
On

If you've done linear algebra, there are techniques for solving linear recurrence relations. A (second order) linear recurrence is one of the form $a_{n+1}=\lambda a_n+\mu a_{n-1}$. This one isn't quite linear because of the $+1$, so let's try and remove that. The obvious way is to define:

$$b_{n+1}=2b_n+b_{n-1}$$

In the hopes that its behavior will reflect that of $a_n$ in a simple way. If you look at the error $\epsilon_n=a_n-b_n$:, you'll find that it satisfies the same recurrence relation as $a_n$, except that we get to pick the initial values of $\epsilon_n$, since this amounts to picking initial values of our simplified sequence $b_n$. So what initial values of $\epsilon_n$ would lead to a simple, predictable error term? Well, how about we look for initial values that will make $\epsilon_n$ a constant sequence? If you do the algebra, you'll find $\epsilon_1=\epsilon_2=-1/2$, and so we define:

$$b_1=a_1+1/2=3/2,\space b_2=a_2+1/2=3/2$$

So that now, $b_n=a_n+1/2$ for all $n$.

Anyway, now we have a linear recurrence relation. The idea of the linear algebra technique is to write:

$$B_n=\begin{pmatrix}b_{n+1}\\b_n\end{pmatrix}$$

So that we have:

$$B_n=\begin{pmatrix}2&1\\1&0\end{pmatrix}^{n-1}\begin{pmatrix}b_2\\b_1\end{pmatrix}$$

And then diagonalizing, etc.