Adam no

Greenhorn

Posts: 2

Adam no

Greenhorn

Posts: 2

Piet Souris

Master Rancher

Posts: 2044

75

posted 3 months ago

hi Adam,

welcome to the Ranch!

Don't panic, it is not very difficult.

Say you have an interestperunage of i, meaning that when you start with €1, you have (1 + i) euros after one year, (1 + i)^2 euros after two years, et cetera, (this is what is called "compund interest"), then what equation do you get when your initial € 1 has doubled after n years?

And do you know how to solve that equation, for n = 10, 20 and 30?

welcome to the Ranch!

Don't panic, it is not very difficult.

Say you have an interestperunage of i, meaning that when you start with €1, you have (1 + i) euros after one year, (1 + i)^2 euros after two years, et cetera, (this is what is called "compund interest"), then what equation do you get when your initial € 1 has doubled after n years?

And do you know how to solve that equation, for n = 10, 20 and 30?

posted 3 months ago

I'm not sure how they are expecting you to solve this programmatically. You could pick a rate and run it through a compound interest formula then IF it is more than double, reduce the rate and try again. IF it is less than double then increase the rate. Another way is to algebraically take the compound interest formula and solve for rate (this is a paper and pencil exercise), then implement the new formula in Java.

amount = principle * Math.pow(1 + rate/12, 12*years)

If you know that amount is two times the principle and you know the number of years, solve for rate.

Does this help at all?

amount = principle * Math.pow(1 + rate/12, 12*years)

If you know that amount is two times the principle and you know the number of years, solve for rate.

Does this help at all?

Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.

Piet Souris

Master Rancher

Posts: 2044

75

Campbell Ritchie

Marshal

Posts: 56562

172

Piet Souris

Master Rancher

Posts: 2044

75

Campbell Ritchie

Marshal

Posts: 56562

172

Piet Souris

Master Rancher

Posts: 2044

75

posted 2 months ago

No, I haven't forgotten. And if the Icelanders did what you suggest, I doubt if they would have gone bust.

The idea is of course to go from an interest rate per quarter to an interest rate per a period of four months, and then calculate with periods of four months. That is why I said that Carey's formula is a bit limited, although the idea is the same: recalculate the (what we call 'apparent') interest per year to an interest per month, and calculate in month periods. So it is easier to simply have an interest per some period, and leave the definition of what that might be to the market, or to the loan supplier, or to the one who gives the assignment.

Interest calculus is an incredibly interesting subject, with a range of questions that resembles OCAJP with ease and that one can make as simple or as complicated as one likes. With all the todays valuation according to say Solvency II, we have that every period has its own "yearly" interest rate. So a period of one month has an interest rate of i1 per year, a period of two months has an interest rate of i2 per year, ad infinitum so to speak, making interest calculations even more interesting than they already were.

But I better stop now, before loosing the one person reading this too.

Campbell Ritchie wrote:So you worked in Iceland in 2008?Piet Souris wrote:. . . interest based on a quarter year, but granted at the end of every fourth month, et cetera.

Campbell Ritchie wrote:You have forgotten what happened in Iceland in 2008.

No, I haven't forgotten. And if the Icelanders did what you suggest, I doubt if they would have gone bust.

The idea is of course to go from an interest rate per quarter to an interest rate per a period of four months, and then calculate with periods of four months. That is why I said that Carey's formula is a bit limited, although the idea is the same: recalculate the (what we call 'apparent') interest per year to an interest per month, and calculate in month periods. So it is easier to simply have an interest per some period, and leave the definition of what that might be to the market, or to the loan supplier, or to the one who gives the assignment.

Interest calculus is an incredibly interesting subject, with a range of questions that resembles OCAJP with ease and that one can make as simple or as complicated as one likes. With all the todays valuation according to say Solvency II, we have that every period has its own "yearly" interest rate. So a period of one month has an interest rate of i1 per year, a period of two months has an interest rate of i2 per year, ad infinitum so to speak, making interest calculations even more interesting than they already were.

But I better stop now, before loosing the one person reading this too.