I need to distribute the data set evenly over time based on historical data so that each digit becomes equal (or close to one) the number of times in each position over time. The problem is that this list of orders used in the past looks like this (but can have any number of elements):
1,2,5,3,4 4,1,5,2,3 1,3,5,2,4 4,1,2,3,5 2,4,1,3,5 5,1,4,3,2 1,5,3,2,4 5,1,3,2,4 3,2,5,4,1 4,3,1,5,2
how can I find the order of the smallest values and lead to a “more balanced" set of orders. The obvious answer is that I could group and count them and select the least used, but the problem in the least used permutation may never have been used, for example here, the order of "1,2,3,4,5" is a candidate for least used because it does not appear at all.
The simple answer seems to be to determine which position "1" appears in the least frequent and sets this position to "1", etc. for each digit. I suspect this works, but I feel that there is a more elegant solution that I have not considered potentially with cross-connections to include all possible combinations.
any ideas?