Playing Mastermind with Many Colors

Abstract

We analyze the general version of the classic guessing game Mastermind with n positions and k colors. Since the case k n1-, >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 n) guesses. This bound is valid also when only black answer-pegs are used. It improves the O(n n) bound first proven by Chv\'atal (Combinatorica 3 (1983), 325--329). We also show that if both black and white answer-pegs are used, then the O(n n) bound holds for up to n2 n colors. These bounds are almost tight as the known lower bound of (n) shows. Unlike for k n1-, 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 (n n) guesses.

0

Turn this paper into a lesson

ArcXiv compiles a structured reading guide from this paper's metadata: plain-English importance, contributions, prerequisite concepts, which sections to read first, flashcards, and a quiz. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…