A recursive formula is given by f(n) = f(f(n – 1)) + f(n – f(n – 1)), where n > 2 is an integer. If it is known that f(1) = 1 and f(2) = 1, find the value of f(4).
Explanation:
Given, f(n) = f(f(n – 1)) + f(n – f(n – 1)),
f(1) = 1 and f(2) = 1
putting n = 3, we get
f(3) = f(f(3 – 1)) + f(3 – f(3 – 1))
⇒ f(3) = f(f(2)) + f(3 – f(2))
⇒ f(3) = f(1) + f(3 – 1)
⇒ f(3) = 1 + f(2)
⇒ f(3) = 1 + 1 = 2
Now, putting n = 4, we get
f(4) = f(f(4 – 1)) + f(4 – f(4 – 1))
⇒ f(4) = f(f(3)) + f(4 – f(3))
⇒ f(4) = f(2) + f(4 – 2)
⇒ f(4) = 1 + f(2)
⇒ f(4) = 1 + 1 = 2
Hence, option (b).
» Your doubt will be displayed only after approval.
Help us build a Free and Comprehensive Preparation portal for various competitive exams by providing us your valuable feedback about Apti4All and how it can be improved.