l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2002 May 15 14:17

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] random number question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] random number question

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.

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.