[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bad random numbers
From: |
Mike Miller |
Subject: |
Re: bad random numbers |
Date: |
Tue, 13 Jul 1999 20:28:14 -0500 (CDT) |
Not everyone is getting it. Look at these two lines:
echo 'rand(3)' | octave -q
echo 'rand("seed",time);rand(3)' | octave -q
Question: If rand gets its seed from the clock when octave starts, then
why does the first command line above give aberrant results while the
second command works beautifully?
Answer: There is an error in the generation of the initial seed.
Am I wrong?
I don't know C and can't fix it, but it should be easy for a C programmer
to compare rand.cc and randinit.m and figure out what's wrong in rand.cc.
MATLAB doesn't promise to generate a seed from the system clock at
startup. It would be nice if they did generate the seed, but they don't
do it, so I can't criticize their method of seed generation.
Mike
--
Michael B. Miller
University of Missouri--Columbia
http://taxa.psyc.missouri.edu/~mbmiller/
---------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL. To ensure
that development continues, see www.che.wisc.edu/octave/giftform.html
Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
---------------------------------------------------------------------
- Re: bad random numbers, (continued)
Re: bad random numbers, Mike Miller, 1999/07/13
- Re: bad random numbers, John W. Eaton, 1999/07/13
- Re: bad random numbers, Mike Miller, 1999/07/13
- Re: bad random numbers, John W. Eaton, 1999/07/13
- Re: bad random numbers, A+A Adler, 1999/07/13
- Re: bad random numbers,
Mike Miller <=
- Re: bad random numbers, John Judge, 1999/07/13
- Re: bad random numbers, lash, 1999/07/13
- Re: bad random numbers, Mike Miller, 1999/07/14
- Re: bad random numbers, lash, 1999/07/14
- Re: bad random numbers, Jim Van Zandt, 1999/07/14
- Re: bad random numbers, John W. Eaton, 1999/07/14
Re: bad random numbers, Thomas Walter, 1999/07/14
Re: bad random numbers, Eric Ortega, 1999/07/15
Re: bad random numbers, Jim Van Zandt, 1999/07/14
Re: bad random numbers, John Smith, 1999/07/14