Discrete math recursive definition

386 views Asked by At

So we were working this problem in class and for f(2) I got the same answer but for f(3) I got something different from the professor.

Basis: f(0) = -1 and f(1) = 2
Recursion: f(n) = f(n-2) - f(n-1)

For f(3) I am getting 1
f(3-2) - f(3-1)
=f(1) - f(2)
=2 - f(2-2) - f(2-1)
=2 - -1 - 2
=2+1-2 = 1

But the answer he got was:

5
1

There are 1 answers

1
Femaref On BEST ANSWER
=2 - -1 - 2

This should be

= 2 - (-1-2) = 2 + 1 + 2 = 5