Pursuit of Fascinating Problems
The last few chapters of the book discuss topics chosen seemingly at random from a range of mathematical subjects the author has found interesting. One of the more fascinating chapters, which is far "outside the box" in relation to today's computers, discusses unusual bases for number systems and considers their possible use in computing. Base -2, for example, is a system in which both positive and negative numbers can be represented without using an explicit sign bit. As in the more familiar binary system, negabinary numbers are represented by 0/1 bits -- but the sign flips in every other digit. So instead of the digits being valued (1, 2, 4, 8, 16...), they are valued (0, 1, -2, 4, -8, 16...). The advantage of negabinary numbers is their simplicity in representing negative numbers, but their downside is that negabinary arithmetic operations such as division are quite complicated. Warren also discusses positive and negative complex base systems. In bases in which digits are valued based on powers of the numbers (-1 + i) or (-1 - i), all numbers both real and imaginary can be represented by 0/1 bits. He briefly touches on base e numbers, and finally considers the question of which base is the most efficient one for computing.
Other topics Warren addresses include Gray codes, the Hilbert curve, and prime numbers. Gray codes are a method of arranging the integers from 1 to N in a list so that each number can be visited exactly once by flipping only one bit at a time. The Hilbert curve is a similar idea expressed geometrically: a single continuous curve which, given a space divided into a grid of squares, touches every square exactly once and does not cross itself. In each case, Warren provides both the mathematical discussion and the code to solve the problem.
The chapter on prime numbers is the most challenging mathematically but also one of the most interesting. It starts with a concise overview of various mathematicians' efforts to devise ways of finding prime numbers. "Like many young students, I once became fascinated with prime numbers, and tried to find a formula for them," explains Warren. Actually, this statement is the key to the whole book. The author is one of those people who periodically become fascinated by some problem and devote themselves to learning more about it and searching for a solution.
The chapter ends not with Warren's usual code sample, but instead with an invitation to continue the search for interesting solutions to the problem. Clearly, the author views this book not as a finished collection, but rather as a snapshot of work in progress. After decades of interest-driven research, Henry Warren has amassed a collection of studies big enough to fill a book. It is fortunate for the rest of us that he has written one, and I look forward to the next installment.
View Hacker's Delight Discussion
Page: 1 2 3 Next Page: Hacker's Delight