RF> Nonsense. Your version is no better than mine or the other one that
RF> was posted weeks ago. And I will not be drawn into that useless
RF> debate on how random computer randomness is. If that is your intention,
RF> don't bother.
DW>Oooh! Snarky!
DW>No. It has nothing to do with the randomness or otherwise of RND. Your
DW>routine messes up its own randomness by permitting the characters that
DW>have already been randomized to be targets of further swaps.
As can happen when shuffling a deck of cards. Oftentimes when
shuffling a deck of cards some of the same cards are shuffled more
than once. Absolutely nothing wrong there. It seems to me that you
*think* you can control the degree of randomness used. You're wrong.
The real test is to use the code in complete programs. I have done
that and from a lot of experience I can say that no one can predict
what card will come up next in my programs (which use a similar shuffle
routine to the one I posted).
DW>It's a bit difficult to explain, but easy to demonstrate. Start with a
DW>simple string such as "abc". There are six possible orders into which
DW>the characters can be shuffled, which should occur with equal
DW>frequencies over a long term. So, for example, write a little program
*You think* you can control the degree of randomness. You cannot.
Prove me wrong if you disagree.
DW>that will do, say, 600 trials, starting with "abc" each time, and will
DW>count the numbers of times the six possible outcomes occur. Of course,
DW>they should each happen 100 times, give or take just a few for random
DW>fluctuations. But, with your routine, they will occur widely different
DW>numbers of times. My routine, on the other hand, will produce each of
DW>the outcomes just about 100 times.
DW>Try it!
What you said above proves my point. A routine that does not
statistically average out over time so that every outcome appears
an equal number of times is better than a predictable routine where
each outcome comes out an equal number of times over time. Think
about that.
* OLX 2.1 TD * Say the best, think the rest!
--- PCBoard (R) v15.3/M 10
---------------
* Origin: MoonDog BBS þ RIME NetHub Brooklyn,NY (1:278/15)
|