Randomize a List problem
|
09-15-2020, 07:53 PM
Post: #14
|
|||
|
|||
RE: Randomize a List problem
(09-15-2020 03:57 PM)Hlib Wrote: I inserted a fragment into the source program, which swaps 1-st and random n-th elements on stack ... Do not use this code ! This is much worse than "random(t) ROLLD" Code: Starting pattern = 123, shuffled pattern has 3^3 = 27 ways Uneven probabilities problem get worse with more items in the list. This is not just pigeonhole issues anymore. I would recommend not cutting corners here, and use good shuffling code. Code: Starting pattern = 1234, shuffled pattern has 4^4 = 256 ways |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)