How do I find the constant values of this closed form? (linear recurrence)

18 Views Asked by At

I found the closed form of a linear recurrence problem but I'm having trouble finding the constant values of the closed form:

$$\begin{align*} f(n)&= C_1(-1)^n + nC_2(-1)^n + C_32^n\\ f(0)&=0\\ f(1)&=1\\ f(2)&=7\;. \end{align*}$$

I don't know what to do :(

1

There are 1 best solutions below

0
On

There’s no need to guess. Substitute $n=0$, $n=1$, and $n=2$ into your first equation:

$$\begin{align*} 0=f(0)&=C_1(-1)^0+0\cdot C_2(-1)^0+C_32^0\\ 1=f(1)&=C_1(-1)^1+1\cdot C_2(-1)^1+C_32^1\\ 7=f(2)&=C_1(-1)^2+2\cdot C_2(-1)^2+C_32^2 \end{align*}$$

Now simplify those three righthand sides, and you’ll have a system of three linear equations in the three unknowns $C_1,C_2$, and $C_3$; all you have to do now is solve the system.