The Query Complexity of Mastermind with l_p Distances
Consider a variant of the Mastermind game in which queries are l_p distances, rather than the usual Hamming distance. That is, a codemaker chooses a hidden vector y in {-k,-k+1,...,k-1,k}^n and answers to queries of the form ||y-x||_p where x in {-k,-k+1,...,k-1,k}^n. The goal is to minimize the number of queries made in order to correctly guess y.
In this work, we show an upper bound of O(min{n,(n log k)/(log n)}) queries for any real 1<=p<infty and O(n) queries for p=infty. To prove this result, we in fact develop a nonadaptive polynomial time algorithm that works for a natural class of separable distance measures, i.e., coordinate-wise sums of functions of the absolute value. We also show matching lower bounds up to constant factors, even for adaptive algorithms for the approximation version of the problem, in which the problem is to output y' such that ||y'-y||_p <= R for any R <= k^{1-epsilon}n^{1/p} for constant epsilon>0. Thus, essentially any approximation of this problem is as hard as finding the hidden vector exactly, up to constant factors. Finally, we show that for the noisy version of the problem, i.e., the setting when the codemaker answers queries with any q = (1 +/- epsilon)||y-x||_p, there is no query efficient algorithm.
Mastermind
Query Complexity
l_p Distance
Mathematics of computing~Combinatorics
Theory of computation~Design and analysis of algorithms
1:1-1:11
APPROX
We thank Flavio Chierichetti and Ravi Kumar for helpful discussions, as well as the anonymous reviewers for helpful feedback.
Manuel
Fernández V
Manuel Fernández V
Computer Science Department, Carnegie Mellon University, Pittsburgh, Pennsylvania, USA
David P.
Woodruff
David P. Woodruff
Computer Science Department, Carnegie Mellon University, Pittsburgh, Pennsylvania, USA
Part of this work was done while visiting Google as well as the Simons Institute for the Theory of Computing. D. Woodruff would also like to thank partial support from the Office of Naval Research (ONR) grant N00014-18-1-2562.
Taisuke
Yasuda
Taisuke Yasuda
Department of Mathematics, Carnegie Mellon University, Pittsburgh, Pennsylvania, USA
10.4230/LIPIcs.APPROX-RANDOM.2019.1
Peyman Afshani, Manindra Agrawal, Benjamin Doerr, Carola Doerr, Kasper Green Larsen, and Kurt Mehlhorn. The query complexity of a permutation-based variant of Mastermind. Discrete Applied Mathematics, 2019.
Aaron Berger, Christopher Chute, and Matthew Stone. Query complexity of mastermind variants. Discrete Mathematics, 341(3):665-671, 2018.
Nader H. Bshouty. Optimal Algorithms for the Coin Weighing Problem with a Spring Scale. In COLT 2009 - The 22nd Conference on Learning Theory, Montreal, Quebec, Canada, June 18-21, 2009, 2009. URL: http://www.cs.mcgill.ca/%7Ecolt2009/papers/004.pdf#page=1.
http://www.cs.mcgill.ca/%7Ecolt2009/papers/004.pdf#page=1
Vasek Chvátal. Mastermind. Combinatorica, 3(3):325-329, 1983. URL: https://doi.org/10.1007/BF02579188.
https://doi.org/10.1007/BF02579188
Benjamin Doerr, Carola Doerr, Reto Spöhel, and Henning Thomas. Playing Mastermind With Many Colors. J. ACM, 63(5):42:1-42:23, 2016. URL: https://doi.org/10.1145/2987372.
https://doi.org/10.1145/2987372
David Ginat. Digit-distance Mastermind. The Mathematical Gazette, 86(507):437-442, 2002.
Donald E. Knuth. The computer as a master mind. Journal of Recreational Mathematics, 9:1-6, 1977.
Xianfu Wang. Volumes of generalized unit balls. Mathematics Magazine, 78(5):390-395, 2005.
Andrew Chi-Chin Yao. Probabilistic computations: Toward a unified measure of complexity. In Proceedings of the 18th Annual IEEE Symposium on Foundations of Computer Science, pages 222-227. IEEE, 1977.
Manuel Fernández V, David P. Woodruff, and Taisuke Yasuda
Creative Commons Attribution 3.0 Unported license
https://creativecommons.org/licenses/by/3.0/legalcode