POV-Ray : Newsgroups : povray.general : rand question : Re: rand question Server Time
5 Nov 2024 20:17:20 EST (-0500)
  Re: rand question  
From: Vadim Sytnikov
Date: 11 Feb 2003 14:25:54
Message: <3e494e42$1@news.povray.org>
"Tom Melly" <tom### [at] tomandlucouk> wrote:
> How many numbers are in the rand stream before it repeats itself, or is
this a
> meaningless question?

I assume we're talking about pseudo random numbers generators here, right?

The number you are talking about is known as the period of a generator and
is one of its most important properties... The two best generators that I
know are RANDMAR (with period 2^144; I use this one in my projects), and
R250 (with period 10^250, i.e. 1e251).

BTW, the "before it repeats itself" actually applies to the sub-sequences,
and not to individual numbers... RNGs' internals make it possible for many
different numbers to follow any given number. For instance, the following
sequence is easily possible with many RNGs:

1 2 3 4 2 9

Notice that 2 is first followed by 3, and then by 9. But if the period of
this generator is 6 :-), then 9 will be followed by 1 -- it is here that the
actual repetition takes place.

...

Oh well, I just figured out that that's p.g, so you probably meant POV-Ray
streams. Sorry for an off-topic post. Follow-ups to p.programming.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.