Scott Russell wrote: > Say I wanted to find a solution to a problem that would normally require an > iterative technique. For a very simplified example: > > Say you purchased a CD or some other financial instrument where you wanted to > accumulate $1,000 at the end of 3 years. > This CD had an annual fee of $50 (payable at the beginning of the year) and > it guaranteed an interest rate of 10%. How much would you need to invest at > the beginning of the 3 years ? In other words, solve for X: > > (((((X-50) * 1.10) - 50) * 1.10) - 50) * 1.10 = $1,000 > > In Excel, I could set up a macro that searched for the solution through the > bisection algorithm or I could use the "Goal Seek" function if I really > wanted to take a short cut. > ----------------------------------------------------------------------
Discount the cash flows to time zero, and add them up: +/ 50 50 50 1000 % 1.10 ^ i.4 888.092 Check: X=: 888.092 (((((X-50) * 1.10) - 50) * 1.10) - 50) * 1.10 1000 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
