Off[General::spell1];

Clear[b,h]

Money matters 2

If an an account offers an interest rate of 10%, compounded annually, then at the end of a year $100 will grow to $110.   Some accounts may offer the same rate of 10%, compounded half-yearly.  What that means is that an initial balance of $100 becomes $105 after 6 months and hence slightly more than $110 after a year.  In this notebook, we explore the effect that the compounding period has on a quoted annual interest rate.

The main Mathematica  functions used are Table and ListPlot.

?Table

?ListPlot

Compounding annually

A geometric progression  or GP  is a sequence like
	(3, 6, 12, 24,...) 
in which each term is a fixed multiple of its predecessor.  The general form is
	(a, ar, a(r^2), a(r^3),...);
a is called the initial term  and r the ratio  of the GP.		
It is quite easy to define a function which calculates the nth term of the GP with given initial term a and ratio r:

GP[a_,r_][n_]:= a*r^n

GP[b,h][7]

GP[b,h][0]

Here is the way an investment of $100 at an interest rate of 10% per annum, compounded annually, grows over 40 years:

Table[GP[100,1.10][n],{n,0,40}]

Compounded annually our initial deposit of $100 grows by a factor of more than 45.

Compounding more frequently

A rival bank offers the same annual interest rate of 10%, but compounded 6-monthly ;  what this means is that interest of 5% of the balance is accumulated every 6 months.

In a year the difference is minute: just 25 cents.

GP[100,1.05][2]

We see that 10% compounded half-yearly is equivalent to 10.25% compounded yearly.

The difference between the two compunding regimes may seem small, but over a long period it becomes quite substantial:

Table[GP[100,1.05][n],{n,0,80,2}]

After 40 years with the bank that compound half-yearly, you will be nearly 10% better off.

Compounding weekly is better still:

Table[GP[100,1.002][n],{n,0,2000,50}]

That's another 10% better off.

It may look as though such improvements can be continued indefinitely by reducing the compounding period.  The computer makes it easy to work out what happens.

Compounding daily means each multipling yesterday's balance by 1+0.1/365.  Doing that for 40 years means doing that for 40*365 days.  The following cell asks Mathematica for a record of such a regime

GP[100,1+0.1/365][0]

Table[GP[100,1+0.1/365][n],{n,0,40*365,365}]

Table[GP[100,1+0.1/$$$][n],
         {n,0,40*$$$,365*24*60}]

After 40 years the gain is only about $3.  Compounding every second gives no benefit at all, even after 40 years:

Table[GP[100,1+0.1/(365*24*60*60)][n],
         {n,0,40*(365*24*60*60),(365*24*60*60)}]

Compounding continuously

Even after 40 years there is no noticeable benefit from  compounding every second as against compounding every minute.   Plainly there is some kind of limiting behaviour here.  Let us examine it.

Here is a partial record of an initial investment of $1 at 10% per annum, compounded k times per year:

Table[GP[1,1+0.1/k][n],{n,0,8}]

After 1 year the principal becomes (1+0.1/k)^k.

The question is: what happens if k is large?   Here are the values of the prinicipal after 1 year for 10 small values of k:

Table[(1+0.1/k)^k,{k,1,10}]

There is a noticeable increase.

Here are the values of the prinicipal after 1 year for 10 large values of k:

Table[(1+0.1/k)^k,{k,990,1000}]

There is no noticeable increase.

It appears that 10% compounded continuously  is equivalent to 10.517% compounded annually.

Actually Mathematica knows this limit precisely; going over to exact calculation by replacing the decimal 0.1 with the rational 1/10, we find that:

lim = Limit[(1+1/(10k))^k,k->Infinity]

This is quite remarkable: the mysterious number E appears quite unexpectedly.

N[lim]

Indeed, for any x,

Limit[(1+x/n)^n,n->Infinity]

We see that an annual interest rate of x per cent compounded continuously  is equivalent to Ex per cent compounded annually.

One final observation: the benefits of continuous compounding are much more marked for high interest rates than for low:

E^.04

At 4% per annum the benefit of continuous compounding over annual compounding is a measly extra 0.081%.

E^.2

At 20% per annum the benefit is a handy extra 2.14% per year.