POV-Ray : Newsgroups : povray.general : random numbers Server Time
8 Aug 2024 08:18:25 EDT (-0400)
  random numbers (Message 1 to 10 of 20)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Tom Melly
Subject: random numbers
Date: 7 Feb 2001 10:47:27
Message: <3a816e0f$1@news.povray.org>
Does the seed for random numbers make any difference (apart from generating
a diff. sequence)? Are big numbers better than small numbers? Are fractional
numbers better than integers?

(by "better" I suppose I mean "a longer, more random, sequence")

Also, is the random number sequence a fixed sequence, with the seed just
controlling the point at which you join the sequence. If it is a fixed
sequence, how long is it?


Post a reply to this message

From: Ken
Subject: Re: random numbers
Date: 7 Feb 2001 12:13:15
Message: <3A8182D3.B378D2C3@pacbell.net>
Tom Melly wrote:
> 
> Does the seed for random numbers make any difference (apart from generating
> a diff. sequence)?

No.

> Are big numbers better than small numbers?

See above.

> Are fractional numbers better than integers?
> 
> (by "better" I suppose I mean "a longer, more random, sequence")

See above.
 
> Also, is the random number sequence a fixed sequence, with the seed just
> controlling the point at which you join the sequence.

Yes.

> If it is a fixed sequence, how long is it?

I don't know.

-- 
Ken Tyler


Post a reply to this message

From: Warp
Subject: Re: random numbers
Date: 7 Feb 2001 12:24:32
Message: <3a8184d0@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
: Does the seed for random numbers make any difference (apart from generating
: a diff. sequence)? Are big numbers better than small numbers? Are fractional
: numbers better than integers?

  I have never heard that it would make any difference.

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

From: Tom Melly
Subject: Re: random numbers
Date: 7 Feb 2001 15:02:40
Message: <3a81a9e0@news.povray.org>
"Ken" <tyl### [at] pacbellnet> wrote in message
news:3A8182D3.B378D2C3@pacbell.net...
>
>
> Tom Melly wrote:
> >
>
> > Also, is the random number sequence a fixed sequence, with the seed just
> > controlling the point at which you join the sequence.
>
> Yes.
>

This resolves all the other questions.

> > If it is a fixed sequence, how long is it?
>
> I don't know.
>

Except this one.


Post a reply to this message

From: Christoph Hormann
Subject: Re: random numbers
Date: 7 Feb 2001 15:16:11
Message: <3A81AD0B.42C66E2D@gmx.de>
Tom Melly wrote:
> 
> This resolves all the other questions.
> 
> > > If it is a fixed sequence, how long is it?
> >
> > I don't know.
> >
> 
> Except this one.

I don't know about this particular random number generator, but a good one
should have a period of at least several millions.  

According to the comments in the HF-Lab/gforge source code, the best
existing random number generator has a period of 10^600 while the one used
there has 2^144.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Ron Parker
Subject: Re: random numbers
Date: 7 Feb 2001 16:47:39
Message: <slrn983gk5.5lm.ron.parker@fwi.com>
On Wed, 7 Feb 2001 15:47:27 -0000, Tom Melly wrote:
>If it is a fixed sequence, how long is it?

The generator function is 

next_rand[stream] = next_rand[stream] * 1812433253L + 12345L;

which doesn't look particularly well-chosen to me.  But if it's done right,
I'd guess that the period is pretty large (i.e. at least 1812433253).  
Perhaps someone who's read volume 3 of Knuth more recently than I can 
confirm or deny.  Or perhaps I can dig out my copy of volume 3 and try to 
find a better PRNG for 3.5, since we've all seen some of the bad results 
you can get from the current one.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: Peter J  Holzer
Subject: Re: random numbers
Date: 7 Feb 2001 18:03:01
Message: <slrn983kp1.pho.hjp-usenet@teal.h.hjp.at>
On 2001-02-07 15:47, Tom Melly <tom### [at] tomandlucouk> wrote:
>If it is a fixed sequence, how long is it?

2^32.

	hp


-- 
   _  | Peter J. Holzer    | All Linux applications run on Solaris,
|_|_) | Sysadmin WSR       | which is our implementation of Linux.
| |   | hjp### [at] wsracat      | 
__/   | http://www.hjp.at/ |	-- Scott McNealy, Dec. 2000


Post a reply to this message

From: Alessandro Coppo
Subject: Re: random numbers
Date: 7 Feb 2001 18:43:59
Message: <3a81ddbf@news.povray.org>
If you look around you will find lots of generators better than the one used
in POV. By the way (and this is an official request to POVTeam) even without
switching to the best currently known even the Park-Miller minimal standard
is better ...and YES, they are not significantly slower.

Some URLs:
*) A place to start: http://csrc.nist.gov/rng/
*) Park Miller Minimal Standard
http://htm4.ee.queensu.ca:8000/ling/minrng.html
*) Mersenne Twister, currently the best known
http://www.math.keio.ac.jp/~matumoto/emt.html,  period is 2**19937-1 it's
not a typo... about 10**6000!!!

Alessandro Coppo
a.c### [at] iolit


Post a reply to this message

From: Ben Paschke
Subject: Re: random numbers
Date: 8 Feb 2001 00:12:58
Message: <3A822B32.E4BBE34E@rsp.com.au>
Ron Parker wrote:

>  better PRNG for 3.5, since we've all seen some of the bad results
> you can get from the current one.

..bad results ??
i use the function a whole lot - what do i need to look out for?


Post a reply to this message

From: Alessandro Coppo
Subject: Re: random numbers
Date: 8 Feb 2001 03:04:47
Message: <3a82531f@news.povray.org>
If you use it to randomly locate objects on a square, they look somewhat
"gridded". I noticed this creating scenes with lots (1000's) of "simple
trees" viewed from above. Anyway, this generator is known from a long time
not to pass several simple tests (well, apart from the infamous RANDU, it is
actually one of the worst).

Alessandro Coppo
a.c### [at] iolit


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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