Post Reply 
More pseudo random number generators for calculators
07-13-2020, 03:00 PM
Post: #10
RE: More pseudo random number generators for calculators
The generator I posted was the result of a 5-minute search. I'm going to find one for some computations but getting "better" (however measured) takes more time.

I use long LCGs for Monte Carlo (whenever my quasi-Monte Carlo stuff doesn't apply) as the precision does matter. I have a short generator on the calculator (or I did, it's easy to redesign) with three shift registers lengths 15,16,17, combined with a 16-bit GCD. The total cycle is (2^15-1)*(2^16-1)*(2^17-1)*2^16 (the cycle lengths are prime) giving just under 2^64 as a cycle. However, the precision is only 15 bits. A true 64-bit RNG would have a precision of 64 bits.

A problem arises in simulating exponential or Gaussian distributions by the Box-Muller method. With fifteen bits, the greatest exponential number is ln(2^16) or about 11 whereas with 64 bits one gets ln(2^64) or 44. With the Gaussian, the largest number generated is about Sqrt(2*Ln(2^16)) or a sigma of 4.7. Not even 6-sigma quality. With 64 bits one gets Sqrt(2*Ln(2^64)) or 9.4. The smaller precision does not explore rare events. In real life, one should use a rare-event generator.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: More pseudo random number generators for calculators - ttw - 07-13-2020 03:00 PM

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