in reply to Re: Randomize an array
in thread Randomize an array
A test that is sensitive to this is looking for "rising sequences". Scramble a sorted list. Make successive passes through the array, looking for the first, then second, then third, then fourth, etc elements. How many passes did it take? With your algorithm it will take fewer passes than with a well-shuffled array.
ObTrivia: Take a fresh deck of cards. Shuffle a few times. Do the above test by suit. 2 suits start off sorted front to back, 2 back to front. This test is able to detect that for a long time. (Certainly well after the "7 shuffles leaves a well-shuffled deck" factoid a lot of people hear. By some measures it is well shuffled. By this one it still isn't. :-)
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: RE (tilly) 2: Randomize an array
by BooK (Curate) on Sep 08, 2000 at 00:46 UTC | |
by tilly (Archbishop) on Sep 08, 2000 at 07:05 UTC | |
Re: RE (tilly) 2: Randomize an array
by blazar (Canon) on Aug 01, 2008 at 20:51 UTC | |
by tilly (Archbishop) on Aug 01, 2008 at 21:00 UTC | |
by blazar (Canon) on Aug 01, 2008 at 21:15 UTC |