Q. If f(1)=4,f(2)=1 and f(n)=3f(n−1)+f(n−2) then find the value of f(5).Answer:
Find f(3): Use the given initial conditions to find f(3). The recursive formula is f(n)=3f(n−1)+f(n−2). We know f(1)=4 and f(2)=1. Calculate f(3) using the formula. f(3)=3f(2)+f(1)=3(1)+4=3+4=7.
Find f(4): Use the values of f(2) and f(3) to find f(4). We have f(2)=1 and f(3)=7. Calculate f(4) using the formula. f(4)=3f(3)+f(2)=3(7)+1=21+1=22.
Find f(5): Use the values of f(3) and f(4) to find f(5). We have f(3)=7 and f(4)=22. Calculate f(5) using the formula. f(5)=3f(4)+f(3)=3(22)+7=66+7=73.
More problems from Write and solve direct variation equations