I recently found out how to calculate the number of all possible weak orderings of a given length. Now, however, I am looking for a way not to only count but to also randomly generate these orderings with a uniform distribution. For, example, for sequences of length 3, there are 13 possible orderings:
1 2 3
3 2 1
1 3 2
2 1 3
2 3 1
3 1 2
1 1 3
1 3 1
3 1 1
3 3 1
3 1 3
1 3 3
1 1 1
Is there a method to uniformly generate such orderings at random?