Generate the first 5 terms of this sequence: f(1) = 1 and f(2) = 2, f(n) = f(n - 1) + f(n - 2), for n > 2. Choices: A) 1, 2, 3, 4, 5 B) 1, 2, 3, 5, 7 C) 1, 2, 3, 5, 8 D) 1, 3, 5, 7, 9
@hba
1st term: f(1) easy 2nd term: f(2) easy 3rd term: f(3) = f(2) + f(1) = ? 4th term: f(4) = f(3) + f(2) = ? you get the idea?
So you have add the f(2)+f(1)= f(3) and so on? @BangkokGarrett
yes..that's what f(n) = f(n - 1) + f(n - 2), for n > 2 means.
Once your n is bigger than 2...namely n = 3...you start using that equation. f(1) and f(2) are given.
so how would I write the 5th term
Would it be f(5)=f(3)+f(3)?
f(5) = f(4) + f(3) You have to figure out f(3) first. Then figure out f(4) Then figure out f(5)...the 5th term
oh okay thanks for all the help
sure. no problem
So the answer will be B: 1,2,3,5,7
No. The first 4 terms are correct. but f(5) is not 7 f(5 = f(4) + f(3) = 5 + 3 = 8
oh okay thanks
Join our real-time social learning platform and learn together with your friends!