Q. If f(1)=2 and f(n)=−3f(n−1)+n then find the value of f(4).Answer:
Given f(1): We are given that f(1)=2. To find f(4), we need to find the values of f(2), f(3), and then f(4) using the recursive formula f(n)=−3f(n−1)+n.
Find f(2): First, let's find f(2) using the formula:f(2)=−3f(2−1)+2f(2)=−3f(1)+2f(2)=−3(2)+2f(2)=−6+2f(2)=−4
Find f(3): Next, we find f(3) using the formula and the value of f(2) we just found:f(3)=−3f(3−1)+3f(3)=−3f(2)+3f(3)=−3(−4)+3f(3)=12+3f(3)=15
Find f(4): Finally, we find f(4) using the formula and the value of f(3): f(4)=−3f(4−1)+4 f(4)=−3f(3)+4 f(4)=−3(15)+4 f(4)=−45+4 f(4)=−41