Volume 2 of Donald Knuth's classic series
The Art of Computer Programming covers seminumerical algorithms, with topics ranging from random number generators to floating point operations and other optimized arithmetic algorithms. Truly comprehensive and meticulously written, this book (and series) is that rarest of all creatures--a work of authoritative scholarship in classical computer science, but one that can be read and used profitably by virtually all working programmers.
The book begins with fundamental questions regarding random numbers and how to use algorithms to generate them. Subsequent chapters demonstrate efficient computation of single-precision and double-precision arithmetic calculations and modular arithmetic. The text then presents prime factorization (which can be used in cryptography, for instance) and algorithms for calculating fractions. This volume ends with algorithms for polynomial arithmetic and manipulation of power-series topics, which will benefit those with some knowledge of calculus.
Throughout this beautifully presented edition, Knuth incorporates hundreds of useful exercises for trying out the algorithms. These range from simple problems to larger research project topics. (The book provides answers, where appropriate, at the end of the book.) The result is a text that's suitable for college or graduate-level computer science courses or individual study by programmers. Volume 2 is an indispensable part of any working programmer's library.
User review
Numbers: random generations and arithmetic
Volume 2 of `The Art of Computer Programming` is about random numbers and also about relearning one of the three Rs from grade school, viz. arithmetic. Each topic gets one chapter.
When you generate random numbers in Excel, or VBA, or Perl, or C using functions packaged with the software, you are really using a deterministic algorithm that is not random at all; the results do however look random and so we call them `pseudorandom`.
Chapter 3 contains four main sections. First a section devoted to the linear congruence method (Xn+1=(aXn + c) mod m) of generating a pseudorandom sequence; with subsections on how to choose good values for a, c, and m. Second we get a section about how to test sequences to find if they are acceptably random or not. Third we find a section on other methods, expanding on linear congruence. Finally in a particularly fascinating section, DK provides a rigorous definition of randomness.
I haven't looked much at chapter 4 yet, on arithmetic. In it Knuth covers positional arithmetic, floating point arithmetic, multiplication and division at the machine level, prime numbers and efficient ways of investigating the primeness of very large numbers.
Again, DK is thorough and methodical. Again this is not a for dummies book. Again it is about theorems, algorithms, mechanical processes, and timeless truths. Again the exercises are a fascinating blend of the practical (investigate the random generating functions on the computers in your office) to the mathematical (he asks readers to formally prove many of the theorems he cites). And yes, again Knuth uses MIX, that wonderfully archaic fictional 60s machine language. But that should not stop readers; I use Perl.
Vincent Poirier, Tokyo
User review
This book is a classic!
I recently modified a program I wrote so that it would do operations on polynomials with multi-precision coefficients. For this, I turned to Knuth. This 3-volume set is a great starting point for learning how to implement mathematical calculations on a machine.
Don't listen to the `Reader` from CA. This person obviously has a bone to pick with Knuth. Maybe (s)he failed one of his classes. Maybe (s)he should write his/her own book on the subject.
User review
Legendary book
This book is the bible of coputer programming
It contains algorithms on pseudo-random sequences, algotithms on aritmetic operations on number, matrices ect.
The only drawback of this book is that all algprothms are writeen in MIX - some kind of assembler, that make them hard to read.
User review
Fascinating
Of course this is a classic programming text, but the book is fascinating from a mathematical point as well. The discussion of random number generation is worth the price alone. Also neat is the discussion of why numbers with lower initial digits are 'more common' in practice than those with higher initial digits, a topic I've never seen treated elsewhere.
User review
State of the art reference for computer scientists
This book offers a stringent treatment of random number generators and algorithms not found anywhere else. It is particularly valuable for those that deal with encryption and the analysis of cyphers. The exercises add admirably to the text. References to other books in the field are extensive. The book is written in a non-wordy, but still very readable style, making it accessible to serious computer scientists at all levels. A mathematical background is necessary.