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.
|