acodebreaker play against each other. The codemaker chooses a secret code
by placing colors from a set of cavailable colors on ppegs. In the original
version of the AB Game and Mastermind, respectively, p= 4,c= 6 and p= 4,
c= 10, respectively, are fixed, but to make the computational and mathematical
properties of the game interesting, at least one of these parameters must be made
variable. The goal of the codebreaker is to discover the secret code by making
a sequence of guesses until the secret has been found. Each guess is a possible
secret. The corresponding answers of the codemaker consist of black and white
pegs, a black one for each peg of the question which is correct in both position
and color, and a white one for each peg which is correct in color but not in
position. The goal of the codebreaker is to minimize the number of questions
needed to find the secret, i.e., to receive pblack pegs as the last answer. We
call games of this kind codebreaking games.
Mastermind can be turned into a decision problem, Mastermind Satisfiabil-
ity, as follows: given a list of questions and corresponding answers, are these
answers compatible with at least one possible secret? Interestingly, in [23] this
problem was shown to be N P-complete. For further results on (non-static)
Mastermind see for example [3, 16, 20].
The difference between Mastermind and the AB Game is that a possible se-
cret or question of the latter may contain repeated colors whereas the AB Game
requires the secret as well as each question to consist of pdistinct colors. Thus,
the distinction between the two games mirrors the well-known distinction made
in combinatorics between an ordered choice of pitems from a set of celements
either with or without replacement.
Both Mastermind and the AB Game also have a black-peg variant, where
the answers of the codebreaker contain only black pegs (i.e., in addition to how
many pegs are correct in both position and color, no further information about
correct colors placed on the wrong pegs is provided).
While strategies for the Black-Peg AB Game were previously studied in [4,
17, 18], we continue our study of optimal strategies for the static black-peg
variant of codebreaking games which was started in [10, 11, 13, 14, 15]. The
static black-peg variant differs from the standard version described as follows.
The codebreaker is required to present all questions except the last one (which
reveals the secret) right at the beginning of the game. Thus, the game is static,
meaning that the codebreaker cannot adapt later questions to previous answers.
In [3] it was shown that the original and the static version of Mastermind
need O(nlog log n)questions for the most prominent case n=c=p. For the
Static Black-Peg AB Game, for this case n=p=c, a lower bound of Ω(nlog n)
and an upper bound of O(n1.525 )were presented in [11], and this upper bond
has recently been improved to O(nlog n)[19].
A(k+ 1)-strategy is a sequence of kquestions such that the answers to
these questions uniquely determine the secret (i.e., the codebreaker can win the
game with the (k+ 1)-th question). We are interested in optimal strategies –
(k+ 1)-strategies where k+ 1 is as small as possible. Let us denote this optimal
k+ 1 (depending on pand c) by s(p, c). Erdös and Rényi [5] and Söderberg and
Shapiro [22] showed independently that s(p, c)∈ O(p/log p)for c= 2, a result
2