

\section{Random Number Generators}


\begin{slide}
\subsection{\bf Pseudo-Random Numbers}

Monte Carlo simulations are inherently probabilistic, and thus make 
frequent use of programs to generate random numbers, as do many other
applications. On a computer these numbers are not random at all --
they are strictly deterministic and reproduceable. For this reason 
such programs are more correctly called {\it pseudo-random number generators}.

A standard pseudo-random number generator aims to produce a sequence of
real random numbers that are uncorrelated and uniformly distributed in the
interval [0,1). Such a generator can also be used to produce random 
integers and sequences with a probability distribution that is not uniform.

\end{slide}


\begin{slide}
\subsection{\bf Essential Properties of a Random Number Generator}

{\bf Repeatability} -- the same sequence should be produced with the same
initial values (or {\it seeds}). This is vital for debugging etc.

{\bf Randomness} -- should produce independent uniformly distributed random
variables that pass all statistical tests for randomness.

{\bf Long period} -- a computer generated pseudo-random number sequence
is repeatable and uses finite precision arithmetic, so the sequence must 
repeat itself with a finite period. This should be much longer than 
the  number of random numbers needed for the simulation.

\end{slide}


\begin{slide}
\subsection{\bf Further Properties of a Good Random Number Generator}

{\bf Portability} -- should give the same results on different computers.

{\bf Efficiency} -- should be fast (small number of floating point 
operations) and not use much memory.

{\bf Insensitive to seeds} -- period and randomness properties should not
depend on the initial seeds.

{\bf Disjoint subsequences} -- different seeds should produce long 
independent (disjoint) subsequences so that there are no correlations
between simulations with different initial seeds.

{\bf Homogeneity} -- sequences of all bits should be random.

\end{slide}


% Brief History??


\begin{slide}
\subsection{\bf Multiplicative Linear Congruential Generators}

One of the simplest, most widely used, and oldest (D.H. Lehmer, 1948)
random number generators is the (multiplicative) linear congruential 
generator (MLCG or LCG).
The generator is specified by integer constants $A$, $C$ and $M$, 
and produces a sequence ${s_i}$ of random integers via

\begin{equation}
\end{equation}

For real numbers in [0,1) can just use $r_i = s_i / M$, so $M$ should be
large (near $2^{32}$ for 32-bit real numbers).

$A$, $C$ and $M$ must be carefully chosen in order to produce sequences
that are random and have a long period. $M$ is the maximum period 
for this type of generator, but it can be much less.

\end{slide}


\begin{slide}
\subsection{\bf Some Good Parameter Choices}


\end{slide}


\begin{slide}
\subsection{\bf Problems with Linear Congruential Generators}

Linear Congruential Generators are very efficient, are theoretically 
quite well understood, and work well for many applications. However they
have some serious drawbacks:

\begin{itemize}

\item 
The maximum period is $M-1$, which is much too small for 32-bit
generators where $M \leq 2^{32} \approx 10^9$, which can be exhausted
in a few minutes on a workstation. Need to use integers with at least
48 and preferably closer to 64 bits.

\item
$d$-tuples of such numbers show a regular lattice structure when plotted 
in $d$-dimensions. This is called the {\it scatter plot} test.

\item
These generators have been proven to have correlations between numbers
that are $2^n$ apart in the sequence. This can be a major problem for
applications using a regular grid or lattice . 

\end{itemize}

\end{slide}


\begin{slide}
\subsection{\bf Combined Linear Congruential Generators}

Empirically is has been shown that all the drawbacks of LCGs can be 
overcome by combining two LCGs, again with carefully chosen parameters.

\end{slide}


\begin{slide}
\subsection{\bf Scatter Plot Tests}


\end{slide}



\begin{slide}

\subsection{\bf Parallel Algorithm using Leapfrog}


\end{slide}


\begin{slide}

\subsection{\bf Parallel Algorithm using Splitting}


\end{slide}



\begin{slide}

\subsection{\bf Lagged Fibonacci Generators}

\end{slide}


\begin{slide}

\subsection{\bf Properties of Lagged Fibonacci Generators}

\end{slide}


\begin{slide}

\subsection{\bf Problems with Lagged Fibonacci Generators}

\end{slide}


\begin{slide}

\subsection{\bf Parallel Lagged Fibonacci Generators}

\end{slide}


\begin{slide}

\subsection{\bf Tests of Randomness}

\end{slide}


\begin{slide}

\subsection{\bf Monte Carlo Tests}

\end{slide}




\begin{slide}

\subsection{\bf References}

\end{slide}


