Q. If f(1)=1,f(2)=0 and f(n)=f(n−1)+2f(n−2) then find the value of f(4).Answer:
Calculate f(3): To find f(4), we need to first find f(3) using the given recursive formula f(n)=f(n−1)+2f(n−2). We know f(2)=0 and f(1)=1, so we can calculate f(3) as follows: f(3)=f(3−1)+2f(3−2)=f(2)+2f(1)=0+2(1)=2
Find f(4): Now that we have f(3), we can use it to find f(4) using the same recursive formula:f(4)=f(4−1)+2f(4−2)=f(3)+2f(2)=2+2(0)=2
More problems from Find the roots of factored polynomials