Abstract

We analyze the general version of the classic guessing game Mastermind with nn positions and kk colors. Since the case k≤n1−εk \le n^{1-\varepsilon}, ε>0\varepsilon>0 a constant, is well understood, we concentrate on larger numbers of colors. For the most prominent case k=nk = n, our results imply that Codebreaker can find the secret code with O(nlog⁡log⁡n)O(n \log \log n) guesses. This bound is valid also when only black answer-pegs are used. It improves the O(nlog⁡n)O(n \log n) bound first proven by Chvátal (Combinatorica 3 (1983), 325--329). We also show that if both black and white answer-pegs are used, then the O(nlog⁡log⁡n)O(n \log\log n) bound holds for up to n2log⁡log⁡nn^2 \log\log n colors. These bounds are almost tight as the known lower bound of Ω(n)Ω(n) shows. Unlike for k≤n1−εk \le n^{1-\varepsilon}, simply guessing at random until the secret code is determined is not sufficient. In fact, we show that an optimal non-adaptive strategy (deterministic or randomized) needs Θ(nlog⁡n)Θ(n \log n) guesses.

Explore this paper’s authors, topics and related work.

Building this map preview

BZPEER is loading the nearby papers, people, topics and institutions for this page.

Reviews 0

Write a reviewWrite

No reviews yet.

Discussion 0

Add a commentWrite

No comments yet.

Playing Mastermind with Many Colors | BZPEER