Function definition for interest rate.

Started by
3 comments, last by alvaro 9 years, 5 months ago

I am not good at math notation. I need to define a function that calculates the yearly accumulated deposit + interest.

For example I have got $30 in a fixed bank account, with an yearly interest of %10 . After a year I would possess $33, after another year $36.3, and so on.

x?0;

f(x)=(f(x-1)+30·0.1)x

Or some kind of recursive function I can't figure out.

Intel Core 2 Quad CPU Q6600, 2.4 GHz. 3GB RAM. ATI Radeon HD 3400.
Advertisement
"Adding 10%" has a much better description, which is "multiply by 1.1". With that in mind:

balance_after(n_years) = $30 * 1.1^n_years

Oh, yes. What an idiot I am. 1.1, I could n't figure that out. [bashes head against desktop]

Thanks.

Intel Core 2 Quad CPU Q6600, 2.4 GHz. 3GB RAM. ATI Radeon HD 3400.

This belongs to Mathematical finance.

There are two types of interest rates, simple interest and compund interest. The example you gave is an example of compund interest. This is because after a year, the interests became part of the capital, and start generating interests on their own. Back in middle ages this was forbidden because the Church considered it usury, which is a sin (TBH, I don't think it's so far off...).

Simple interest's formula is of the form f(i) = C * (1 + i) * N

Where C is the original capital, i the interest rate, and N is time (could be in days, months, years; if you change N from i.e. years to months, you will need to adjust the i by dividing it by 12).

Compund interest's formula is of the form f(i) = C * (1 + i)^N

This answers your question. If you change N's unit of measurement (i.e. years to months), adjusting i is a bit more tricky. You actually need to do i' = (1 + i)^(1/12) - 1

Knowing that compound interest is the result of interest getting capitalized is very important. You may notice that while N is smaller than 1, simple interest is bigger than compound's. In real life (and this depends on legislation: whether interests are considered becoming part of the capital day by day, or only after the whole year has passed), often compound interest is just a piece-wise linear interest function.

During the first 12 months, the capital may grow at C * (1 + i) * N where N is in months, the second year it grows at C2 * (1 + i) * N; where C2 = C * (1+i) * 12 (In other words, C2 is the money you got after 1 year had passed)

This can be expressed by f(i) = C * (1 + i)^N; but only as long as N is a natural number (and not a Real number; unless the legislation considers the capitalization to happen day by day).

Well, that's enough for this post. Compound interest in real life situations can get very complex; and is in fact the subject of study of an entire quadrimester. You've got enough keywords now. Google is your friend.

I happen to be a mathematician working in the finance industry, and I am happy to ignore all the complexity hinted at by Matias Goldberg for the vast majority of what I do. Unless you are working in accounting, these things don't really matter.

This topic is closed to new replies.

Advertisement