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."
.



Relevant Pages

  • Re: Random number generators
    ... Fortran 95 standard. ... pseudorandom numbers from the uniform distribution over the ...
    (comp.lang.fortran)
  • Re: Random number generators
    ... Fortran 95 standard. ... pseudorandom numbers from the uniform distribution over the ... OTOH, if you draw hundred or thousands or millions of samples, ... there are numerous Fortran implementations of PRNG. ...
    (comp.lang.fortran)
  • Re: Random number generators
    ... standard. ...    pseudorandom numbers from the uniform distribution over the range 0 ...   OTOH, if you draw hundred or thousands or millions of samples, then ... If I draw 10000 numbers and count the number in [0,0.5) and [0.5,1), ...
    (comp.lang.fortran)
  • Re: Random_number
    ... I've been working with astroparticle simulations using fortran, ... significant distance away from zero, ... It seems exceedingly unlikely that you'd have a uniform distribution under the circumstances. ...
    (comp.lang.fortran)
  • Re: [CHALLENGE] finding rightmost zero bit - C programmers take
    ... that end (I program in C and Fortran). ... I have no idea how much optimizing either compiler does on it. ... The logical functions are at least as old as IBM Fortran H with the XL ... If implemented with conditional load and for uniform distribution ...
    (comp.lang.fortran)