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 :
, which varies
between 1 and 32, and integer
and a 'borrow' flag.
is used to initialize.
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: