Randomize a List problem
|
09-18-2020, 10:19 PM
Post: #26
|
|||
|
|||
RE: Randomize a List problem
(09-18-2020 03:31 PM)John Keith Wrote: In most test runs that I did the 2nd permutation was most common, and Least common permutations are permutations that RANL *never* produced. For n-items list, RANL does n! ways, ideal probability of each permutations is 1/n! Example {1,2,3,4}, out of 4! = 24 ways, RANL produced: (Out of 24, frequencies of all 1's is ideal, P = 1/24 ≈ 4.17%) Code: Pat Freq RANL generated g = 10 permutations. Missing permutations = 4! - 10 = 14, all having P = 0% Trivia: 1 cannot be shuffled beyond its neighbors. Those accounted for 12 missing permutations. Here are RANL missing permutations percentages, for n-items list (smaller is better) Code: n g missing permutations = 1 - g/n! |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)