Looking for more algorithms for quasirandom numbers

11292019, 01:06 PM
(This post was last modified: 11302019 06:16 AM by Namir.)
Post: #1




Looking for more algorithms for quasirandom numbers
Hi All Math Lovers,
In another thread of mine, ttw mentions quasirandom numbers. Quasirandom numbers (QRNs) present a better spread over a range of values than pseudorandom numbers (PRNs). On the other hand, QRNs will often fail randomness tests. They true purpose to to cover more uniformly a range of values in one of more dimensions. This is part of ttw's response in my other thread, where he mentions QRNs: Quote:The easiest multidimensional quasirandom sequence is the Richtmeyer sequence. One uses the fractional part of multiples of the square roots of primes. Sqrt(2), Sqrt(3), etc. It's quick to do these by just setting x(i)=0 updating by x(i)=Frac(x(i)+Sqrt(P(i))). Naturally one just stores the fractional parts of the irrationals and updates. (List mode). The sequence is also called the Kronecker or Weyl sequence at times. The above text includes the algorithm of setting x(1)=0 updating by x(i)=Frac(x(i)+Sqrt(P(i))). The array of P() represents prime numbers starting with 2. You can change x(1) to had a uniform random number as a seed (to generate different sequences every time you apply the algorithm) or simply set x(1) = sqrt(P(1)) = sqrt(2). I am curious about other formulas to calculate sequences of quasirandom numbers. You are welcome to use your imagination. My first attempt was something like: Code: n = number of x to generate The above code produces x() with a mean near 0.5 and standard deviation near 0.28. The auto correlations for the first 50 lags are in the orde rof 10^(2) to 10^(4). I am curious about other formulas to calculate sequences of quasirandom numbers. You are welcome to use your imagination. You can even commit math heresy!!! As long as it works, you are fine (and forgiven) :) Namir 

« Next Oldest  Next Newest »

Messages In This Thread 
Looking for more algorithms for quasirandom numbers  Namir  11292019 01:06 PM
RE: Looking for more algorithms for quasirandom numbers  SlideRule  11292019, 04:49 PM
RE: Looking for more algorithms for quasirandom numbers  mfleming  11302019, 01:36 AM
RE: Looking for more algorithms for quasirandom numbers  Namir  11302019, 01:29 PM
RE: Looking for more algorithms for quasirandom numbers  Namir  11302019, 07:52 PM
RE: Looking for more algorithms for quasirandom numbers  ttw  12012019, 05:52 AM
RE: Looking for more algorithms for quasirandom numbers  Csaba Tizedes  12012019, 11:46 AM

User(s) browsing this thread: 1 Guest(s)