3 ms·
The Golden Ratio is proposed as a special multiplier for what is otherwise known as 'linear congruential' psuedorandom number generation. I'm not clear on wheth
by strainer 8y ago
The Golden Ratio is proposed as a special multiplier for what is otherwise known as 'linear congruential' psuedorandom number generation. I'm not clear on whether the non-repetitive property of the ratio will benefit its performance at all.
This decimal is computed for 2^64 /1.618...
11400714819323198486
-it looks like this in binary: 1001111000110111011110011011100101111111010010100111110000010101
The runs of 7 ones, 5 zeros and 5 ones could be sub-optimal.
[1] Donald Knuth himself discovered this one for 64bits:
101100001010001111101000010110101001100100101010111111100101101
It contains a run of 7 ones, and 5, but maximum zeros in a row is 4.
I did once mine multipliers for LCGs of different bitlengths by comparing quickly measured ratios in their output to those precomputed from good psuedorandom sequences (average deviation etc) Then having found numbers which achieved the basic signature of random data, they were tested with Marsaglia's old 'diehard' battery of tests - and often passed.
Here is a multiplier discovered for a 32bit LCG
110010011101110100001011
I had a list of them I meant to examine here, but have lost it :(
Anyway, there is plenty of academic work to read on this subject:
1 - https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use https://en.wikipedia.org/wiki/Linear_congruential_generator#...