Thursday, February 16, 2006
Back in the day, scientists still needed to do lots of calculations, but they didn't have the nice fast processors of today. They had people with mechanical adding machines and pads of paper. The Memorized algorithmic simplifications were like specialized overclocking of the people (who were the computers for the time, making pre-calculated mathematical tables). Do you remember the trick to determine if an integer is divisible by 3? In the spirit of these "overclockings" that you can do to your own calculating brain, I present to you...
How to square integer numbers near 50 - in your head!
I like this one so much because it so effectively demonstrates the value of optimizing the algorithm to do an equivalent calculation with less effort. It changes a multiply of medium-sized two digit numbers into a memorized constant, a single-digit integer multiplication (with 1, no less! :-), and your expected knowledge (grade school memorization) of the squares of single digit integers. That makes it WAY easier!
Here we'll define a "square integer near 50" as (50 +/- x)^2; -9 <= x <= +9. (i.e. 41*41, 42*42, ...58*58, 59*59)
(50 +/- x)^2 = (50 +/- x)*(50 +/- x) = 2500 +/- 100*x + x^2.
The final equation is really easy to perform in your head for x is a single digit.
For instance, let's say somebody asks you "Hey Burton, what's 47 squared?". You might think "Hey, my name's not Burton but he seems to be talking to me.", but then immediately after that you'll think "47 squared is 3 away from 50, so that means 47^2 = 2500 -3*100 + 9 = 2209. Damn that was fast! Thanks real guy named Burton!"
And to you I say "You're Welcome!".