Some probability problems are so difficult that they stump the smartest mathematicians. But even the hardest of these problems can often be solved with a computer and a Monte Carlo simulation, in which a random-number generator simulates a physical process, such as a million rolls of a pair of dice. This is what Digital Dice is all how to get numerical answers to difficult probability problems without having to solve complicated mathematical equations. Popular-math writer Paul Nahin challenges readers to solve twenty-one difficult but fun problems, from determining the odds of coin-flipping games to figuring out the behavior of elevators. Problems build from relatively easy (deciding whether a dishwasher who breaks most of the dishes at a restaurant during a given week is clumsy or just the victim of randomness) to the very difficult (tackling branching processes of the kind that had to be solved by Manhattan Project mathematician Stanislaw Ulam). In his characteristic style, Nahin brings the problems to life with interesting and odd historical anecdotes. Readers learn, for example, not just how to determine the optimal stopping point in any selection process but that astronomer Johannes Kepler selected his second wife by interviewing eleven women. The book shows readers how to write elementary computer codes using any common programming language, and provides solutions and line-by-line walk-throughs of a MATLAB code for each problem. Digital Dice will appeal to anyone who enjoys popular math or computer science.
Paul J. Nahin is professor emeritus of electrical engineering at the University of New Hampshire and the author of many best-selling popular math books, including The Logician and the Engineer and Will You Be Alive 10 Years from Now? (both Princeton).
This book is about using simple Monte-Carlo simulations to find the expected results for various experiments. This might seem awfully narrow-focus, but the outcome is a fine success. This book may be read with profit by anyone with only very basic math: a head for analytic probability theory, with all its combinatoric machinery, is not needed. Indeed, the problems are often difficult or impossible to tackle analytically, even by an expert, which only serves to underscore the power and the simplicity of the simulation approach.
To derive value from the book, one must run the programs and stare dumbstruck at the solutions. The author provides complete listings in Matlab: the free Octave can be used instead. If you'd rather use your favourite programming language, and it has a decent pseudorandom-number generator (RNG) -- which it very likely does --, the programs are simple enough for you to rewrite. Indeed, rewriting is highly recommended, so you can gain confidence that you can tackle any new problem that comes your way. To repeat: Don't just read the programs: they need to be written and run for the incredible fact to sink in that such simple simulations are enough to tame profoundly difficult problems.
Of course this is all possible because we live in a computational golden age, when everyone has access to inexpensive computers with freely available, user-friendly, high-level programming languages that have excellent RNGs and the ability to run tons and tons of simulations in two shakes of a lamb's tail. The best scientists and mathematicians of times past did not have what you have now!
Digital Dice is a book of recreational mathematics. It is written by Paul J Nahin and uses code designed for MATLAB to solve several problems that are difficult to solve using analysis. Each program utilizes Monte Carlo simulations to attempt the problem one million times. Although the programs are written in MATLAB there is no reason why you can’t translate them into another language.
There are twenty-one problems to tackle in this book. Digital Dice is split into two major parts; initially, it gives you the problems, then it gives you a solution in MATLAB. The given solution is examined by the author for each line of code. It helpfully tells you what the program is doing in each line. Before the book even gets to the code in MATLAB it goes into how to solve the problem with applied mathematics. The book also contains an introduction that gives you a little bit of ground to build up your understanding of probabilities. At the end of each solution is a reference section that has little notes and tips on further reading.
Digital Dice has nine appendices that show extra information related to probability. The book doesn’t throw around too many terms, but there is a glossary if you are confused with some of them.
Although the original book was written back in 2008, I have the second printing which was released in 2013. It contains some corrections by the author. This book is excellent. It is clearly written and has a slight sense of humor to it.
A nice short book on the use of Monte Carlo simulations (or random number generation) to solve some fun problems. The problems are all written in a recreational or puzzle-like style but a number of them are toy versions of topics of real interest.
The book is in 3 parts: an introduction where the Monte Carlo concept is explained and the classic determination of pi is discussed; the problem descriptions (21 in total); and Nahin's solutions. The solutions involve analytical "setting up" of the problem which requires a greater comfort with mathematical concepts and notation than most puzzle books. Nahin also provides listings of the code, in Matlab, that he used to solve the problems. Matlab is easy to read and can be run as is (in most cases) with the free open source Octave . The code is deliberately straight-forward and Nahin acknowledges that if you are competent programmer you can no doubt can improve on his work. However, teaching coding wasn't his intent.
Many of us have spent a lot of time doing algebra, or working out geometrical solutions to problems. However, in our work lives, we do Monte Carlo simulations to solve problems, and most of us have never done this recreationally, nor do we have ready to hand formula on accuracies and convergence -- this book provides both (and the author has some other books in the series).