Post Reply 
Programming Exercise (HP-15C, 15C LE - and others)
03-16-2014, 02:17 AM (This post was last modified: 03-16-2014 02:29 AM by Gerson W. Barbosa.)
Post: #1
Programming Exercise (HP-15C, 15C LE - and others)
1) Do only item (b) of the following exercise, taken from the book Systematic Programming, An Introduction, by Niklaus Wirth (but feel free to do them all, if you wish :-)

It should take under one minute to sum all 10 thousand terms on an HP-15C LE (you might not try this on the classic HP-15C as it would take around 2 and a half hours).

I don't remember what I used in 1984, but the pencil annotation in my printed copy of the book matches the HP-15C result, at least for item (b) (I haven't checked the other items).

2) As you can see, this series for ln(2) is very slowly convergent (10^4 terms yield only 3 significant digits). Modify your program so that it can compute the constant under one minute on a classic HP-15C (or HP-11C, 12C, 41C and other 10 or 12-digit RPN calculator). Tip: try to find an empirical relationship between the number of terms and the error.

Only as a reference, my HP-15C programs for items 1) and 2) are 15 and 24 steps long, respectively. Remember, this is an exercise, not a challenge. All solutions are welcome, not only the shorter and faster ones.

Have fun!

[Image: Exerc_8_3_zps6e524411.jpg]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Programming Exercise (HP-15C, 15C LE - and others) - Gerson W. Barbosa - 03-16-2014 02:17 AM



User(s) browsing this thread: 1 Guest(s)