STUPID BUTUSEFUL CHALLENGE #879 « Next Oldest | Next Newest »

 ▼ Thibaut.be Senior Member Posts: 610 Threads: 53 Joined: Aug 2005 07-05-2002, 04:47 AM The formula for constant annuity (TVM reimbursement) is : a = PV * i / (1-(1+i)^-n) write a program in as few possible steps to solve this equation, where you have previously entered the following variables in the stack : PV (= present value or lended amount, i (= interest (not in %, ie 6% = .06), n (number of payments NB : European people : i has to be converted from the basic rate. If rate is anuual and payments are monthly, then im = 1-(1+iy)^(1/12) American people : the shown rate is different from the yield, but the monthly rate is calculated by dividing the annual rate by 12, so im=iy/12 Thibaut ▼ Thibaut.be Senior Member Posts: 610 Threads: 53 Joined: Aug 2005 07-05-2002, 05:21 AM Oops, I posted the message above to fast. - the PV, n and i vlaues can be stored wherever you want - hint : use no register (sto and rcl cost bytes !), but do use the stack. BTW, this is an excellent stack exercice. My solution is 15 steps long, including LBL/RTN. Who give a better one ? It could be 17 steps long with a 12C for the rollup function does not exist in the 12C (you spend 2 more bytes * 2) but the lbl and rtn funtions do not exist either (you save 2 bytes) Amazing how fast the answer is given on a 41C (< 1sec) and on a 12C (<2.5 sec, v. <2 sec with the solver) Enjoy ! ▼ Gene Posting Freak Posts: 1,107 Threads: 159 Joined: Jan 1970 07-05-2002, 04:58 PM Ok, to make up for NOT READING the earlier challenge completely (I used a numeric key), I have a 41c style solution with 13 steps, including LBL and RTN. My inputs are n, PV, and i in the Z, Y, and X registers. I assumed that n is total number of payments and i was the periodic interest rate...if the payments are monthly then i is the monthly interest rate. Interestingly, I have 15 step solutions for PV, n, i and PV, i, n as the input order. LBL 01 x Lastx 1 + RUP (Roll Up) CHS Y^x 1 - CHS Divide RTN That seems to work. Anyone less than 13? Gene ▼ Ed Martin Junior Member Posts: 33 Threads: 0 Joined: Jan 1970 07-05-2002, 08:51 PM This is cheating ... a bit. If you put -n on the stack instead of N, you can do it in 12 steps: LBL 01 * LASTx 1 + RUP y^x CHS 1 + / RTN - Ed Thibaut.be Senior Member Posts: 610 Threads: 53 Joined: Aug 2005 07-06-2002, 02:04 AM Also 13 steps, without LBL and RTN, with n in Z, PV in Y and i in X : LBL A ENTER Roll Down * Roll Up 1 + Roll Up CHS y^x 1 - CHS / RTN Jim Kimes Junior Member Posts: 33 Threads: 12 Joined: Jan 1970 07-07-2002, 06:07 PM I suggest that when such challenges are posted--and they can be quite useful--a solved example be included so that the challengees will know positively they've understood the problem and exactly what kind of problem it is they're challenged to solve. In this case I could have produced a formula but I wouldn't have known for sure that the formula was exact without a sample by which to proof my work. Thanks. ▼ Thibaut.be Senior Member Posts: 610 Threads: 53 Joined: Aug 2005 07-08-2002, 11:25 AM example : You purchase a house for \$500.000. You pay it back in 15 years. Rate is 5.5/year. Month rate is .05/12=0.42%/month. 15 years is 180 month Key in 180 ENTER 500.000 ENTER .0042 R/S (or XEQ...) Your should read a monthly payment of 3.964,39 per month... ▼ Jim Kimes Junior Member Posts: 33 Threads: 12 Joined: Jan 1970 07-12-2002, 05:38 PM Thanks for the example. Helps immensely. Paul Brogger Posting Freak Posts: 1,153 Threads: 94 Joined: Mar 2006 07-08-2002, 10:39 AM I would think that the creative finance people from Enron and WorldCom could put their vast experience to use and contribute a few helpful hints under this Subject line . . .

 Possibly Related Threads... Thread Author Replies Views Last Post Stupid idea of the day: 41-compatible watch bhtooefr 0 356 03-31-2013, 08:23 AM Last Post: bhtooefr Another stupid WP34S question Geoff Quickfall 2 420 06-16-2012, 11:21 PM Last Post: Geoff Quickfall Stupid question number...WS34P Geoff Quickfall 16 1,313 06-16-2012, 07:04 AM Last Post: Paul Dale Stupid question re HP-41 Sigma key... Jim L (OHIO) 5 623 07-19-2010, 06:04 PM Last Post: BruceH RE: 35s sorting routine challenge - Gene's Challenge Miguel Toro 4 631 08-01-2007, 08:36 AM Last Post: Miguel Toro Stupid Scammer! Ron 9 781 06-11-2005, 05:16 PM Last Post: Nenad (Croatia) Stupid Question: Difference btn. 38G and 40G Maximilian Hohmann 4 513 06-11-2005, 03:05 AM Last Post: R Lion May be a stupid question... Pierre Brial 10 877 07-11-2003, 05:02 PM Last Post: unspellable AARRRRG! Stupid !#\$@*&! HP-17BII! W. Bruce Maguire II 2 393 01-09-2002, 03:45 PM Last Post: Ron Ross Stupid HP-25 Questions Tom 7 632 02-15-2001, 01:38 PM Last Post: Tom

Forum Jump: