Computational Physics

(Rick Simeone) #1

Appendix B


Random number generators


B1 Random numbers and pseudo-random numbers


Random numbers are used in many simulations, not only of gambling tables but
also of particle accelerators, fluids and gases, surface phenomena, traffic and so
forth. In all these simulations some part of the system responsible for the behaviour
under investigation is replaced by events generated by a random number generator,
such as particles being injected into the system, whereas the source itself is not
considered. Here we discuss various methods used for generating random numbers
and study the properties of these numbers.
Random numbers are characterised by the fact that their value cannot be
predicted. More precisely, if we construct a sequence of random numbers, the
probability distribution for a new number is independent of all the numbers gen-
erated so far. As an example, one may think of throwing a die: the probability of
throwinga3isindependent of the results obtained before. Pure random numbers
may occur in experiments: for a radioactive nucleus having a certain probability of
decay, it is not possible to predictwhenit will decay. There is an internet service,
http://www.fourmilab.ch/hotbits/which creates random numbers in
this way and sends them over the internet (a careful correction has been carried out
to remove any bias resulting in a majority of either 1 or 0). These numbers aretruly
random [ 1 , 2 ].
On the other hand, random numbers as generated by a computer are not truly ran-
dom. In all computer generators the new numbers are generated from the previous
ones by a mathematical formula. This means that the new value is fully determ-
ined by the previous ones! However, the numbers generated with these algorithms
often have properties making them very suitable for simulations. Therefore they
are calledpseudo-randomnumbers. In fact, a ‘good’ random number generator
yields sequences of numbers that are difficult to distinguish from sequences of pure
random numbers, although it is not possible to generate pseudo-random numbers
that are completely indistinguishable from pure ones. In the following, we drop the
prefix ‘pseudo’ when we are dealing with random numbers generated in a computer.


605
Free download pdf