Andrew Fergus
MrExcel MVP
- Joined
- Sep 9, 2004
- Messages
- 5,462
- Office Version
- 365
- 2021
- 2016
- Platform
- Windows
Hi Everyone
I'm trying to come up with a (pseudo) random number generator (producing a 2 or 3 digit integer) and am curious about other peoples take on this issue. In particular what formula(s) you use or have tried, how long a run can you get before the formula repeats itself, the distribution of numbers and so forth.
The reason I'm asking is because I'm trying to introduce an apparent degree of randomness into a process without it actually being random. It requires the appearance of randomness but for the purposes of back-tracking etc I need to know the next number in the sequence given n instances of a sequence.
I've looked at lagged Fibonacci sequences and I can't get past about 200-300k records before the process repeats itself. I'd prefer a much higher number, if this is possible, so would appreciate any and all comments on this subject. I could use the product of two of my own sequences together (using different seeds) to come up with 4-5b combinations, but I'd prefer something a little more elegant, if possible.
I've done a bit of research and looked into the Blub Blum Shub technique but a) I'm stuck and b) I'm not sure what to make of the BBS technique. Any thoughts on that technique are also appreciated.
Thanks in advance
Andrew
I'm trying to come up with a (pseudo) random number generator (producing a 2 or 3 digit integer) and am curious about other peoples take on this issue. In particular what formula(s) you use or have tried, how long a run can you get before the formula repeats itself, the distribution of numbers and so forth.
The reason I'm asking is because I'm trying to introduce an apparent degree of randomness into a process without it actually being random. It requires the appearance of randomness but for the purposes of back-tracking etc I need to know the next number in the sequence given n instances of a sequence.
I've looked at lagged Fibonacci sequences and I can't get past about 200-300k records before the process repeats itself. I'd prefer a much higher number, if this is possible, so would appreciate any and all comments on this subject. I could use the product of two of my own sequences together (using different seeds) to come up with 4-5b combinations, but I'd prefer something a little more elegant, if possible.
I've done a bit of research and looked into the Blub Blum Shub technique but a) I'm stuck and b) I'm not sure what to make of the BBS technique. Any thoughts on that technique are also appreciated.
Thanks in advance
Andrew