|
 |
>> I understand the Mersenne Twister is designed specifically for these
>> kinds of simulations - but I don't know how widely available it is...
>
> The ISAAC RNG is faster than MT. I don't know about quality, but it should
> be very competitive at least.
Well I seriously doubt it can possibly be any *worse* than an LCG.
(Otherwise... why would they have designed it?)
>> PS. One time I wrote my own PRNG just to generate some random data for
>> testing purposes. I don't know why I didn't use the PRNG library, but I
>> should have; on investigation, it turns out that my own PRNG almost
>> always has a period of 2. (!!) Oops...
>
> One of the basic things taught at school is that you should never attempt
> to make your own PRNG if you don't have extensive experience about the
> subject, if you want any kind of quality to it.
>
> Another thing with the exact same rule is a hashing function.
Or, indeed, several other kinds of construct. (E.g., it's notoriously
hard to make a good encryption algorithm.)
In my defense, in the incident in question "good quality" random numbers
weren't necessary. I just needed lots of different numbers with no
particular pattern to them. OTOH, what I got was something like
3, 11, 3, 11, 3, 11, 3, 11...
which is obviously no use at all. The PRNG generates longer sequences in
a few cases, but most of the time it does not. And I somehow failed to
notice this.
In future, I'm going to use the PRNG library. No matter how stupid its
API is!
Post a reply to this message
|
 |