85.6k views
5 votes
Given the recursive function:
f(1) = 0
f(n) = 2 + f(n - 1)
What is f(3)?

User Misaochan
by
8.6k points

1 Answer

2 votes

Answer:

f(3) = 4

Explanation:

using the recursive function f(n) = 2 + f(n - 1) with f(1) = 0 , then

f(1) = 0

f(2) = 2 + f(2 - 1) = 2 + f(1) = 2 + 0 = 2

f(3) = 2 + f(3 - 1) = 2 + f(2) = 2 + 2 = 4

User Hazzelnuttie
by
8.2k points

No related questions found