# How to confirm if my explicit formula is right?

I have to determine an explicit formula for

$$a_n=5a_{n-1}+6a_{n-2}$$

Initial values are $$a_0=2\\a_1=-1\\n>=2$$

$$a_n = \frac{1}{7}\cdot 6^n+\frac{13}{7}\cdot (-1)^n$$

Which I suspect is wrong. But, how to "test" it?

-
You haven't given initial values... so this is just one solution out of a two dimensional space. –  martini Jul 6 '12 at 7:23
Do you have some initial values too e.g. $a_0, a_1$? –  Mark Bennet Jul 6 '12 at 7:23
Sorry! There, I added them :( –  Zol Tun Kul Jul 6 '12 at 7:25
Is proof by induction not an option for some reason? –  Jyrki Lahtonen Jul 6 '12 at 7:29
@JyrkiLahtonen: I'm too new at this so those kinds of methods don't even pass through my mind (or I'm just bad at it). Even so, I am still not very sure how to test the above by induction. –  Zol Tun Kul Jul 6 '12 at 7:32

You are right. All solutions of the recurrence have the shape $(A)6^n+(B)(-1)^n$, where $A$ and $B$ are constants. To determine the values of $A$ and $B$, you need to know the initial conditions.

You were told that $a_0=2$ and $a_1=-1$. That determines $A$ and $B$, which are correct. So your answer is completely right.

To verify that your answer is correct, you can (i) substitute your solution in the recurrence and (ii) check by substitution that the values you get for $n=0$ and $n=1$ match the given ones.

At the practical "informal check" level, you can calculate the first $4$ or $5$ terms from the recurrence, and check them against the values given by any formula you arrive at. If there is a match, your answer is very unlikely to be wrong.

-
My answer's right... I... I AM GIFTED!!! Thanks :) –  Zol Tun Kul Jul 6 '12 at 7:41

Just compute: \begin{align*} 5a_{n-1} + 6a_{n-2} &= \frac 57 6^{n-1} + \frac{65}7(-1)^{n-1} + \frac 676^{n-2} + \frac{78}7(-1)^{n-2}\\ &= \frac{36}7 6^{n-2} + \frac{13}7(-1)^{n-2}\\ &= \frac 176^n + \frac{13}7(-1)^n\\ &= a_n \end{align*} so the recursion is fulfilled. As $a_0 = \frac 17 + \frac{13}7 = 2$ and $a_1 = \frac 67 - \frac {13}7 = -1$, your solution is correct.

-

For $n=0,1$ result is positive(by putting values). Now, for recursion part $5a_{n-1}+6a_{n-2}=5\times \frac{6^{n-1}}{7} +\frac{65}{7}(-1)^{n-1}+6\times \frac{6^{n-2}}{7}+\frac{78}{7}(-1)^{n-2}=5\times \frac{6^{n}}{42}+\frac{6^n}{42} + (-1)^n(78/7-65/7)=\frac{6^n}{7}+(-1)^n\frac{13}{7}=a_n.$ Hence your recursion formula is correct.

-

$a_n=5a_{n−1}+6a_{n−2}$

=>$a_n-5a_{n−1}-6a_{n−2}=0$

If $a_n=x^n$

$x^n-5x^{n-1}-6x^{n-2}=0$

=>$x^2-5x-6=0$ as x≠0

So, $a_n=A6^n+B(-1)^n$ where A,B are indeterminate constants.

2=$a_0=A+B$

-1=$a_1=6A-B$

=>A=$\frac{1}{7}$ and B=$\frac{13}{7}$ and

$a_n=\frac{1}{7}6^n+\frac{13}{7}(-1)^n$

-