Mail Archives: djgpp/1997/06/05/05:02:40
Alan Wilson wrote:
>
> It sounds like to me that DJGPP doesnt have a truly random generator then.
> "Informal" random numbers are nice but it would be better if we could
> generate truly random numbers where the frequency of all numbers were the
> same...
>
I don't want to get this into a philosophical discussion, but there is no
such thing as "true random numbers". In fact, there is not (AFAIK) a good
mathematical definition of a random series, and for finite series, such a
definition is IMHO impossible (if anyone wants to react to this, please
do it by private email).
When we talk of good or bad random number generators, we mean that the
series they produce have *on average* properties that ideal random
sources (probability laws) have. The more such properties, the better the
generator...
We say that random() is better than rand() becauses there are tests which
rand() is known to fail that random() passes. But, once more, these
correspond to very subtle "non randomness", in 99.99% of the cases,
including all game programming, you can consider rand() and random() to
be as good as each other.
As for the property you quote: each number having the same frequency,
this is verified on average by almost all generators (including rand()
and random()).
Francois
- Raw text -