0

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.

Shakti
  • 2,013
  • 8
  • 27
  • 40
  • 1
    I don't understand the close votes, but it's true that the question lacks some details. First of all, the document describes a game that differs slightly from MasterMind, and fleshing out how these differences may affect the solution may be difficult. In any case, it would be helpful if you showed (in the question!) what "equivalence" refers to. I assume that you want to obtain the list of possible combinations that would result in the response that one received for a particular guess. Is this correct? (If so, describe this precisely in the question!) – Marco13 May 23 '14 at 10:18
  • What equivalence classes do you mean? Do you mean cosets for some permutation group --- a subgroup of symmetric group? – Stanislav Poslavsky May 23 '14 at 12:05
  • Our do you mean equivalence classes induced by some automorphism of permutation group (e.g. g~h if g,h belongs to same orbit under automorphism)? – Stanislav Poslavsky May 23 '14 at 12:11
  • Added an example to explain what I am looking for – Shakti May 23 '14 at 14:24

1 Answers1

0

Consider using sorting to find the equivalence classes.

By sorting 1010 and 1001 you each time get 0011.

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194