[vox-tech] random number question
Peter Jay Salzman
vox-tech@lists.lugod.org
Wed, 15 May 2002 12:41:43 -0700
hi mark,
begin Mark K. Kim <markslist@cbreak.org>
> On Wed, 15 May 2002 msimons@moria.simons-clan.com wrote:
>
> > I think each sequence is completely independent of the others...
> > in that the order of numbers in one cycle of all sequences will be
> > different.
>
> It generates the numbers in the same sequence with the algorithm I'm
> thinking about, but I'm sure there are better algorithms implemented in
> the C library. It's simple enough to detect a cycle and reseed the random
> number generator, anyway.
doesn't that depend? suppose all-in-all i want to pull 10,000,000
random numbers from rand(). is there a fast, memory efficient way to
detect a "cycle back"?
i'm just asking out of curiosity -- the man page for random() (which
jeff said is used to implement rand()) claims to have a period of
approximately 16*((2^31)-1). that's about 34,359,738,352. this is
large even by monte carlo standards.
i'm mainly just curious if there's a nice algorithm to detect cycling in
such a large amount of data.
pete