POV-Ray : Newsgroups : povray.text.scene-files : pseudo-random number generator : Re: pseudo-random number generator Server Time
5 Jul 2024 10:51:01 EDT (-0400)
  Re: pseudo-random number generator  
From: Pete
Date: 17 Aug 2001 19:37:45
Message: <1610.627T573T11803550PeterC@nym.alias.net>
>Pete <Pet### [at] nymaliasnet> wrote:
>: the code I posted *should* be *very* (pseudo) random.

>  Which algorithm does it use? Can you give some values, like standard
>deviation, mean deviation and variance?

        It's the pseudo random number generator for Arc Four, as
described in Bruce Schniers "Applied Cryptography".  Papers and
analysis have been written about this by far better minds than mine!

>  Or did you just came up with the algorithm by trying yourself? Sorry for
>being sceptical, but as a student of computing science I know that making a
>good pseudorandom number generator needs expertise and knowledge.

        Years ago I tried to invent pseudo random algorithms and over
time I realized how lame they were.  So I gave up trying to invent
them.  Now I use "known" "tried and tested" "proven" algorithms
created by people who are much more clever than I am.  This is a port
of an existing algorithm to povray, not a new half-baked home-made
algorithm.

>  A generator made by "trying things" can give results that look quite
>  random,
>but when properly measured can be quite poor. (Of course I'm not saying that
>a very good algorithm cannot be found by chance...)

        The odds of stumbling on to a good algorithm (especially a
good psuedo random generator) are very small.  At least for me.  :)

>--
>#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
>rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
>],13),8)-3,10>#end blob{N(array[6]{11117333955,
>7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

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