help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: generating random numbers -- what seeds to use?


From: Bob Bailey
Subject: Re: generating random numbers -- what seeds to use?
Date: Mon, 28 Apr 2003 09:53:22 +0800

If you want truly random numbers (but not huge quantities),
check out Hotbits at
http://www.fourmilab.ch/hotbits
These can at least provide random seeds for rn algorithms.
You never need to use correlated seeds again!

Also, the GNU Scientific Library has quite a number of
the best rn generators.  It's not Octave/Matlab, but if you
just want files of rn's, why must you use O/M?
http://www.gnu.org/software/gsl

Bob Bailey

----- Original Message ----- 
From: "John W. Eaton" <address@hidden>
To: "Mike Miller" <address@hidden>
Cc: "Help-Octave List" <address@hidden>
Sent: Monday, April 28, 2003 9:03 AM
Subject: generating random numbers -- what seeds to use?


> On 27-Apr-2003, Mike Miller <address@hidden> wrote:
> 
> | I need to create large amounts of random data under a certain model.  I
> | wanted to produce 10,000 files, so I set 10 different processors to the
> | task of executing an octave scrit that would make 1,000 files.
> | Unfortunately, I forgot that some of the jobs were starting at nearly the
> | same moment, so they took the same seed from the clock and produced the
> | same 'random' files!
> | 
> | I'd still like to run 10 jobs at once, but I'll have to supply initial
> | seeds.  Is there any way that I can guarantee that I won't produce the
> | same file twice?  What is the best way to choose seeds?  What is the
> | period for Octave's random number generator?  Has anyone developed other
> | random number generators for Octave?
> 
> Why not generate all the random numbers in advance?  For example, for
> N random numbers in each of M files, something like
> 
>   for i = 1:M
>     f = fopen (sprintf ("rnd-%d", i), "w");
>     fwrite (f, rand (N, 1), "double");
>     fclose (f);
>   endfor
> 
> Then you could read these files for your data generation processes.
> 
> jwe
> 
> 
> 
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
> 
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]