How to solve this weird recurrence relation

113 Views Asked by At

So i have the following recurrence relation:

$f(x) = f(x-2) + f(x-3)$

$f(1) = 1$, $f(2) = 2$, $f(3) = 2$

And also absolutely no idea how to solve it, does anyone have a hint?

1

There are 1 best solutions below

0
On

Making $f(x) = a^x$ and substituting into the recurrence equation we get

$$ a^x = a^{x-2}+a^{x-3}\Rightarrow a^3-a-1=0 $$

now if $r_1, r_2, r_3$ are the roots of such characteristic polynomial, we have

$$ f(x) = C_1 r_1^x + C_2 r_2 ^x+C_3 r_3^x $$

and then the determination of $C_1,C_2,C_3$ is made by solving

$$ f(1)= C_1 r_1 + C_2 r_2 +C_3 r_3 = 1\\ f(2)= C_1 r_1^2 + C_2 r_2^2 +C_3 r_3^2 = 2\\ f(3)= C_1 r_1^3 + C_2 r_2^3 +C_3 r_3^3 = 2 $$