Find f(5) for this sequence: f(1) = 2 and f(2) = 4, f(n) = f(1) + f(2) + f(n - 1), for n > 2. f(5) = ______ Numerical Answers Expected!
@LogicalApple I'm lost with this one!
Directly substitute n = 5 into the formula. f(5) = f(1) + f(2) + f(4) .. Keep this in mind. We know f(1) = 2, and f(2) = 4 so f(5) = 2 + 4 + f(4) = 6 + f(4). Now determine f(4) . . . f(4) = f(1) + f(2) + f(3) = 6 + f(3)... so.. f(5) = 6 + (6 + f(3) ) = 12 + f(3) etc... can you take over ?
No :/
Here is the general rule: f(n) = f(1) + f(2) + f(n - 1) Let n = 3 f(3) = f(1) + f(2) + f(3 - 1) = f(1) + f(2) + f(2)
I'm sorry I just do not get it.
Recursion is a little difficult to get at first. Let's start over. We know the general rule of the function for any n. I.e., f(n) = f(1) + f(2) + f(n - 1). So far so good ?
Yes
We also know the value of f(1) and f(2). f(1) = 2, f(2) = 4. So we can rewrite f(n) as.. f(n) = 2 + 4 + f(n -1) = 6 + f(n - 1).
See if you can now determine f(3) knowing that f(n) = 6 + f(n - 1)
f(3) = 6 + f(0)?
f(n) = 6 + f(n-1) Let n = 3 f(3) = 6 + f(3 - 1) = 6 + f(2)
Oh okay, you're right... sorry ^_^
f(4) = 6+f(4-1) f(4) = 6+f(3)?
Yep . . but first what is f(3)? We have enough information to determine f(3). f(3) = 6 + f(2) Remember, f(2) is defined already.
f(3) = 6+4 f(3) = 10
Perfect! Now that you know f(3), what is your value of f(4) ?
f(4) = 16
And finally, f(5) ?
f(5) = 6+16 f(5) = 22
Nice.
Thank you so much!!!
so what is the answer?
Join our real-time social learning platform and learn together with your friends!