126k views
2 votes
Generate the first 5 terms of this sequence:. f(1) = 0 and f(2) = 1, f(n) = f(n - 1) + f(n - 2), for n > 2. A. 0, -1, 1, 0, 2. B. 0, 1, 1, 2, 3. C. 0, 1, 2, 2, 3. D. 0, 1, 1, 2, 2.

User Tmaric
by
8.7k points

2 Answers

1 vote
You are given a function of f(n) = f(n - 1) + f(n - 2) where f(1) = 0 and f(2) = 1. You are asked to generate the first five terms of this sequence. All you need to do is to substitute the value of n greater than 2.

for n = 3
f(3) = f(3 - 1) + f(3 - 2)
f(3) = f(2) + f(1)
since f(2) = 1 and f(1) = 0
so, f(3) = 1 + 0 = 1

for n = 4
f(4) = f(4 - 1) + f(4 - 2)
f(4) = f(3) + f(2)
you have solved that for f(3) = 1 and since f(2) = 1
so, f(4) = 1 + 1 = 2


for n = 5
f(5) = f(5 - 1) + f(5 - 2)
f(5) = f(4) + f(3)
you have solved that for f(4) = 2 and f(3) = 1
so, f(5) = 2 + 1 = 3

the sequence is 0, 1, 1, 2, 3 so the answer is letter B
User Hasan Karaman
by
7.7k points
1 vote
Given the f(2) = 1 and f(1) = 0. The value of f(3) may be calculated by,
f(3) = f(2) + f(1) = 1 + 0 = 1
For f(4),
f(4) = f(3) + f(2) = 1 + 1 = 2
For f(5),
f(5) = f(4) + f(3) = 2 + 1 = 3

Thus, the terms are 0, 1, 1, 2, and 3. The answer is letter B.
User Peter Hauge
by
8.1k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.

9.4m questions

12.2m answers

Categories