delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/05/05:02:40

Message-ID: <33967690.548F@pobox.oleane.com>
Date: Thu, 05 Jun 1997 10:19:28 +0200
From: Francois Charton <deef AT pobox DOT oleane DOT com>
Organization: CCMSA
MIME-Version: 1.0
To: Alan Wilson <awilson AT wilshire DOT com>
CC: djgpp AT delorie DOT com
Subject: Re: Random numbers/George
References: <2 DOT 2 DOT 32 DOT 19970604162434 DOT 0069d50c AT gate>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019