bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-apl] Bad quality of the roll function


From: Kacper Gutowski
Subject: [Bug-apl] Bad quality of the roll function
Date: Wed, 20 Aug 2014 06:47:56 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

Currently GNU APL uses LCG with modulus 2⋆64 and then reduces values modulo
desired range.  This, beside being slightly biased for ranges not dividing
the modulus, yields reduced periods when range is power of two.

      ?10 16⍴16
11 2 13 12 15 6 1 16 3 10 5 4 7 14 9 8
11 2 13 12 15 6 1 16 3 10 5 4 7 14 9 8
11 2 13 12 15 6 1 16 3 10 5 4 7 14 9 8
11 2 13 12 15 6 1 16 3 10 5 4 7 14 9 8
11 2 13 12 15 6 1 16 3 10 5 4 7 14 9 8
11 2 13 12 15 6 1 16 3 10 5 4 7 14 9 8
11 2 13 12 15 6 1 16 3 10 5 4 7 14 9 8
11 2 13 12 15 6 1 16 3 10 5 4 7 14 9 8
11 2 13 12 15 6 1 16 3 10 5 4 7 14 9 8
11 2 13 12 15 6 1 16 3 10 5 4 7 14 9 8

Doesn't look very random to me.


-k



reply via email to

[Prev in Thread] Current Thread [Next in Thread]