You deposit $700 in an account that pays 12% annual interest compounded annually. How do you write a recursive function to model the situation?

1 Answer
Jul 28, 2016

#t(n) = t(n-1)*1.12#

Explanation:

annual interest is #.12#. if we write this as a function of time in years we know

#t(1) =700*(1.12) = #total money after 1 year

#t(2) = t(1)*(1.12) = #total money after 2 year

the pattern seems consistent as

#t(n) = t(n-1)*1.12#