POV-Ray : Newsgroups : povray.general : Requesting ideas/opinions for RNG seeding syntax : Re: Requesting ideas/opinions for RNG seeding syntax Server Time
30 Jul 2024 22:27:21 EDT (-0400)
  Re: Requesting ideas/opinions for RNG seeding syntax  
From: clipka
Date: 23 May 2009 17:10:00
Message: <web.4a1865ca38187d7eefff66860@news.povray.org>
"Phoenex" <rib### [at] sapopt> wrote:
> What about this algorithm
>
> Xn+1 = SXn - INT(SXn)
>
> See
>
> http://www.number.com.pt/index.html

Interestingly simple formula; however, it seems to me that not very much
research has gone into it.

We can observe that the claim

  "Theoretically and mathematically speaking, this algorithm is non periodic"

is substantially invalid at least for some cases of S. The author himself (I
presume that's you?) explicitly concedes that cases giving S = INT(S) are
problematic. However, we find no reasoning why this is so, let alone why the
same problem does not apply to other conditions for S.

Furthermore, the author adds to the seed a "magic" value to generate the
parameter S governing the sequence of random numbers, without giving any
reasoning for his choice of this "magic" number.

There is also no mention of analysis on the influence of rounding on the
algorithm.

The author also claims that

  "The numbers are generated with double precision (64 bit - 8 Bytes), and
therefore a period of 2^53 bit"

However, the author fails to provide evidence that shorter periods can be ruled
out completely.

Analysis of the PRNG seems to have been limited to running a few standard test
suites, and even their reports seem poorly understood by the author.

If this is not the case, then the author has made a poor job at communicating
his findings about the algorithm's quality.


As a mater of fact, a few test runs reveal that the algorithm does in fact have
some more flaws regarding the choice of S; for instance, S = 20000.1 results in
a remarkable distribution pattern, with all (!) 0.1-width intervals from
[0.1;0.2[ to [0.5;0.6[ having a probability of >10%, and all (!) others a
probability of <10%, while the very same pattern is seen inverted with S =
20000.0001. With S = 20000.005, a similar pattern can be seen again, except
that the high-probability intervals are those from [0.2;0.3[ to [0.6;0.7[.

Given that such cases are rather easy to create, this suggests that the author
of the algorithm did not really invest too much time into analyzing the effect
of seeding on the quality of his PRNG - which in turn gives rise to the
assumption that other bad news are still hidden in that area.


Or, to make a long story short:

This algorithm looks like yet another poorly-researched home-brewn PRNG to me,
which may be good enough for some applications, but looks far from well enough
understood to make it *the* future high-quality PRNG for POV-Ray. Sorry pal.

For PRNGs, the same basic rule holds true as for cryptographic algorithms: Never
trust that ingenious system you just invented all on your own - you never know
what pitfalls it may have in stake that you haven't though of. Instead, rather
use a system that has been around a while, even if it has some known
limitations - chances are those are the only issues, so at least you know your
enemy.


Post a reply to this message

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