[fpc-pascal] quality of FPC random

Michael Schnell mschnell at lumino.de
Mon Aug 17 10:14:11 CEST 2015


On 08/14/2015 04:27 PM, Xiangrong Fang wrote:
>
>
> Well, practically, how can I get totally unpredictable numbers?

Nothing is totally unpredictable :-)

I would set randseed via randseed and after this you can just use rand() 
for at least 2 gig numbers without any perceptible predictability.

> On stackoverflow, someone suggested using hash value of data as IV, 
> but that's still flawed somehow.

There are lots of "scientific" articles on creating random numbers (I 
read some during my work at the university). Most of them are just 
nonsense.

The common request is "unpredictable" and "equal distribution".

But a "real" random generator *can (and according to Murphy will 
sometimes during Eternity) *happily create an uninterrupted series of a 
million of Zeros. To human perception this is neither unpredictable nor 
equal distribution. In fact random numbers are just a matter of taste.

-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150817/11c9d354/attachment.html>


More information about the fpc-pascal mailing list