Q. If f(1)=4,f(2)=2 and f(n)=f(n−1)+2f(n−2) then find the value of f(4).Answer:
Find f(3): Use the given recursive function to find f(3). The recursive function is f(n)=f(n−1)+2f(n−2). We have f(1)=4 and f(2)=2. Calculate f(3) using the values of f(1) and f(2). f(3)=f(3−1)+2f(3−2)=f(2)+2f(1)=2+2(4)=2+8=10
Calculate f(3): Use the recursive function to find f(4).Now that we have f(3)=10 and f(2)=2, we can find f(4).f(4)=f(4−1)+2f(4−2)=f(3)+2f(2)=10+2(2)=10+4=14
More problems from Write and solve direct variation equations