Post Reply 
A Random Question
06-13-2017, 06:13 AM
Post: #21
RE: A Random Question
(06-11-2017 01:39 AM)DavidM Wrote:  
(06-11-2017 12:21 AM)ttw Wrote:  Third, one could use a very long cycle generator. The error from lack divisibility does decrease with cycle length. This is probably the most practical solution.

What are your thoughts on the XORSHIFT+ PRNG that John brought up earlier? Does this have a long enough cycle for a practical use on calculator-based apps?

(06-11-2017 12:21 AM)ttw Wrote:  Fourth, one could use a simple RNG and not worry about the error. This I probably the most common solution.

I have no data to back this up, but I'd be willing to bet that the "RAND n * CEIL" approach is used far more frequently than any other in calculator programs. Has this actually caused problems for anyone? I suspect we'll never really know.

The XOR+Shift and the linear congruential and the Fibonacci and other generators are all good enough in most cases if the cycle and wordlength is long enough. I posted 64-bit parameters for the congruential and shift register generators somewhere on this board. (If the same length, these can be XORed together to get a longer cycle; if different lengths, either + or - is needed.) Or one could combine generators like cryptographic machines do. For games one needs good precision and very high unpredictability; for Monte Carlo, one needs high precision and cycle but can be predictable.

I have a new type that I'm testing, but I have only empirical evidence that it works. When I've done a bit more testing (ok, several bits), I'll post the method.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
A Random Question - DavidM - 06-09-2017, 03:15 PM
RE: A Random Question - pier4r - 06-09-2017, 03:46 PM
RE: A Random Question - Paul Dale - 06-09-2017, 11:37 PM
RE: A Random Question - Joe Horn - 06-10-2017, 12:03 AM
RE: A Random Question - DavidM - 06-10-2017, 01:45 AM
RE: A Random Question - pier4r - 06-10-2017, 08:55 AM
RE: A Random Question - DavidM - 06-10-2017, 05:10 PM
RE: A Random Question - Paul Dale - 06-10-2017, 05:18 AM
RE: A Random Question - John Keith - 06-10-2017, 12:57 PM
RE: A Random Question - pier4r - 06-10-2017, 01:20 PM
RE: A Random Question - DavidM - 06-10-2017, 03:51 PM
RE: A Random Question - Paul Dale - 06-10-2017, 11:49 PM
RE: A Random Question - DavidM - 06-11-2017, 01:11 AM
RE: A Random Question - Paul Dale - 06-11-2017, 05:04 AM
RE: A Random Question - lrdheat - 06-10-2017, 02:28 PM
RE: A Random Question - Paul Dale - 06-11-2017, 12:00 AM
RE: A Random Question - ttw - 06-11-2017, 12:21 AM
RE: A Random Question - DavidM - 06-11-2017, 01:39 AM
RE: A Random Question - Paul Dale - 06-11-2017, 05:19 AM
RE: A Random Question - ttw - 06-13-2017 06:13 AM
RE: A Random Question - Paul Dale - 06-11-2017, 12:38 AM



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