Affiliation:
1. Max-Planck-Institut für Informatik
2. Max-Planck-Institut für Informatik and Université Paris Diderot
3. ETH Zürich, Zürich, Switzerland
Abstract
We analyze the general version of the classic guessing game Mastermind with
n
positions and
k
colors. Since the case
k
≤
n
1 − ε
, ε > 0 a constant, is well understood, we concentrate on larger numbers of colors. For the most prominent case
k
=
n
, our results imply that Codebreaker can find the secret code with
O
(
n
log log
n
) guesses. This bound is valid also when only black answer pegs are used. It improves the
O
(
n
log
n
) bound first proven by Chvátal. We also show that if both black and white answer pegs are used, then the
O
(
n
log log
n
) bound holds for up to
n
2
log log
n
colors. These bounds are almost tight, as the known lower bound of Ω(
n
) shows. Unlike for
k
≤
n
1 − ε
, simply guessing at random until the secret code is determined is not sufficient. In fact, we show that an optimal nonadaptive strategy (deterministic or randomized) needs Θ(
n
log
n
) guesses.
Funder
Agence Nationale de la Recherche
Feodor Lynen Research Fellowship for Postdoctoral Researchers of the Alexander von Humboldt Foundation
Google Fellowship
Publisher
Association for Computing Machinery (ACM)
Subject
Artificial Intelligence,Hardware and Architecture,Information Systems,Control and Systems Engineering,Software
Cited by
18 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Playing Guess Who with your kids: Code-word strategy against adversaries;Theoretical Computer Science;2024-11
2. Playing Mastermind with Wordle-like Feedback;The American Mathematical Monthly;2024-02-22
3. Mastermind with a linear number of queries;Combinatorics, Probability and Computing;2023-11-08
4. Optimal strategies for the static black-peg AB game with two and three pegs;Discrete Mathematics, Algorithms and Applications;2023-07-22
5. A Gentle Introduction to Theory (for Non-Theoreticians);Proceedings of the Companion Conference on Genetic and Evolutionary Computation;2023-07-15