Random number generation, and random seeds.



>>>>> "Stavros" == Stavros Macrakis <macrakis@gmail.com> writes:

    >> I would like to generate pseudo-random numbers in maxima, from a definite seed.
    Stavros> The Maxima Random command uses the Common Lisp random function, which
    Stavros> has no way to set the seed to a definite value.  It does provide for a
    Stavros> random state object which is printable and readable (thus allowing
    Stavros> reproducible random sequences), but GCL is not compliant to this
    Stavros> requirement: its random state objects are not readable.  So in
    Stavros> Maxima/GCL, though it is possible to restart a random sequence in the
    Stavros> same place within a run, it isn't possible to restart it in the same
    Stavros> place in two distinct runs.

It would, however, be relatively easy to provide a new random command
that can be seeded.

CMUCL has a mostly portable implementation of MT-19937.  The cl-bench
benchmarks has portable mrg32k3a generator.  Both of these are
regarded as pretty good generators.

MT-19937 requires some 600 32-bit words of state.  mrg32k3a requires 6
double-floats of state.

Ray