[SLUG] project
Gavin Baker
gavbaker at acm.org
Fri Jun 9 11:10:16 BST 2006
On 9 Jun 2006, at 10:17, Stephen O'Neill wrote:
> Bob Garrood wrote:
>> # A is for amount borrowed, n for number of years and i the annual
>> interest rate.
>> m=n*12
>> r=(1+i/1200)
>> p=A*r^(m-1)*(r-1)/(r^m-1)
>> {print p}
>
> The thing that I didn't know how to express here was Pn without a
> recursive loop for the sum - which seems to be what your formula
> solves.
I guess you have these, but I will throw em in anyway
Arithmetic sequence
x(1) = a, x(n+1) = x(n)+d (for n=1,2,3,...)
has closed form
x(n) = a + (n-1)d (n=1,2,3,...)
Geometric sequence
x(1) = a, x(n+1) = rx(n) (n=1,2,3,...)
has closed form
x(n) = ar^(n-1) (n=1,2,3,...)
Linear sequence
x(0) = a, x(n+1) = rx(n) + d (n=0,1,2,...)
has closed form
x(n) = (a + d/(r-1))r^n - d/(r-1) (n=0,1,2,...)
Exponential model
P(n+1) = (1+r)P(n) (n=0,1,2,...)
has closed form
P(n) = (1+r)^nP(0) (n=0,1,2,...)
There are simple ways to derive all these, and all linear recursion
sequences have a closed form. Google or wikipedia for Binet's formula
for the most famous...
> Oh, and MathML in HTML anybody?
I didn't have much fun with MathML, even with apps I have that can
export it (mathematica/maple)
LaTeX chunks as images looks nicer and work everywhere.
If you wanna show off, you could even use aamath to set the title
attribute of the images!
Gav
More information about the Scarborough
mailing list