f(40) n > 40 f(n) = f(1) + f(n-1) f(40)= f(1) + f(40-1) I'm lost from ^^ this point... help me figure out what to do from here...?
You have to work backwards. It's a recursive function. I'll write out f(5) and maybe you'll see the pattern. f(5)=f(1)+f(4) = 1 + 4 = 5 f(4) = f(1) +f(3) = 1 + 3 = 4 f(3) = f(2) + f(1) = 1 + 2 = 3 f(2) = f(1) +f(1) = 1 + 1 = 2
at least I think so
yea... no I don't get it....
basically, f(n) = n because of how the function is defined. If we're given f(5), we need to find f(4), f(3), f(2), and f(1).
can you post the actual question so I can see where n>40 comes from
Bill is able to save $35/week after working part-time and paying his expenses. These two formulas show his weekly savings: f(1) = 35, f(n) = f(1) + f(n-1) for n > 1 Use any formula of your choice to find f(40). Explain why you chose that method and what your answer means. Show your calculations. does that make since?
f(5)=f(1)+f(4) = 35 + f(4) [using the formula definition] but what is f(4)?
again, the definition for every f(n) is f(1) + f(n-1) that means f(5) = f(1) + f(5-1) = f(1) + f(4) and so, f(4) = f(1) + f(4-1) = f(1) +f(3) f(3) = f(1) + f(3-1) = f(1) + f(2) f(2) = f(1) + f(2-1) = f(1) + f(1) And now we can finally work our way backwards. f(1) = 35; f(2) = f(1) + f(1) = 35 + 35 = 70 f(3) = f(1) + f(2) = 35 + 70 = 105 f(4) = f(1) + f(3) = 35 + 105 = 140 Do you see?
kinda sorta! So with that pattern... I'd have to keep doing the same problem over and over and over again? till I got to f(40) ?
Ok... so I figured it out! and I wouldn't of done it with out your help! teehee thanks so much for your help!!!!! I finished my assignment with understanding!
Not really. There's a shortcut if you realize that f(n) = 35+ (n-1)*35 so f(40) = 35+ 39*35 =35 + 1365
Ooo ok coolio
Join our real-time social learning platform and learn together with your friends!