0

A. Given a set where some elements appear more than once and a specific permutation, is it possible to assign that permutation an unique number("permutation id") without needing to calculate every permutation and where the number is in the minimum range?

and

B. Given a set and a "permutation id", is it possible to rebuild the actual permutation without brute-forcing it by calculating all permutations?

Example

The set A,A,B has 3 (3!/2!) permutations: AAB,ABA,BAA. Then the "permutation id" will be between 1-3 not 1-6

so with the set A,A,B and the id 3 you should get (for instance) BAA.

I know this is easy to do if you just list all the permutations, remove the duplicates but for a non-trivial set that is unfeasible with a computer.

I started to think about this the other day and did some research, but all I could find were algorithms to list a random or all permutations.

Thanks

JJ Doe
  • 3

0 Answers0