Re: Random number generators



On Mon, 16 Nov 2009 16:05:14 -0800, steve wrote:

I have a question regarding the subroutine RANDOM_NUMBER, does it
generate a list of uniformly distributed numbers, between 0 and 1, and
an average of 0.5?

The description for RANDOM_NUMBER is given in 13.14.85 of the Fortran 95
standard. It states

Description. Returns one pseudorandom number or an array of
pseudorandom numbers from the uniform distribution over the range 0
<= x < 1.

Note, it says nothing about an average of 0.5. If you only draw 2
values from the distribution is highly unlikely that the average is 0.5.
OTOH, if you draw hundred or thousands or millions of samples, then
the average will be near 0.5.

Isn't there an asymmetry in the unit interval though as to which endpoint
is included? So if there's N outcomes on one side of .5 there would be N
+-1 on the other.
--
frank

"Guns: yes, they are harmful."
.