New PRNG method
|
09-13-2024, 02:12 AM
Post: #7
|
|||
|
|||
RE: New PRNG method
As I read the method (didn't do the code), the only source of new data is the repeated addition of Pi. This produces something like a Kronecker-Weyl-Richtmeyer sequence using Pi as the irrational generator. One gets a uniformly distributed sequence, not a pseudo-random sequence. Two obvious problems are that the terms of the sequence are highly correlated and the discrepancy (counts in intervals vs interval sizes) is too uniform.
To some extent, this can be mitigated by something similar to the generators I've presented here somewhere. One needs to take several sequences to defeat the correlation. Quick example: let a1,a2,a3...,ak be a set of k irrationals that are linearly independent over the rationals; I like the square roots of the primes, the square-free numbers, or (my favorite) the fractional parts of the square roots of primes, P, of the form: 4*j+1. Then take Frac((Sqrt(P))+1)/2. Start with a set of initial values (zero is good as is any other number between 0 and 1), x1,x2,x3...xk. One forms a sequence xj=xj+aj mod 1, equivalent to xj=Frac(xj+aj). It's fairly fast. This construction is provably uniformly distributed in the k-cube. Then one adds the numbers for the same number of steps and again takes the fractional part. Using k terms, the k-fold autocorrelation must quickly converge to 0. For various reasons, I like to use continued fractions close to the irrationals; it allows for exact arithmetic regardless of the floating point style used on a computer and can be completely portable. Homework: try the sequences formed from (Sqrt(P)+1)/2, with P being 5,13,17,39,37,41,... |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
New PRNG method - Namir - 09-12-2024, 01:09 PM
RE: New PRNG method - Albert Chan - 09-12-2024, 03:55 PM
RE: New PRNG method - Namir - 09-12-2024, 06:39 PM
RE: New PRNG method - Namir - 09-12-2024, 10:03 PM
RE: New PRNG method - Albert Chan - 09-12-2024, 10:34 PM
RE: New PRNG method - Albert Chan - 09-12-2024, 11:36 PM
RE: New PRNG method - ttw - 09-13-2024 02:12 AM
RE: New PRNG method - Namir - 09-13-2024, 09:19 PM
RE: New PRNG method - AnnoyedOne - 09-14-2024, 04:06 PM
RE: New PRNG method - Namir - 09-15-2024, 01:09 PM
RE: New PRNG method - ttw - 09-15-2024, 04:15 PM
RE: New PRNG method - Namir - 09-17-2024, 09:49 PM
|
User(s) browsing this thread: 1 Guest(s)