Is there a java api which I can use for a permutation of numbers to find out canonical form of its equivalence classes ? It is required for all possible guesses for Mastermind. As per the document .

EDIT :Let me explain by example what I am looking for Example : In order to solve the game of in minimum steps we have to give our guesses and based on the response decide the next guess . Lets say for 4 pegs and 6 colors ( total combination = 1296 , repeat allowed ) . For the initial try we only need to consider one possible guess lets say 0011 and the response we get is 1 Black and 0 White.(1,0). Now, We check 0011 against all the 1296 numbers and keep all those which return (1,0). Thus, our solution is somewhere inside this reduced sample set. Now for the second query using equivalence transformations as mentioned in the document possible codes are reduced for second try.

Now, I want to know if there an any existing java api which I can use for a given set of permutations ( reduced set after (0,1) on 1296 ) and get equivalence transformations on my inputs ?

Thanks In Advance.

1

There are 1 answers

0
Has QUIT--Anony-Mousse On

Consider using sorting to find the equivalence classes.

By sorting 1010 and 1001 you each time get 0011.