in reply to RE (tilly) 4: Fisher-Yates Shuffle
in thread Fisher-Yates Shuffle

Don't post late either. Posting math before bed is just as bad as posting code.

The above "correction" applies to how many elements wind up where they started. The algorithm commentary applies to how many times you make a useless swap. Those are different things. *sigh*

Replies are listed 'Best First'.
RE: Silly Tilly :-)
by Adam (Vicar) on Aug 30, 2000 at 20:45 UTC
    Don't worry about it, we all make mistakes. Besides, you really did have it right the first time, and your correction is the mistake. It just goes to show that you are usually right the first time.
      ...you are usually right the first time.

      I wish... :-)