Re: random numbers in fortran



Gordon Sande wrote:
On 2006-11-28 10:07:31 -0400, "Mark Morss" <mfmorss@xxxxxxx> said:

You said:

"The basic statistical property that you should worry about first is
the
cycle length. To shuffle cards you want all 52! permutations to have a
chance of happening. With a short cycle length that does not happen.
A rather critical issue if you are going to pretend that the results
have any relevance to real card games."

Would you please elucidate? I am not sure of the practical
implications of this remark.

You are trying to shuffle cards, or so you said.

There are 52! possible shuffles. Get a high precision calculator and
do the many precision arithmetic. Or just use an approximation. It is
more than you can count on your fingers! Or even your fingers and toes.

With a short cycle length the PSEUDO random number generator will not
be able to represent all those permutations. Even if it had a chance it
still might not actually have the permutation somewhere on its cycle.
The first is elementary combinatorics and the second is a more subtle
issue on the quality of the pseudo random number generator.

If there are permutations missing then anything you do based on
the "random" permutations will be at best "hap-hazard". That is
fine for games for young children with short memories but is a bit
short on quality for most other applications.

I wonder if this is an actual issue for game performance, though? If there's no exploitable distribution of the missing shuffles, would anyone notice? Realistically, you still have an astronomically large number of actual shuffles present, so it seems to me that the most important thing would be that there is an appropriate distribution of the actual shuffles.
.



Relevant Pages

  • Re: random numbers in fortran
    ... To shuffle cards you want all 52! ... With a short cycle length that does not happen. ... be able to represent all those permutations. ... Even if it had a chance it ...
    (comp.lang.fortran)
  • Re: LCM of all cycle lengths
    ... Then, without much warning, the third and fourth paragraphs change the subject to "all possible E". ... The set of keys could just be the set of permutations on, ... since every cycle length from 1 to B appears somewhere. ... If I have a chosen-plaintext oracle for AES256, I can decrypt a given ciphertext after an expected 2**127 inquiries. ...
    (sci.crypt)
  • 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: random numbers in fortran
    ... In words one solution is to generate random permutations (sampling ... A Random number generator with "decent" properties. ... (Cycle lengths of these are documented in the leading comments; ... -|combinations had the same chance of coming up? ...
    (comp.lang.fortran)
  • Re: Expected average cycle length...
    ... >> in a random permutation of N elements, all N cycle lengths are ... > "over all permutations and elements ... I think that corresponds to your second choice, ... Thus all the possible cycle lengths are equally likely, ...
    (sci.crypt)