A recursive function repeatedly performs the same function in sequence and is usually accompanied by a starting value. Here is an example of a recursive function:
f(x) = 2f(x - 1) - 1, where f(0) = 5.
In this case,
f(0) = 5,
f(1) = 2f(1 - 1) - 1 = 2f(0) - 1 = 2(5) - 1 = 10 -1 = 9
f(2) = 2f(2 - 1) - 1 = 2f(1) - 1 = 2(9) - 1 = 18 -1 = 17
and so on.
Let's apply the recursive function to a real-world situation.
On his way to the office each workday (Monday through Friday), Darrell walks by a charitable foundation with a donation bucket set out front. He has decided that he wants to try to be more charitable. Starting next week, he plans to put 23 to the foundation.
If x represents the number of weeks that Darrell has been making donations, write a recursive function to represent the total amount he has donated. Explain your work.