Re: random numbers in fortran



Mark Morss wrote:

How, for example, would one set "cycle length" to be sure that each one
of 52! combinations had the same chance of coming up? My Fortran
reference is Chapman's _Fortran 90/95 for Scientists and Engineers_,
and in its brief discussion of the RANDOM_SEED and RANDOM_NUMBER
intrinsics, it makes no mention of "cycle length."

The cycle length is a property of the generator, so it's natural that it would not be mentioned in a pure discussion of the language -- the actual generator used by a particular compiler is a QofI issue.

As far as I know, most generators do have a reported cycle length. Ideally, the cycle length from RANDOM_NUMBER is included with the documentation of your favorite compiler.
.



Relevant Pages

  • Re: Code Too Large for MS FORTRAN
    ... major effort to go into making a GENERATOR or COMPILER bug-free. ... Since our company uses this same old 1985 compiler for our TABLE- ... DRIVEN commercial software (no bugs that way), ... FOrtran compiler), we have almost zero support costs. ...
    (comp.lang.fortran)
  • Re: random numbers in fortran
    ... I make sure that I have a generator capabable of producing any of the ... I understand also that with a short cycle, ... Generally in practice then, could I not compensate for a short cycle by ... The sample driver here prompts for N and 3 seeds. ...
    (comp.lang.fortran)
  • Re: random numbers in fortran
    ... extremely many possible outcomes. ... I make sure that I have a generator capabable of producing any of the ... I understand also that with a short cycle, ... Generally in practice then, could I not compensate for a short cycle by ...
    (comp.lang.fortran)
  • Re: random numbers in fortran
    ... I make sure that I have a generator capabable of producing any of the ... I understand also that with a short cycle, ... Generally in practice then, could I not compensate for a short cycle by ... In words one solution is to generate random permutations (sampling ...
    (comp.lang.fortran)
  • Re: Gaussian Noise Generation
    ... standard normal - the sum of 12 part avoids this simple correction. ... By using the bottom 10 bits you effectively forced the generator ... to be a 10 bit generator with a correspondingly short cycle length. ... When carried to the extreme of just the bottom bit you get a cycle ...
    (comp.dsp)