POV-Ray : Newsgroups : povray.advanced-users : Random variation Server Time
29 Jul 2024 14:19:19 EDT (-0400)
  Random variation (Message 6 to 15 of 25)  
<<< Previous 5 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Christopher James Huff
Subject: Re: Random variation
Date: 26 Sep 2002 14:59:00
Message: <chrishuff-DAA116.14561326092002@netplex.aussie.org>
In article <3D93329F.A5E1E5C4@gmx.de>,
 Christoph Hormann <chr### [at] gmxde> wrote:

> Hmm, i'm not sure.  If it is possible that two consecutive occur in a
> sequence of random numbers what is the probability of this event?

Ideally, just as likely as any other single combination. That is, not 
very likely with this large of a large set of possible combinations.
Say you have 2 (identical) dice. Is the 1:1 combination less likely than 
the 1:4 combination?


> In fact i don't even know if mathematics deal with something like non
> integer random numbers.

It does, it doesn't matter if it is integer or not, as long as it is a 
set of specific values. There is a finite number of values that can be 
represented with a double precision variable, with a perfect random 
number generator any one of those values would be equally likely, 
whether or not it had just come up the previous time. Assuming the 
values are evenly spaced, that is...I think. It depends on how you look 
at it and what exactly you want, I guess.

Ok, IANAM (I Am Not A Mathematician), and have never taken a statistics 
or set theory course, but:
Picking a random value from a finite set, each value has an equal chance 
of coming up, even if it was the previous value.

A perfect random number generator would produce a flat distribution, any 
range of resulting values would on average be hit the same number of 
times as any other range of equal length. You will get the same number 
of values in the range [0, 0.1] as in [0.5, 0.6] and [0.9, 1]. (on 
average of course)

I do not think all possible values a double can hold in the [0, 1] range 
are evenly distributed...it is probably close enough though. If the 
distribution is off, say there are twice as many values in the lower 
half of the range then in the upper half, a specific value in the lower 
half will have to be less likely than a specific value in the upper half 
if you want to keep a flat distribution. However, POV creates a 
pseudo-random integer value and scales it down to the right range, so 
they are evenly spaced as well as a double value can approximate and the 
generator can generate.

BTW, the algorithm POV uses to compute the next random number is:
  next_rand[stream] = next_rand[stream] * 1812433253L + 12345L;
  return((DBL)(next_rand[stream] & 0xFFFFFFFFUL) / 0xFFFFFFFFUL);

The seed() function sets the initial value of next_rand and returns the 
stream index.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christoph Hormann
Subject: Re: Random variation
Date: 26 Sep 2002 15:30:22
Message: <3D93604D.4292E793@gmx.de>
Christopher James Huff wrote:
> 
> > In fact i don't even know if mathematics deal with something like non
> > integer random numbers.
> 
> It does, it doesn't matter if it is integer or not, as long as it is a
> set of specific values. There is a finite number of values that can be
> represented with a double precision variable, with a perfect random
> number generator any one of those values would be equally likely,
> whether or not it had just come up the previous time. Assuming the
> values are evenly spaced, that is...I think. It depends on how you look
> at it and what exactly you want, I guess.
> 
> [...]

All right, but mathematics don't care about double precision so since
there is an infinite number of real numbers between 0 and 1...

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Shay
Subject: Re: Random variation
Date: 26 Sep 2002 15:32:23
Message: <3d9360c7$1@news.povray.org>
Christopher James Huff <chr### [at] maccom> wrote in message
news:chr### [at] netplexaussieorg...
>
> Ideally, just as likely as any other single combination. That is, not
> very likely with this large of a large set of possible combinations.
> Say you have 2 (identical) dice. Is the 1:1 combination less likely than
> the 1:4 combination?
>

Really one die thrown twice might be a better example. Otherwise 4:1 would
be considered along with 1:4.

 -Shay


Post a reply to this message

From: Shay
Subject: Re: Random variation
Date: 26 Sep 2002 15:43:49
Message: <3d936375$1@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote in message
news:3D93604D.4292E793@gmx.de...
>
> All right, but mathematics don't care about double precision so since
> there is an infinite number of real numbers between 0 and 1...
>

Would this matter? The second hand of a clock points in an infinite number
of directions, but also moves in infinitely small increments, so at some
point each minute the second hand is pointing exactly at the center of the
12 on the clock. It spends as much time in this position as in every other
(infinite) position on the clock.

 -Shay


Post a reply to this message

