Associated Topics || Dr. Math Home || Search Dr. Math

### Recursive Function for Loan Problem

```
Date: 11/13/97 at 08:14:15
From: dennis hotetz
Subject: Recursive function for loan problem

I do not understand this question. My college math teacher wants me to
show him the recursive function formula for a loan of \$100,000,
payable at 6 percent, over 20 years.

Can you help?
```

```
Date: 11/13/97 at 10:15:50
From: Doctor Mitteldorf
Subject: Re: Recursive function for loan problem

Dear Dennis,

If the balance of the loan in one month is x, then the next month it
will go up by 1/2 percent to 1.005x, but then a payment of p dollars
will be made against it, so the following month balance will be

1.005 x - p

Let's write 1.005 as f for short, and the original 100,000 we'll write
as x0.

Then we can make the following chart:

Time, months      Balance
0                  x0
1                  f*x0-p
2                  f*(f*x0-p)-p
3                  f*(f*(f*x0-p)-p
4                  f*(f*(f*(f*x0-p)-p)-p

At the end of the 20 years, we have the 240th payment, and the balance
is zero. What will the 240th line look like?  First, we'll have
f^(240)*x0. Then we'll have a succession of p's, each with one more f
multiplying it

p*(1+f+f^2+...+f^239)

The sum must come out to zero, since we're done paying off the loan at
this point:

***          f^(240)*x0 - p*(1+f+f^2+...+f^239) = 0

From this we can get a formula for p. We just need an old trick from
HS algebra that's used for summing 1+f+f^2+...+f^239.  Let's write 240
as n for generality, and we'll define S as the value of the sum. Look
what happens if we multiply S by f:

S = 1+f+f^2+...+f^n-1
fS = f+f^2++f^3...+f^n

Notice that after we've multiplied S by f, we get back most of the
terms in the original S, just shifted over by one. The only
differences are at the endpoints: there's one extra term on the right
and we're missing one on the left. Expressing this algebraically, we
have:

fS = S-1+f^n

We can solve this equation for S:

S = (f^n-1)/(f-1)

Let's go back now to the line marked ***.  We can rewrite this as

f^n*x0 - p*S = 0

Solve for p:
p = x0 * (f^n/S)

Using our formula for S, we have

p = x0 * f^n * (f-1) / (f^n-1)

We can simplify slightly by dividing numerator and denominator by f^n:

p = x0 * (f-1) / (1-f^(-n))

In the case you cite, where f = 1.005, x0 = 100,000 and n = 240, I get

p = 716.43

-Doctor Mitteldorf,  The Math Forum
Check out our web site!  http://mathforum.org/dr.math/
```
Associated Topics:
High School Basic Algebra
High School Interest

Search the Dr. Math Library:

 Find items containing (put spaces between keywords):   Click only once for faster results: [ Choose "whole words" when searching for a word like age.] all keywords, in any order at least one, that exact phrase parts of words whole words

Submit your own question to Dr. Math
Math Forum Home || Math Library || Quick Reference || Math Forum Search