View Single Post
Old 04-30-2004, 08:22 AM   #18 (permalink)
Yakk
Wehret Den Anfängen!
 
Location: Ontario, Canada
So, people are slow at gathering for lunch. Lets see what I can work out...

D(n) is "debt after period n"

Your debt at period n is simply:
D(n) = D(n-1) + D(n-1)*R - P
ie, your old debt, plus the interest, minus your payment P (R is the monthly interest rate)

Playing around:
D(n+1) = D(n) * (1+R) - P
D(n) = D(n-1) * (1+R) - P

D(n+1) = (1+R) * (D(n-1)*(1+R) - P) - P
D(n+1) = D(n-1)*(1+R)^2 - (P * (1+R) + P)

So, going back 2 months, we start seeing a pattern. I'll bet it ends up like:

D(n) = D(n-k)*(1+R)^k - P * sum{j=0 to k-1}(1+R)^j

which, fortunetally, can be simplified[1]:

D(n) = D(n-k)*(1+R)^k - P*(1-(1+R)^k)/(1-(1+R))

set k = n
D(n) = D(0)*(1+R)^n + [1/R - (1+R)^n/R] * P

D(n) = D(0)*(1+R)^n - ((1+R)^n - 1) * P/R
which is what I was looking for.

I have no idea if that is right or not: NoSoup? Gonna go to lunch, might poke at it after, see if it behaves reasonably.

Footnote: (for those who want to know the magic trick used in that step)
[1] 1+x+x^2+x^3+... (the infinite series) is often the same as (1/(1-x)). So, 1+x+x^2+...+x^(k-1) (a finite series) works out to be (1+x+x^2+... ) - x^k*(1+x+x^2+...) (all the terms at and beyond x^k "cancel").

Which is
1/(1-x) - x^k / (1-x), or (1-x^k)/(1-x)
or, in other words:
sum{j=0 to k-1}(x^j) = (1-x^k)/(1-x)

In our case, x = (1+R). So, we get:
(1-(1+R)^k)/(1-(1+R))
= -(1-(1+R)^k)/(R)
__________________
Last edited by JHVH : 10-29-4004 BC at 09:00 PM. Reason: Time for a rest.
Yakk is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73