4

Currently having slight difficulty figuring out how to solve this.

Given is;

$$\begin{align}f(0) &= -3\\ f(1)&= 2 \\ f(n) &= f( n - 2 ) + 2 f( n - 1)\end{align}$$

Now, I need to calculate $f(5)$.

I'm not sure how to handle a function like this. Fill the N's and dissasemble?

Thomas Andrews
  • 177,126

1 Answers1

2

To calculate $f(5)$ you can just start using the recursion: \begin{align*} f(2) &= f(0) + 2f(1)\\ &= -3 + 4\\ &= 1\\ f(3) &= f(1) + 2f(2)\\ &= 2 + 2 \\ &= 4\\ f(4) &= f(2) + 2f(3)\\ &= 1 + 8\\ &= 9\\ f(5) &= f(3) + 2f(4)\\ &= 4 + 18\\ &= 22. \end{align*}

martini
  • 84,101