Improved Approximation Algorithm for the Number of Queries Necessary to Identify a Permutation

In the past three decades, deductive games have become interesting from the algorithmic point of view. A well known deductive game is the famous Mastermind game. In this paper, we consider the so called Black-Peg variant of Mastermind. More precisely, we deal with a special version of the Black-Peg game with n holes and k ≥ n colors where no repetition of colors is allowed. We present a strategy that identifies the secret code in \(\mathcal{O}(n\log_2{n})\) queries. Our algorithm improves the previous result of Ker-I Ko and Shia-Chung Teng (1986) by almost a factor of 2 for the case k = n. To our knowledge there is no previous work dealing with the case k > n.

[1]  Giovanni Viglietta,et al.  Hardness of Mastermind , 2011, FUN.

[2]  Juan Julián Merelo Guervós,et al.  Improving and Scaling Evolutionary Approaches to the MasterMind Problem , 2011, EvoApplications.

[3]  Benjamin Doerr,et al.  Playing Mastermind with Many Colors , 2013, SODA.

[4]  Guo-Qiang Zhang,et al.  Mastermind is NP-Complete , 2005, ArXiv.

[5]  D. Knuth The Computer as Master Mind , 1977 .

[6]  Gerold Jäger,et al.  The number of pessimistic guesses in Generalized Mastermind , 2009, Inf. Process. Lett..

[7]  Dries R. Goossens,et al.  Efficient solutions for Mastermind using genetic algorithms , 2009, Comput. Oper. Res..

[8]  Zhixiang Chen,et al.  Finding a Hidden Code by Asking Questions , 1996, COCOON.

[9]  Juan Julián Merelo Guervós,et al.  Optimizing worst-case scenario in evolutionary solutions to the MasterMind puzzle , 2011, 2011 IEEE Congress of Evolutionary Computation (CEC).

[10]  Flaminia L. Luccio,et al.  Cracking Bank PINs by Playing Mastermind , 2010, FUN.

[11]  Gerold Jäger,et al.  The number of pessimistic guesses in Generalized Black-peg Mastermind , 2011, Inf. Process. Lett..

[12]  Michael T. Goodrich,et al.  On the algorithmic complexity of the Mastermind game with black-peg results , 2009, Inf. Process. Lett..

[13]  Tom Kalisker,et al.  Solving Mastermind Using Genetic Algorithms , 2003, GECCO.

[14]  Alexandre Temporel A heuristic hill climbing algorithm for Mastermind , .

[15]  Benjamin Doerr,et al.  Playing Mastermind with Constant-Size Memory , 2012, Theory of Computing Systems.

[16]  Ker-I Ko,et al.  On the Number of Queries Necessary to Identify a Permutation , 1986, J. Algorithms.

[17]  K. Koyama,et al.  An Optimal Mastermind Strategy , 1993 .

[18]  Vasek Chvátal,et al.  Mastermind , 1983, Comb..