Impressing my father with CS

My father Victor was a very intelligent man, but not especially into higher math or high tech. For much of his career, he sold insurance. Despite not being especially technically-oriented, he bought one of the early Compaq portable PCs in the 1980s. He would take it with him on sales calls, along with a portable printer, and use simple BASIC programs to print out customized, personalized reports that impressed his customers no end. He felt that it really improved his sales.

This was going on while I was in the CS PhD program at Carnegie Mellon. My brother David had a computer degree from Case Institute of Technology (as did I), and would help dad write these simple BASIC programs when he got stuck. (Case is the engineering college of CWRU.)

When I was visiting dad at some point, he asked me about this tricky computation that he and David couldn't figure out how to calculate. (They had written several compound interest calculating programs.) But: suppose someone wanted to have a specific amount of money when they retired, and wanted to have a specific monthly payment into their retirement. What interest rate would they need to achieve that?

A little bit of (literal) back of the envelope investigation showed that this was going to tricky: he wanted to invert a series summation, which doesn't necessarily have a closed form. So I said I'd think about this after I got back to school.

Back at my office, I pulled out my trusty Knuth volume 1 (basically the bible of numerical methods), and looked through chapter 1, where Knuth had summarized a bunch of computationally-useful math. Happily, there is a closed form of this series summation, but it is an Nth degree polynomial. As all math nerds know, Nth degree polynomials can't generally be solved by a simple formula like the quadratic formula most students learn in high school.

You can easily solve these polynomials iteratively, however. The standard technique is the Newton-Raphson method, which starts with a guess, evaluates it, and then adjusts the guess based on the value you get until it converges on the right solution. It uses the derivative (slope) of the polynomial to converge more quickly.

So, since I was using Perl a bit then, I wrote a Newton-Raphson program using the closed-form function and its derivative. I then translated it into BASIC and sent it to him. I will admit enjoying how mysterious the program was to my father. He could see it was getting the right answer, but had no clue how it worked.
For those who can read Perl (or BASIC), here is the actual code that I rediscovered in my archives in May 2026: numbers.pl

By the way, Donald Knuth also went Case Institute of Technology as an undergrad, and his book is dedicated to the computer that was there then.