Post Reply 
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
the last permutation returned by the program was the least common.

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
1234    4
1243    4
1324    3
1342    2
1423    3
1432    2
3124    2
3142    1
4123    2
4132    1

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!
3    4   33.33%
4   10   58.33%
5   28   76.67%
6   80   88.89%
7  274   94.56%
8  898   97.77%
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Randomize a List problem - Hlib - 09-14-2020, 04:38 PM
RE: Randomize a List problem - John Keith - 09-14-2020, 06:08 PM
RE: Randomize a List problem - Albert Chan - 09-14-2020, 07:32 PM
RE: Randomize a List problem - Hlib - 09-14-2020, 08:51 PM
RE: Randomize a List problem - Albert Chan - 09-14-2020, 11:41 PM
RE: Randomize a List problem - Werner - 09-15-2020, 06:41 AM
RE: Randomize a List problem - Werner - 09-15-2020, 09:47 AM
RE: Randomize a List problem - Albert Chan - 09-15-2020, 04:36 PM
RE: Randomize a List problem - ijabbott - 09-15-2020, 06:39 PM
RE: Randomize a List problem - John Keith - 09-15-2020, 08:56 PM
RE: Randomize a List problem - Albert Chan - 09-15-2020, 09:34 PM
RE: Randomize a List problem - Werner - 09-16-2020, 06:43 AM
RE: Randomize a List problem - John Keith - 09-16-2020, 11:51 AM
RE: Randomize a List problem - Albert Chan - 09-15-2020, 01:00 AM
RE: Randomize a List problem - Wes Loewer - 09-15-2020, 04:10 AM
RE: Randomize a List problem - John Keith - 09-15-2020, 01:42 PM
RE: Randomize a List problem - Hlib - 09-15-2020, 03:57 PM
RE: Randomize a List problem - Albert Chan - 09-15-2020, 07:53 PM
RE: Randomize a List problem - Albert Chan - 09-17-2020, 12:11 PM
RE: Randomize a List problem - Hlib - 09-17-2020, 09:36 AM
RE: Randomize a List problem - John Keith - 09-17-2020, 12:20 PM
RE: Randomize a List problem - Albert Chan - 09-17-2020, 01:42 PM
RE: Randomize a List problem - John Keith - 09-17-2020, 08:21 PM
RE: Randomize a List problem - John Keith - 09-18-2020, 03:31 PM
RE: Randomize a List problem - Albert Chan - 09-18-2020 10:19 PM
RE: Randomize a List problem - Albert Chan - 09-19-2020, 12:29 AM
RE: Randomize a List problem - pier4r - 10-13-2020, 07:13 PM
RE: Randomize a List problem - DavidM - 10-14-2020, 04:12 AM
RE: Randomize a List problem - Albert Chan - 10-15-2020, 04:43 PM
RE: Randomize a List problem - DavidM - 10-15-2020, 06:24 PM
RE: Randomize a List problem - pier4r - 10-14-2020, 06:55 PM
RE: Randomize a List problem - DavidM - 04-26-2024, 03:17 PM



User(s) browsing this thread: 1 Guest(s)