Quantum mechanics introduces a concept of randomness in the behaviour of physical processes. The virtue of event generators is that this randomness can be simulated by the use of Monte Carlo techniques. In the process, the program authors have to use some ingenuity to find the most efficient way to simulate an assumed probability distribution. A detailed description of possible techniques would carry us too far, but in this section some of the most frequently used approaches are presented, since they will appear in discussions in subsequent sections. Further examples may be found e.g. in [Jam80].
First of all one assumes the existence of a random number generator. This is a (Fortran) function which, each time it is called, returns a number in the range between 0 and 1, such that the inclusive distribution of numbers is flat in the range, and such that different numbers are uncorrelated. The random number generator that comes with PYTHIA is described at the end of this section, and we defer the discussion until then.