Abstract
Mastermind is a famous two-player game which has attracted much attention in literature within the last years. In this work we investigate the static (also called non-adaptive) variant of Mastermind. The principal rule is that the codemaker has to choose a secret consisting of p pegs and c colors for each peg and the codebreaker may give a number of guesses at once, where for each guess he receives information from the codemaker. Using this information he has a final guess for the correct secret. The aim of the game is to minimize the number of guesses. Whereas Goddard has investigated the static version of original Mastermind in 2003, we do such an investigation of its black-peg variant, where the received information consists only of a number of black pegs which corresponds to the number of pegs matching in the corresponding question and the secret. As main result we present a strategy for this game for \(p=2\) pegs and arbitrarily many colors \( c\ge 3 \) colors and prove its feasibility and optimality. Furthermore, by computer search we found optimal strategies for 9 other pairs (p, c).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Note that the parameter c is reserved for the number of colors. So we use the parameters \(a,b,d,e,\dots \) here.
References
Asuncion, A.U., Goodrich, M.T.: Nonadaptive Mastermind algorithms for string and vector databases, with case studies. IEEE Trans. Knowl. Data Eng. 25(1), 131–144 (2013)
Chen, S.T., Lin, S.S.: Optimal algorithms for \(2 \times n\) AB games - a graph-partition approach. J. Inf. Sci. Eng. 20(1), 105–126 (2004)
Chen, S.T., Lin, S.S., Huang, L.T.: Optimal algorithms for \(2 \times n\) Mastermind games - a graph-partition approach. Comput. J. 47(5), 602–611 (2004)
Chvátal, V.: Mastermind. Combinatorica 3, 325–329 (1983)
Doerr, B., Spöhel, R., Thomas, H., Winzen, C.: Playing Mastermind with many colors. In: Proceedings of 24th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2013), SIAM, pp. 695–704 (2013)
Doerr, B., Winzen, C.: Playing Mastermind with constant-size memory. Theory Comput. Syst. 55(4), 658–684 (2014)
Focardi, R., Luccio, F.L.: Guessing bank PINs by winning a Mastermind game. Theory Comput. Syst. 50(1), 52–71 (2012)
Gagneur, J., Elze, M.C., Tresch, A.: Selective phenotyping, entropy reduction and the Mastermind game. BMC Bioinform. (BMCBI) 12, 406 (2011)
Goddard, W.: Static Mastermind. J. Combin. Math. Combin. Comput. 47, 225–236 (2003)
Goddard, W.: Mastermind revisited. J. Combin. Math. Combin. Comput. 51, 215–220 (2004)
Goodrich, M.T.: On the algorithmic complexity of the Mastermind game with black-peg results. Inf. Process. Lett. 109(13), 675–678 (2009)
Jäger, G., Peczarski, M.: The number of pessimistic guesses in Generalized Mastermind. Inf. Process. Lett. 109(12), 635–641 (2009)
Jäger, G., Peczarski, M.: The number of pessimistic guesses in Generalized black-peg Mastermind. Inf. Process. Lett. 111(19), 933–940 (2011)
Jäger, G., Peczarski, M.: Playing several variants of Mastermind with constant-size memory is not harder than with unbounded memory. In: Kratochvíl, J., Miller, M., Froncek, D. (eds.) IWOCA 2014. LNCS, vol. 8986, pp. 188–199. Springer, Heidelberg (2015). doi:10.1007/978-3-319-19315-1_17
Jäger, G., Peczarski, M.: The worst case number of questions in generalized AB game with and without white-peg answers. Discret. Appl. Math. 184, 20–31 (2015)
Jäger, G., Peczarski, M.: Bounding memory for Mastermind might not make it harder. Theoret. Comput. Sci. 596, 55–66 (2015)
Knuth, D.E.: The computer as Mastermind. J. Recr. Math. 9, 1–6 (1976)
Koyama, K., Lai, T.W.: An optimal Mastermind strategy. J. Recr. Math. 25(4), 251–256 (1993)
Stuckman, J., Zhang, G.Q.: Mastermind is NP-complete. INFOCOMP J. Comput. Sci. 5, 25–28 (2006)
Viglietta, G.: Hardness of Mastermind. In: Kranakis, E., Krizanc, D., Luccio, F. (eds.) FUN 2012. LNCS, vol. 7288, pp. 368–378. Springer, Heidelberg (2012)
Source code of the computer program of this article. http://snovit.math.umu.se/~gerold/source_code_static_mastermind.tar.gz
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing AG
About this paper
Cite this paper
Jäger, G. (2016). An Optimal Strategy for Static Black-Peg Mastermind with Two Pegs. In: Chan, TH., Li, M., Wang, L. (eds) Combinatorial Optimization and Applications. COCOA 2016. Lecture Notes in Computer Science(), vol 10043. Springer, Cham. https://doi.org/10.1007/978-3-319-48749-6_48
Download citation
DOI: https://doi.org/10.1007/978-3-319-48749-6_48
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-48748-9
Online ISBN: 978-3-319-48749-6
eBook Packages: Computer ScienceComputer Science (R0)