A few years back, my wife asked for help in designing a magic trick. Now, asking me to design a trick isn’t such an odd request, given that I’ve been interested in magic for forty years and have written books on the subject. This request, though, had a catch.
My wife needed the trick, not for entertainment purposes, but for use in a computer course. It seems she was learning an advanced computer language, and her professor gave the class an assignment that sounded a lot like a mind-reading stunt.
The assignment went like this: Design a program that reveals, in ten guesses or less, a number from 1 to 99, secretly chosen by the computer.
I grabbed a pad and pen, and went to work.
“Tell the computer to ...