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 16:16:59 EDT (-0400)
  Re: Requesting ideas/opinions for RNG seeding syntax  
From: Jay Fox
Date: 26 May 2009 20:05:01
Message: <web.4a1c824f38187d7ed92e869d0@news.povray.org>
"Phoenex" <rib### [at] sapopt> wrote:
> Dr. Jay
>
> Thanks again for your work.
> You know, I will try to beat the MWC from PRNGAlvo.
> I'm kidding.
>
> When I say on my page that this algorithm is not mathematically regular people
> contest.
> But I still think so. but see.
> When we talk about 3.141592 ........, we write PI.
>                                                 __
> When we talk about 1.414213.......... we write V 2    (sqrt(2))
> etc..
>
> Of course, the machines still can not work with symbols and are limited to their
> ability of physical memory.
>
> Imagine that the random numbers generated by a PRNG with double precision are:
>
> 1 - aerwwew = 0.4674858488345345345 ......
> 2 - bgdnmdu = 1 / 3
> 3 - cfsrehhd = Pi
> ....
> ....
> n - xrwmkfifhf = 0.4663728223339 .....
>
> and the internal calculations of a huge pressision
>
> 1/3 is diferente from 0.33333333333333333333 and more rigorous
> Pi is different from 3.1415926535897932384626433832795.... and more rigorous
> and so on.
>
> This is the spirit of this algorithm. And that is why I say that is a nos
> periodic algorithm, mathematically speaking.
>
> I believe that now is the time of our architects / engineers begin a new
> approach in building processors for the future.

>
> Again, I ask. This is mathematical non periodic algorithm?

I see what you're getting at. Actually, if we had unlimited numerical precision,
we wouldn't need a fancy RNG that performs "iterations" and all that pesky work.
We'd just pick a suitable irrational number, and use its expansion in a
suitable base (e.g., base 2^52), and call it a day.

Unfortunately, we don't have unlimited precision. We could use a fancy arbitrary
precision math library, and several good ones are available. The pseudo-random
numbers thus generated would far exceed the quality of most if not all RNG's
already in use today. Unfortunately, the speed would be incredibly slow, to the
point of making these hypothetical RNG's useless.

So, we settle for what can be reasonably calculated with 16-bit, 32-bit, or
64-bit integer math, typically over the field of integers (e.g., the LCG and
MWC generators), but occasionally over the field of polynomials mod 2
(typically written as F2 or GF2, etc.). Linear feedback shift registers fall in
this latter category, and the Mersenne Twister is probably the current favorite
in this category (though I don't particularly care for it).

I think LFSR generators would be far more common if chip-makers included a
multiplicative equivalent of the XOR operator. In fact, were it not for this
lack of xor-multiplication, LFSR's would be my favorite, as you could make a
LFSR equivalent of a MWC generator, with very little effort.

Unfortunately, to do so today would require performing one or two dozen xor
operations just to generate a single high-quality 32-bit random number! The
Mersenne Twister uses a shortcut, where they perform two xor operations to
produce one very random bit and 31 modestly random bits. They then resort to
"tempering" to try to increase the randomness of those 31 questionable bits.
But if we had an xor-multiply, we wouldn't need to resort to tempering.


Post a reply to this message

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