XP is just a number | |
PerlMonks |
Re^2: the -other- shuffling questionby mstone (Deacon) |
on Jun 13, 2005 at 04:39 UTC ( [id://466055]=note: print w/replies, xml ) | Need Help?? |
As I understand it, shuffling doesn't decrease any desirable qualities. It only leaves them unchanged or increases them. It's vaguely like a sorting algorithm that preserves existing order.. sorting on B then sorting on A gives you a sequence sorted with A as the major key and B as the minor key. In this case, shuffling took a sequence that had no consecutive doubles and introduced a few. If there are weaknesses, I'd like to know about those, too. I've found that some values for array size perform very badly (@T=7 leads to a period of 424, despite being relatively prime to $M), and adding a second shuffle doesn't seem to do much of anything. And clocking the generator:
frankly sucks. This all follows Knuth's admonition that RNGs are delicate creatures, and tend to be sensitive to 'minor' adjustments. I'd like to learn the theory behind these things so I know what's safe to touch.
In Section
Seekers of Perl Wisdom
|
|