Q. If f(1)=5,f(2)=1 and f(n)=3f(n−1)+f(n−2) then find the value of f(4).Answer:
Identify Given Information: Identify the given information and the recursive formula.We are given a recursive function f(n)=3f(n−1)+f(n−2), with initial conditions f(1)=5 and f(2)=1. We need to find the value of f(4).
Calculate f(3): Use the recursive formula to find f(3). We know f(1) and f(2), so we can calculate f(3) using the formula f(n)=3f(n−1)+f(n−2). f(3)=3f(2)+f(1)f(3)=3(1)+5f(3)=3+5f(3)=8
Calculate f(4): Use the recursive formula to find f(4). Now that we have f(3) and f(2), we can calculate f(4) using the formula f(n)=3f(n−1)+f(n−2). f(4)=3f(3)+f(2)f(4)=3(8)+1f(4)=24+1f(4)=25
More problems from Write and solve direct variation equations