next up previous index
Next: The Bootstrap, Permutation Tests, Up: Random Number Generation Previous: Congruential Methods   Index

Other `Better?' Methods

Substract with Borrow

In stead of a single seed, the random number generator has a state: (35 words of memory), 32 fp numbers z between 0 and 1. The others make up an integer index : $i$, which varies between 1 and 32, and integer $j$ and a 'borrow' flag.

$j$ is used to initialize.

\begin{displaymath}z_i=z_{i+20}-z_{i+5}-b\end{displaymath}

The indices are computed modulo 32.

$z_i= fp(z_i)\; xor \; j$

$b$ is the borrow, small or zero.

Here is what the help says about the new matlab function.

    S = RAND('state') is a 35-element vector containing the current state
    of the uniform generator.  RAND('state',S) resets the state to S.
    RAND('state',0) resets the generator to its initial state.
    RAND('state',J), for integer J, resets the generator to its J-th state.
    RAND('state',sum(100*clock)) resets it to a different state each time.
 
    This generator can generate all the floating point numbers in the 
    closed interval [2^(-53), 1-2^(-53)].  Theoretically, it can generate
    over 2^1492 values before repeating itself.

Complexity Justified Methods
Random number generation is akin to cryptography, knowing that factorising a number into its prime factors is a very HARD problem (computationally) allows one to think up various `multiplicative schemes', for instance:


  1. \begin{displaymath}Y_n=(Y_{n-1})^2\; (mod\; pq),\; for\; p,q\;primes \end{displaymath}


  2. \begin{displaymath}X_n=X_{n-24}*X_{n-55}\; (mod 2^{32})\end{displaymath}



Susan Holmes 2002-01-12