Java Number Cruncher: The Java Programmer's Guide to Numerical Computing By Ronald Mak
Table of Contents
Part IV. The Joys of Computation
Chapter 14. Generating Random Numbers
Computers are often used to generate random numbers, which are useful for the simulation of physical phenomena, testing, statistical analysis, and computer games .
In this chapter, we first define what we mean by "random" and ask whether or not an algorithm can truly generate random numbers. We then examine algorithms for generating uniformly distributed, normally distributed, and exponentially distributed random numbers.
Finally, we look at a Monte Carlo algorithm, which uses random numbers to derive a result. The algorithm we'll examine is Buffon's needle, which gives us yet another way to compute the value of p ?anot as precise as the algorithms in Chapter 13, but certainly intriguing.