|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
How many numbers are in the rand stream before it repeats itself, or is this a
meaningless question?
--
#macro A(V,B,C,R)#while(B-256)#if(V-128/B>=0)sphere{0,.5translate<C-4R-1,9>
pigment{rgb<1-C/8R/2C/8>}}#local V=V-128/B;#end#local B=B*2;#local C=C+1;#
end#end A(234,1,0,2)A(85,1,0,1)A(81,1,0,0)light_source{-5 1}//Tom Melly
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Repitition is inherent in randomness.
"Tom Melly" <tom### [at] tomandlucouk> wrote in message
news:3e492ce1@news.povray.org...
> How many numbers are in the rand stream before it repeats itself, or is
this a
> meaningless question?
>
> --
> #macro
A(V,B,C,R)#while(B-256)#if(V-128/B>=0)sphere{0,.5translate<C-4R-1,9>
> pigment{rgb<1-C/8R/2C/8>}}#local V=V-128/B;#end#local B=B*2;#local C=C+1;#
> end#end A(234,1,0,2)A(85,1,0,1)A(81,1,0,0)light_source{-5 1}//Tom Melly
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Harold" <bai### [at] 3dculturecom> wrote in message
news:3e493171$1@news.povray.org...
> Repitition is inherent in randomness.
but isn't it a pseudo random string? - i.e. the repitition is predictable.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Tom Melly <tom### [at] tomandlucouk> wrote:
> How many numbers are in the rand stream before it repeats itself, or is this a
> meaningless question?
Test it?
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3e493e0c@news.povray.org...
> Test it?
I sort of am (I'm trying to get a specific sequence of numbers from a random
stream - don't ask).
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Tom & Lu Melly" <all### [at] tomandlucouk> wrote
>
> I sort of am (I'm trying to get a specific sequence of numbers from a
random
> stream - don't ask).
>
Wh.........
*realises he's just been told not to ask*
John
--
Run Fast
Run Free
Run Linux
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Tom Melly wrote:
>
> How many numbers are in the rand stream before it repeats itself, or
> is this a meaningless question?
#declare rsA=seed(0);
#declare rsB=seed(0);
#local sA=0;#local sB=-1;
#local cR=0;
#while(sA!=sB)
#local sA=rand(rsA);
#local sB=rand(rsB);
#local sB=rand(rsB);
#local cR=cR+1;
#end
#debug concat("Seed repeats after ",str(cR,0,0)," repetitions.\n"
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"John VanSickle" <evi### [at] hotmailcom> wrote in message
news:3E4### [at] hotmailcom...
> #debug concat("Seed repeats after ",str(cR,0,0)," repetitions.\n"
I'll take your word for it ;) Many thanks...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
John VanSickle <evi### [at] hotmailcom> wrote:
> #while(sA!=sB)
Are you completely sure that the same number will not appear twice
in the stream without looping back to the beginning?
Naturally this might be so, but if the random number generator is made
even with the slightest quality, the same number can repeat many times
in the stream before it loops over.
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |