O'Reilly logo

Digital Dice by Paul J. Nahin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

image

Image

7. The Pipe Smoker’s discovery

It is better to light one candle than curse the darkness.

—Motto of the Christopher Society

 

(yes, but first one needs to have a match.)

On one of the bookshelves next to my desk I have an old, well-thumbed 1970s textbook on computer programming which has, as one of its homework problems, the following interesting assignment:

 

A pipe smoker has two booklets of matches in his pocket, each containing 40 matches initially. Whenever a match is required he picks one of the booklets at random, removing one match. Write ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required