Abstract
Mastermind is a famous game played by a codebreaker against a codemaker. We investigate its static (also called non-adaptive) black-peg variant. Given c colors and p pegs, the codemaker has to choose a secret, a p-tuple of c colors, and the codebreaker asks a set of questions all at once. Like the secret, a question is a p-tuple of c colors. The codemaker then tells the codebreaker how many pegs in each question are correct in position and color. Then the codebreaker has one final question to find the secret. His aim is to use as few of questions as possible. Our main result is an optimal strategy for the codebreaker for \(p=3\) pegs and an arbitrary number c of colors using \( \lfloor 3c/2 \rfloor +1\) questions.
A reformulation of our result is that the metric dimension of \( \mathbb {Z}_n \times \mathbb {Z}_n \times \mathbb {Z}_n\) is equal to \( \lfloor 3n/2 \rfloor \).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
Note that in [6] the final question was not taken into account.
- 2.
The case \(p=1\) is trivial for both games: exactly c questions are needed.
- 3.
For \(c=4\), this strategy with 6 questions is not feasible, as the shifting step does not work. However, changing peg 3 of the third question from color 4 to color 3 leads to a feasible strategy with 6 questions.
- 4.
For \(c=1\), this strategy with 1 question is not defined, and the strategy with 0 questions (i.e., only the final question) is optimal.
References
Blumenthal, L.M.: Theory and Applications of Distance Geometry. Clarendon Press, Oxford (1953)
Cáceres, J., Hernando, C., Mora, M., Pelayo, I.M., Puertas, M.L., Seara, C., Wood, D.R.: On the metric dimension of cartesian products of graphs. SIAM J. Discrete Math. 21(2), 423–441 (2007)
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)
Glazik, C., Jäger, G., Schiemann, J., Srivastav, A.: Bounds for static black-peg AB mastermind. In: Gao, X., Du, H., Han, M. (eds.) COCOA 2017. LNCS, vol. 10628, pp. 409–424. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-71147-8_28
Goddard, W.: Static mastermind. J. Comb. Math. Comb. Comput. 47, 225–236 (2003)
Goddard, W.: Mastermind revisited. J. Comb. Math. Comb. 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.: An optimal strategy for static black-peg mastermind with two pegs. In: Chan, T.-H.H., Li, M., Wang, L. (eds.) COCOA 2016. LNCS, vol. 10043, pp. 670–682. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-48749-6_48
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.: The worst case number of questions in generalized AB game with and without white-peg answers. Discrete Appl. Math. 184, 20–31 (2015)
Söderberg, S., Shapiro, H.S.: A combinatory detection problem. Am. Math. Mon. 70(10), 1066–1070 (1963)
Stuckman, J., Zhang, G.Q.: Mastermind is NP-complete. INFOCOMP J. Comput. Sci. 5, 25–28 (2006)
Source code of the computer program of this article. http://snovit.math.umu.se/~gerold/source_code_static_black_peg_mastermind_three_pegs.tar.gz
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer Nature Switzerland AG
About this paper
Cite this paper
Jäger, G., Drewes, F. (2018). An Optimal Strategy for Static Black-Peg Mastermind with Three Pegs. In: Deng, X. (eds) Algorithmic Game Theory. SAGT 2018. Lecture Notes in Computer Science(), vol 11059. Springer, Cham. https://doi.org/10.1007/978-3-319-99660-8_25
Download citation
DOI: https://doi.org/10.1007/978-3-319-99660-8_25
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-99659-2
Online ISBN: 978-3-319-99660-8
eBook Packages: Computer ScienceComputer Science (R0)