08-30-2014, 11:57 AM
I have finished my little research (and literally days of non-stop number crunching) regarding good PRNG for calculators. The best two PRNGs I found are:
Best is:
u(i) = Frac((u(i-1) + 1 / (phi + u(i-2))) * 997)
and
u(i) = Frac((u(i-1) + 1/phi) * 997)
Where phi = 1.61803398875 (= the Golden Ratio)
Using 997 does not come as a surprise for many. The following PRNG comes in an honorary mention:
u(i) = Frac(u(i) * 4357)
The problem with the last one (and with u(i) = Frac(u(i-1) * 997)) is that if u(i-1) is an integer, the PRNG generates a stream of zeros!!!
Enjoy!
Namir
PS: A Cowboy's work is never done!
Best is:
u(i) = Frac((u(i-1) + 1 / (phi + u(i-2))) * 997)
and
u(i) = Frac((u(i-1) + 1/phi) * 997)
Where phi = 1.61803398875 (= the Golden Ratio)
Using 997 does not come as a surprise for many. The following PRNG comes in an honorary mention:
u(i) = Frac(u(i) * 4357)
The problem with the last one (and with u(i) = Frac(u(i-1) * 997)) is that if u(i-1) is an integer, the PRNG generates a stream of zeros!!!
Enjoy!
Namir
PS: A Cowboy's work is never done!