From: Christoph Hormann
Subject: Re: Random variation
Date: 26 Sep 2002 15:55:39
Message: <3D93663B.471DD47E@gmx.de>
Shay wrote:
> 
> > All right, but mathematics don't care about double precision so since
> > there is an infinite number of real numbers between 0 and 1...
> >
> 
> Would this matter? [...]

Yes, this means the chance that two consecutive random numbers have
exactly the same value is infinitely small.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Shay
Subject: Re: Random variation
Date: 26 Sep 2002 16:01:09
Message: <3d936785$1@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote in message
news:3D93663B.471DD47E@gmx.de...
>
> Yes, this means the chance that two consecutive random numbers have
> exactly the same value is infinitely small.
>

...and equal to any other sequence. I think that we are all agreeing with
each other.

 -Shay


Post a reply to this message

From:
Subject: Re: Random variation
Date: 26 Sep 2002 16:05:04
Message: <3d93677c.99183057@news.povray.org>
On Thu, 26 Sep 2002 14:56:13 -0400, Christopher James Huff
<chr### [at] maccom> wrote:
>Say you have 2 (identical) dice. Is the 1:1 combination less likely than 
>the 1:4 combination?

Yes. Given that the two dice are identical you can't tell the
difference between 1:4 and 4:1, thus 4:1 is twice as likely to occur
as 1:1. If we change the premise so we only have one dice that we roll
twice 1:4 is as likely to occur as 1:1, now we've given value to the
order (1:4 <> 4:1). If you really want fun with permutations, try to
calculate the cumulative odds on a slot machine. I once attempted that
for a simulated slot machine I programmed, I ended up fiddling the
values until emparative testing showed the desired return rate (or
close enough) instead.

/Erkki


Post a reply to this message

From: Christopher James Huff
Subject: Re: Random variation
Date: 26 Sep 2002 16:11:48
Message: <chrishuff-FF433B.16091526092002@netplex.aussie.org>
In article <3D93604D.4292E793@gmx.de>,
 Christoph Hormann <chr### [at] gmxde> wrote:

> All right, but mathematics don't care about double precision

What branch of mathematics are you thinking of? Computer science is 
largely mathematics, and definitely does care. Finite binary 
representations of numeric values may not matter in the abstract 
concepts of mathematics, but those concepts do deal with the same 
situations.


> so since there is an infinite number of real numbers between 0 and 
> 1...

A specific value still has the same chance of coming up. It doesn't 
matter if it has already come up the previous time, or the previous 10 
times. Um...I really don't know how to express this, I haven't taken any 
classes in it or done much research on my own. The probability seems to 
be 0 but is obviously not 0, and I thought things like the term 
"infinitesimal" weren't used any more. How about: as the size of the set 
(n) increases towards infinity, the probability of a specific value 
being picked (1/n) decreases towards 0, with all values having an equal 
possibility of being picked.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: Random variation
Date: 26 Sep 2002 16:16:11
Message: <chrishuff-B5D58B.16133826092002@netplex.aussie.org>
In article <3d93677c.99183057@news.povray.org>,
 Erk### [at] povrayorg (Erkki S?ndergaard) wrote:

> Yes. Given that the two dice are identical you can't tell the
> difference between 1:4 and 4:1, thus 4:1 is twice as likely to occur
> as 1:1. If we change the premise so we only have one dice that we roll
> twice 1:4 is as likely to occur as 1:1, now we've given value to the
> order (1:4 <> 4:1). If you really want fun with permutations, try to
> calculate the cumulative odds on a slot machine. I once attempted that
> for a simulated slot machine I programmed, I ended up fiddling the
> values until emparative testing showed the desired return rate (or
> close enough) instead.

Gah, alright, I misstated the problem. You know what I meant... ;-)

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christoph Hormann
Subject: Re: Random variation
Date: 26 Sep 2002 17:09:04
Message: <3D937770.2863EBC7@gmx.de>
Christopher James Huff wrote:
> 
> > All right, but mathematics don't care about double precision
> 
> What branch of mathematics are you thinking of? Computer science is
> largely mathematics, and definitely does care. [...]

I'm talking about those parts of mathematics that consider there are an
infinite number of real numbers between 0 and 1.

I'm not sure about the precise english terms, but math distinguishes
between natural numbers (integers: 1, 2, 3, ...), rational numbers
(numbers that can be represented as a fraction of two natual numbers) and
real numbers (rational numbers and all other numbers like sqrt(2), pi,
etc.).  The latter two categories are those where two consecutive random
numbers from a given range won't be identical (assuming there is a
mathematical definition of random numbers in that category, which i
doubt).

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

<<< Previous 5 Messages Goto Latest 10 Messages Next 10 Messages >>>

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