Next Article in Journal
Game Theoretic Modeling of Infectious Disease Transmission with Delayed Emergence of Symptoms
Previous Article in Journal
Cheap Talk Games with Two-Senders and Different Modes of Communication
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

The Exact Query Complexity of Yes-No Permutation Mastermind

by
Mourad El Ouali
1,* and
Volkmar Sauerland
2
1
Polydisciplinary Faculty Ouarzazate, University Ibn Zohr, Agadir 80000, Morocco
2
Department of Mathematics, Kiel University, 24118 Kiel, Germany
*
Author to whom correspondence should be addressed.
Games 2020, 11(2), 19; https://doi.org/10.3390/g11020019
Submission received: 14 February 2020 / Revised: 30 March 2020 / Accepted: 4 April 2020 / Published: 13 April 2020

Abstract

:
Mastermind is famous two-player game. The first player (codemaker) chooses a secret code which the second player (codebreaker) is supposed to crack within a minimum number of code guesses (queries). Therefore, the codemaker’s duty is to help the codebreaker by providing a well-defined error measure between the secret code and the guessed code after each query. We consider a variant, called Yes-No AB-Mastermind, where both secret code and queries must be repetition-free and the provided information by the codemaker only indicates if a query contains any correct position at all. For this Mastermind version with n positions and k n colors and : = k + 1 n , we prove a lower bound of j = k log 2 j and an upper bound of n log 2 n + k on the number of queries necessary to break the secret code. For the important case k = n , where both secret code and queries represent permutations, our results imply an exact asymptotic complexity of Θ ( n log n ) queries.
MSC:
91A46

1. Introduction

Mastermind is a popular two-player board game invented by Mordecai Meirowitz and released in 1971 [1,2]. Its idea is that a codemaker chooses a secret code of fixed length n, where each position is selected from a set of k colors. The second player, codebreaker, has to identify the secret code by a finite sequence of corresponding code guesses (queries), each of which is replied with the number of matching positions and the number of further correct colors. The original game is played by picking pegs of k = 6 different colors and placing them into rows with n = 4 holes, where the number of rows (allowed queries) for the codebreaker is limited.
Generalizing the situation to arbitrarily many positions and colors, the codemaker selects a vector y [ k ] n and the codebreaker gives in each iteration a query in form of a vector x [ k ] n . In the original setting, the codemaker’s reply is the so called black-white error measure, consisting of a pair of numbers, where the first number, black ( x , y ) , is the number of positions in which x and y coincide and the second number, white ( x , y ) , is the number of additional colors which appear in both x and y, but at different positions. In this paper, we consider a variant, called Yes-No AB-Mastermind, which is defined by the following properties
  • Both secret code and queries must be repetition-free. This property is indicated by the prefix AB and stems from the AB game, better known as “Bulls and Cows” (cf. [1]), which was even known prior to the commercial version of Mastermind with color repetitions.
  • The provided information by the codemaker only answers the question whether or not a query contains any correct position at all. This property is introduced by us and referred to by the term “Yes-No”.
Related Works: Mastermind and its variants have been analyzed under different aspects. One of the first analyses of the commercial version with n = 4 positions and k = 6 colors is by Knuth [3] and shows that each code can be cracked in at most 5 queries. Even before the appearance of Mastermind as a commercial game, Erdős and Rényi [4] analyzed the asymptotic query complexity of a similar problem with two colors in 1963 to be Θ ( n log n ) . After Knuth’s analysis of the commercial game, many different variants of Mastermind with arbitrary code length n and number of colors k have been investigated. For example, Black-Peg Mastermind restricts its error measure between two codes x and y to the single value black ( x , y ) (i.e., the exact number of positions where both codes coincide). This version was introduced in 1983 by Chvátal [5] for the case k = n , who provides a deterministic adaptive strategy using 2 n log 2 k + 4 n queries. Improved upper bounds for this variant and arbitrary n and k where given by Goodrich [6] ( n log 2 k + ( 2 1 / k ) n + k ) and later by Jäger and Peczarski [7] ( n log 2 n + k for k n and n log 2 n + k n + 1 for k > n ) but remained in the order of O ( n log 2 n ) . Doerr et al. [8] provided a randomized codebreaker strategy that only needs O ( n log log n ) queries in expectation and showed that this asymptotic order even holds for up to n 2 log log n colors, if both black and white information is allowed. A first upper bound for AB Mastermind was given by Ker-I Ko and Shia-Chung Teng [9] for the case k = n , i.e., secret code and queries represent permutations of [ n ] . Their non-constructive strategy yields an upper bound of 2 n log 2 n + 7 n queries. A constructive strategy by El Ouali and Sauerland [10] reduced this upper bound by a factor of almost 2 and also included the case k > n of Black-Peg AB-Mastermind. The term Black-Peg labels the situation that the error measure between secret code and queries is only “black” information, i.e., the number of coinciding positions, while the “white” information (see above) is omitted. El Ouali et al. [11] combined their upper bound of ( n 3 ) log 2 n + 5 2 n 1 queries for k = n and ( n 2 ) log 2 n + k + 1 ) queries for k > n with a lower bound of n queries, which is implied by a codemaker strategy. It improved the lower bound of n log log n by Berger et al [12]. However, a gap between Ω ( n ) and O ( n log 2 n ) remains for this Mastermind variant. Some facts indicate that closing this gap means to improve both bounds. On the one hand, a careful consideration of the partition of the remaining searchspace with respect to all possible codemaker replies might yield a refined codemaker strategy and possibly increase the lower bound. On the other hand, overcoming the sequential learning process of the codebreaker’s binary search strategy might decrease the upper bound. The latter presumption is reinforced by the results of Afshani et al. [13], who consider another permutation-based variant of Mastermind. There, the secret code is a combination of a binary string and a permutation, (both of length n), queries are binary strings of length n, and the error measure returns the number of leading coincidences in the binary string with respect to the order of the permutation. For this setting, which is also a generalization of the popular leading ones test problem in black box optimization, the authors prove an exact asymptotic query complexity of Θ ( n log n ) for deterministic strategies but a randomized query complexity of Θ ( n log log n ) .
One of the ultimate goals in the analysis of Mastermind variants is to prove the exact asymptotic query complexity. As mentioned above, closing the asymptotic gap between the lower Ω ( n ) bound and the upper O ( n log 2 n ) bound is an unsolved problem for Black-Peg AB Mastermind. A related open question is whether the same asymptotic number of queries is required for both (Black-Peg) Mastermind with color repetition and (Black-Peg) AB Mastermind.
Our Contribution: We consider a new variant of AB-Mastermind which is more difficult to play for the codebreaker since the error-measure provided by the codemaker is less informative. Here, for a secret code y the answer info ( σ , y ) to a query σ is “yes” if some of its positions coincide with the secret code, otherwise the answer is “no”. We first analyze the worst-case performance of query strategies for this Mastermind variant and give a lower bound of j = k log 2 j queries for k n , which becomes n log 2 n n in the case k = n . The lower bound even holds if the codebreaker is allowed to use repeated colors in his queries. We further present a deterministic polynomial-time algorithm that identifies the secret code. This algorithm is a modification of the constructive strategy of El Ouali et al. [11]. It returns the secret code in at most ( n 3 ) log 2 n + 5 2 n 1 queries in the case k = n and in less than ( n 2 ) log 2 n + k + 1 queries in the case k > n . For the important case k = n , our results imply the exact asymptotic query complexity of Θ ( n log 2 n ) . Since the considered “Yes-No” error measure implies a new variant of AB-Mastermind, there is no previous reference to compare our results to.

2. Results

2.1. Lower Bound on the Number of Queries

To simulate the worst case, we allow the codemaker to “cheat” in a way that after every query he may decide for a new secret code that is still in agreement with all information he gave so far.
Theorem 1.
Let k , n N , k n and : = k + 1 n . Every strategy for Yes-No AB-Mastermind needs at least j = k log 2 j queries in the worst case.
Proof. 
We give a codemaker strategy that implies the lower bound. For i N let M i denote the set of secrets that are still possible after the i-th query has been answered, starting with M 0 : = { y [ k ] n | i j [ n ] : y i y j } . Let M i yes M i be the set of secrets that lead to a yes-answer to the ( i + 1 ) -th query and M i no : = M i \ M i yes the set of secrets that lead to a no-answer. The strategy of the codemaker in round i + 1 is as follows:
  • If | M i yes | | M i no | , pick a secret from M i yes (and give the answer yes)
  • Otherwise pick a secret from M i no (and give the answer no)
By using this strategy, the codemaker achieves for every round i that
| M i | = | M i yes | + | M i no | 2 max ( | M i yes | , | M i no | ) = 2 | M i + 1 | .
This implies | M i | 2 i | M 0 | . So, for any i < log 2 ( | M 0 | ) we have
| M i | > 2 log 2 ( | M 0 | ) | M 0 | = | M 0 | | M 0 | = 1 ,
which means that there are still at least two possible secrets left. Since
log 2 ( | M 0 | ) = log 2 j = k j = j = k log 2 j ,
we obtain the claimed lower bound.  □
Corollary 1.
Every strategy for Yes-No Permutation-Mastermind (the case k = n ) needs at least
j = 1 n log 2 j n log n n log 2
queries in the worst case.
We also note that the lower bound on the query complexity of Yes-No AB-Mastermind remains of the asymptotic order n log n if the number of colors is polynomial in the number of positions ( k = P ( n ) , P a polynomial).

2.2. Upper Bound on the Number of Queries

Theorem 2.
Let k , n N , k n and : = k + 1 n . For k = n , there is a strategy for Yes-No AB-Mastermind that identifies every secret code in at most ( n 3 ) log 2 n + 5 2 n 1 queries and for k > n , there is a strategy that identifies every secret code in less than ( n 2 ) log 2 n + k + 1 queries.
Corollary 2.
The exact asymptotic query complexity of Yes-No Permutation-Mastermind is Θ ( n log 2 n ) .
The proof of Theorem 2 resembles the proof of a corresponding result concerning Black-Peg AB-Mastermind [11], except that the information whether a given query contains a correct but unidentified position is not derived directly but requires special querying outlined by Algorithm 1 below. In a nutshell (including both cases k = n and k > n ), the strategy consists of k distinct initial queries, each of which consists of the first n positions of a circularly shifted version of the vector ( 1 , 2 , , k ) . From the answers of the initial queries, we will be able to learn the secret code position-wise, keeping record about the positions that have already been identified. As long as there are consecutive initial queries a and b with the property that a coincides with the secret code in at least one yet unidentified position but b does not, we can apply a binary search for the next unidentified position in a, using O ( log 2 n ) further queries. Such initial queries a and b exist ever after one (usually after zero) but not all positions of the secret code have been identified.
Proof of Theorem 2.
The case k = n : We give a constructive strategy that identifies the positions of the secret code y [ n ] n one-by-one. In order to keep record about identified positions of the secret code we deal with a partial solution vector x that satisfies x i { 0 , y i } for all i [ n ] . We call the non-zero positions of x fixed and the zero-positions of x open. The fixed positions of x are the identified positions of the secret code. Remember, that for a query σ = ( σ 1 , , σ n ) we denote by
info ( σ , y ) : = yes if { i [ n ] | σ i = y i } no otherwise
the information if there is some position in which σ coincides with the secret code y. For Yes-No AB-Mastermind the related information whether a query σ contains a correct but unidentified position cannot always be derived directly but must be obtained by guessing one or two modifications of σ , rearranging those positions that coincide with the partial solution x. The required query procedure is summarized as Algorithm 1.
Example 1.
Figure 1 illustrates the four distinct cases that are considered by infoP . In the first and easiest case (panel (a)) the actual query σ does not coincide with the partial solution x. Thus, σ contains a correct unidentified position if and only if it contains a correct position at all, i.e., infoP ( σ , x , y ) = info ( σ , y ) . In the second case (panel (b)), σ and x coincide in more than one position, namely the positions with colors 3, 9 and 10. The modified query ρ is obtained from σ by rearranging these positions in a way that all identified positions get a wrong color while leaving all open positions of σ unchanged. This implies that infoP ( σ , x , y ) = info ( ρ , y ) . Panels (c) and (d) deal with the case that σ and x coincide in exactly one position, say i. If x already contains a further non-zero position j, we obtain ρ from σ by swapping positions i and j in σ (the positions with colors 3 and 5 in panel (c)). Again, we obtain that infoP ( σ , x , y ) = info ( ρ , y ) . Finally, if position i is the only yet identified position of the secret code we have to ask two different modified queries to derive infoP ( σ , x , y ) (panel (d)). We obtain the two queries ρ 1 and ρ 2 , each by swapping the identified position (here 3) with another position in σ, (here with 1 and 2, respectively). While the color of the identified position is wrong in both modifications ρ 1 and ρ 2 , every other position of σ coincides with the corresponding position of at least one modification. Therefore, infoP ( σ , x , y ) = no if and only if info ( ρ 1 , y ) = info ( ρ 2 , y ) = no .
Algorithm 1: Function infoP
Games 11 00019 i001
The codebreaker strategy that identifies the secret code y has two phases. In the first phase the codebreaker guesses an initial sequence of n queries that has a predefined structure. In the second phase, the structure of the initial sequence and the corresponding information by the codemaker enable us to identify correct positions y i of the secret code one after another, each by using a binary search. We denote the vector x restricted to the set { s , , } with ( x i ) i = s , s , [ n ] .
Phase 1 Consider the n queries, σ 1 , , σ n , that are defined as follows: σ 1 represents the identity map and for j [ n 1 ] , we obtain σ j + 1 from σ j by a circular shift to the right. For example, if n = 4 , we have σ 1 = ( 1 , 2 , 3 , 4 ) , σ 2 = ( 4 , 1 , 2 , 3 ) , σ 3 = ( 3 , 4 , 1 , 2 ) and σ 4 = ( 2 , 3 , 4 , 1 ) . The codebreaker guesses σ 1 , , σ n .
Phase 2. Now, the codebreaker identifies the values of y one after another, using a binary search procedure, that we call findNext. The idea is to exploit the information that for 1 i , j n 1 we have σ i j = σ i + 1 j + 1 , σ i n = σ i + 1 1 , σ n j = σ 1 j + 1 and σ n n = σ 1 1 . findNext is used to identify the second correct position to the last correct position in the main loop of the algorithm.
After the first position of y has been found and fixed in x, there exists a j [ n ] such that infoP ( σ j , x , y ) = no . As long as we have open positions in x, we can either find a j [ n 1 ] with infoP ( σ j , x , y ) = yes but infoP ( σ j + 1 , x , y ) = no and set r : = j + 1 , or we have infoP ( σ n , x , y ) = yes but infoP ( σ 1 , x , y ) = no and set j : = n and r : = 1 . We call such an index j an active index. Let j be an active index and r its related index. Let c be the color of some position of y that is already identified and fixed in the partial solution x. With j and r we denote the position of color c in σ j and σ r , respectively. The color c serves as a pivot color for identifying a correct position m in σ j that is not fixed, yet. There are two possible modes for the binary search that depend on the fact if m j . The mode is indicated by a Boolean variable leftS and determined by lines 5–9 of findNext. Clearly, m j if j = n . Otherwise, the codebreaker guesses
σ j , 0 : = c , ( σ i j ) i = 1 j 1 , ( σ i j ) i = j + 1 n = σ j j , ( σ i j ) i = 1 j 1 , ( σ i j ) i = j + 1 n .
By the information σ i j = σ i + 1 r we obtain that ( σ i j ) i = 1 j 1 ( σ i r ) i = 2 j . We further know that every open color has a wrong position in σ r . For that reason, infoP ( σ j , 0 , x , y ) = no implies that m j . The binary search for the exact value of m is done in the interval [ a , b ] , where m is initialized as n and [ a , b ] as
[ a , b ] : = [ 1 , j ] if leftS r , n ] else
(lines 10–15 of findNext). In order to determine if there is an open correct position on the left side of the current center of [ a , b ] in σ j we can define a case dependent query:
σ j , : = ( σ i j ) i = 1 1 , c , ( σ i r ) i = + 1 j , ( σ i j ) i = j + 1 n if leftS ( σ i r ) i = 1 r 1 , ( σ i j ) i = r 1 , c , ( σ i r ) i = + 1 n else
In the first case, the first 1 positions of σ j , coincide with those of σ j . The remaining positions of σ j , cannot coincide with the corresponding positions of the secret code if they have not been fixed, yet. This is because the -th position of σ j , has the already fixed value c, positions + 1 to j coincide with the corresponding positions of σ r which satisfies infoP ( σ r , x , y ) = no and the remaining positions have been checked to be wrong in this case (cf. former definition of leftS in line 5 and line 9, respectively). Thus, there is a correct open position on the left side of in σ j , if and only if infoP ( σ j , , x , y ) = yes . In the second case, the same holds for similar arguments. Now, if there is a correct open position to the left of , we update the binary search interval [ a , b ] by [ a , 1 ] . Otherwise, we update [ a , b ] by [ , b ] .
Algorithm 2: Function findNext
Games 11 00019 i002
Example 2.
Suppose, that for n = 10 the secret code y and the partial solution x are given as in the top panel of Figure 2 and that we have first identified the position with color 1, such that 1 is our pivot color. The initial 10 queries σ 1 , , σ 10 together with their current infoP measures are given in the mid panel of Figure 2. We see that the highlighted queries, σ 4 and σ 5 , can be used for the binary search with findNext, since σ 4 has a correct not yet identified position but σ 5 has not. So the active indices are j = 4 and r = 5 and the corresponding pivot color positions in σ 4 and σ 5 are j = 4 and r = 5 . The first query of findNext (cf. lower panel of Figure 2) is σ a . It begins with the pivot color, followed by the first 3 positions of σ 4 (positions 2 to 4 of σ 5 ) and positions 5 to 10 of σ 4 (cf. line 7 of findNext). Since infoP ( σ a , x , y ) = yes , the left most correct but unidentified position in σ 4 is none of its first 4 positions. Thus, the binary search is continued in the interval [ 5 , 10 ] . It is realized by queries σ b , σ c , and σ d , which are composed according to line 20 of findNext (in this case), and finally identifies position 8 with color 5 of the secret code (generally the position left to the left most pivot color position that receives the answer “yes” in the binary search).
The Main Algorithm. The main algorithm is outlined as Algorithm 3.
It starts with an empty partial solution and finds the positions of the secret code y one-by-one. The vector v keeps record about which of the initial queries σ 1 , , σ n coincides with the secret code y in some open position. Thus, v is initialized by v i : = info ( σ i , y ) , i [ n ] . The main loop always requires an active index. For that reason, if v i = yes for all i [ n ] in the beginning, we first identify the correct position in σ 1 (which is unique in this case) by n 2 + 1 queries (each swapping two positions of σ 1 ) and update x and v, correspondingly. After this step, there will always exist an active index. Every call of findNext in the main loop augments x by a correct solution value. One call of findNext requires at most 1 + log 2 n queries if the partial solution x contains more than one non-zero position, and at most 2 + 2 log 2 n queries (two queries for each call of infoP) if x has exactly one non-zero position. Thus, Algorithm 3 does not need more than ( n 2 ) log 2 n + 5 2 n 1 queries to break the secret code inclusive the n 1 initial queries, n 2 + 1 queries to find the first correct position, n 3 calls of findNext and 2 final queries.
Algorithm 3: Codebreaker Strategy for Permutations
Games 11 00019 i003
The case k > n : Let y = ( y 1 , , y n ) be the code that must be found. We use the same notations as above.
Phase 1. Consider the k queries σ ¯ 1 , , σ ¯ k , where σ ¯ 1 represents the identity map on [ k ] and for j [ k 1 ] , we obtain σ ¯ j + 1 from σ ¯ j by a circular shift to the right. We define k codes σ 1 , , σ k by σ j = ( σ ¯ i j ) i = 1 n , j [ k ] . For example, if k = 5 and n = 3 , we have σ 1 = ( 1 , 2 , 3 ) , σ 2 = ( 5 , 1 , 2 ) , σ 3 = ( 4 , 5 , 1 ) , σ 4 = ( 3 , 4 , 5 ) and σ 5 = ( 2 , 3 , 4 ) . Within those k codes, every color appears exactly once at every position and, thus, there are at least k n initial queries that do not contain any correct position. Since k > n , this implies
Lemma 1.
There is a j [ k ] with info ( σ j , y ) = no .
Phase 2. Having more colors than positions, we can perform our binary search for a next correct position without using a pivot color. The corresponding simplified version of findNext is outlined as Algorithm 4.
Algorithm 4: Function findNext for k > n
Games 11 00019 i004
Using that version of findNext also allows to simplify our main algorithm (Algorithm 3) by adapting lines 2 and 3, and, due to Lemma 1, skipping lines 4–7, as findNext can be already applied to find the first correct position. Thus, for the required number of queries to break the secret code we have: the initial k 1 queries, a call of the modified findNext for every but the last two positions and one or two final queries. This yields that the modified Mastermind Algorithm breaks the secret code in at most ( n 1 ) log 2 n + k + 1 queries.  □

3. Conclusions

We showed that deterministic algorithms for the identification of a secret code in Black-Peg AB-Mastermind can be modified and applied to Yes-No AB-Mastermind. The latter is a new variant of AB-Mastermind which is harder to play for the codebreaker since a less informative error measure is provided. The Yes-No measure only returns the information whether a query and the secret code coincide in any position, while the Black-Peg measure is the number of positions in which both codes coincide. Nevertheless, we proved that the best known asymptotic upper bound for Black-Peg AB-Mastermind does also apply to Yes-No AB-Mastermind, by adapting the corresponding constructive querying strategy. Utilizing a simple codemaker strategy, we further derived corresponding lower bounds for Yes-No AB-Mastermind. Another challenge with AB-Mastermind is that no color repetition is allowed in a query whereas most strategies for other Mastermind variants exploit the property of color repetition. While for most Mastermind variants there is a gap between lower and upper bounds on the worst case number of queries to break the secret code, our results imply that this number is Θ ( n log n ) for the most popular case k = n of Yes-No AB-Mastermind, which is also referred to as Yes-No Permutation-Mastermind. The same is true for the case k = c · n with constant c. To our knowledge, this result is a first exact asymptotic query complexity proof for a multicolor Mastermind variant, where both secret code and queries are chosen from the same set, here [ k ] n .
A future challenge will be studying the static variant of Yes-No AB-Mastermind (where the codebreaker must give all but one queries in advance of codemaker’s answers). Lower and upper bounds for static Black-Peg AB-Mastermind were provided as Ω ( n log n ) and O ( n 1.525 ) , respectively [14].

Codeavailability

We provide Matlab/Octave implementations of the codebreaker strategy via GitHub, a permanent version of which is archived in a public zenodo repository [15].

Author Contributions

Conceptualization, M.E.O. and V.S.; methodology, M.E.O.; software, V.S.; validation, M.E.O. and V.S; writing—original draft preparation, M.E.O. and V.S.; writing—review and editing, M.E.O. and V.S.; visualization, V.S.; All authors have read and agreed to the published version of the manuscript.

Funding

This research received financial support by DFG within the funding programme Open Access Publizieren.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Wikipedia Website about Mastermind. Available online: https://en.wikipedia.org/wiki/Mastermind_(board_game) (accessed on 27 March 2020).
  2. Wikipedia Website about Mordecai Meirowitz. Available online: https://en.wikipedia.org/wiki/Mordecai_Meirowitz (accessed on 27 March 2020).
  3. Knuth, D.E. The computer as a master mind. J. Recreat. Math. 1977, 9, 1–5. [Google Scholar]
  4. Erdős, P.; Rényi, C. On Two Problems in Information Theory. Publ. Math. Inst. Hung. Acad. Sci. 1963, 8, 229–242. [Google Scholar]
  5. Chvátal, V. Mastermind. Combinatorica 1983, 3, 325–329. [Google Scholar] [CrossRef]
  6. Goodrich, M.T. On the algorithmic complexity of the Mastermind game with black-peg results. Inf. Process. Lett. 2009, 109, 675–678. [Google Scholar] [CrossRef] [Green Version]
  7. Jäger, G.; Peczarski, M. The number of pessimistic guesses in Generalized Black-peg Mastermind. Inf. Process. Lett. 2011, 111, 933–940. [Google Scholar] [CrossRef]
  8. Doerr, B.; Doerr, C.; Spöhel, R.; Thomas, H. Playing Mastermind with Many Colors. J. ACM 2016, 63, 1–23. [Google Scholar] [CrossRef]
  9. Ko, K.; Teng, S. On the Number of Queries Necessary to Identify a Permutation. J. Algorithms 1986, 7, 449–462. [Google Scholar] [CrossRef]
  10. El Ouali, M.; Sauerland, V. Improved Approximation Algorithm for the Number of Queries Necessary to Identify a Permutation. In Proceedings of the 24th International Workshop on Combinatorial Algorithms (IWOCA 2013), Rouen, France, 10–12 July 2013; Lecroq, T., Mouchard, L., Eds.; Number 8288 in Lecture Notes in Computer Science. Springer: Berlin, Germany, 2013; pp. 443–447. [Google Scholar]
  11. El Ouali, M.; Glazik, C.; Sauerland, V.; Srivastav, A. On the Query Complexity of Black-Peg AB-Mastermind. Games 2018, 9, 2. [Google Scholar] [CrossRef] [Green Version]
  12. Berger, A.; Chute, C.; Stone, M. Query Complexity of Mastermind Variants. arXiv 2016, arXiv:1607.04597. [Google Scholar] [CrossRef] [Green Version]
  13. Afshani, P.; Agrawal, M.; Doerr, B.; Doerr, C.; Larsen, K.G.; Mehlhorn, K. The query complexity of a permutation-based variant of Mastermind. Discret. Appl. Math. 2019, 260, 28–50. [Google Scholar] [CrossRef] [Green Version]
  14. Glazik, C.; Jäger, G.; Schiemann, J.; Srivastav, A. Bounds for Static Black-Peg AB Mastermind. In Proceedings of the 11th International Conference on Combinatorial Optimization and Applications (COCOA 2017), Part II, Shanghai, China, 16–18 December 2017; Gao, X., Du, H., Han, M., Eds.; Number 10628 in Lecture Notes in Computer Science. Springer: Berlin, Germany, 2017; pp. 409–424. [Google Scholar] [CrossRef]
  15. El Ouali, M.; Sauerland, V. GitHub repositry yn-ab-mastermindv1.0: Codebreaker strategies for Yes-No AB-Mastermind (Matlab/Octave). arXiv 2020, arXiv:2003.11538. [Google Scholar] [CrossRef]
Figure 1. Illustrating the cases considered by infoP . Panel (a): query σ does not coincide with the partial solution x; infoP ( σ , x , y ) = info ( σ , y ) . Panel (b): σ and x coincide in more than one position; ρ rearranges these positions of σ ; infoP ( σ , x , y ) = info ( ρ , y ) . Panel (c): σ and x coincide in exactly one position i, but more positions are identified already; ρ is obtained from σ by swapping position i with another identified position j; infoP ( σ , x , y ) = info ( ρ , y ) . Panel (d): Exactly one position is identified and appears to be correct in σ ; two modified queries ρ 1 and ρ 2 must be defined, each by swapping the identified position with another one; infoP ( σ , x , y ) = no if and only if info ( ρ 1 , y ) = info ( ρ 2 , y ) = no .
Figure 1. Illustrating the cases considered by infoP . Panel (a): query σ does not coincide with the partial solution x; infoP ( σ , x , y ) = info ( σ , y ) . Panel (b): σ and x coincide in more than one position; ρ rearranges these positions of σ ; infoP ( σ , x , y ) = info ( ρ , y ) . Panel (c): σ and x coincide in exactly one position i, but more positions are identified already; ρ is obtained from σ by swapping position i with another identified position j; infoP ( σ , x , y ) = info ( ρ , y ) . Panel (d): Exactly one position is identified and appears to be correct in σ ; two modified queries ρ 1 and ρ 2 must be defined, each by swapping the identified position with another one; infoP ( σ , x , y ) = no if and only if info ( ρ 1 , y ) = info ( ρ 2 , y ) = no .
Games 11 00019 g001
Figure 2. Panel (a): secret code y and partial solution vector x. Panel (b): the initial queries σ j and their responses infoP ( σ j , x , y ) , indicating if a query and the secret code coincide in any position that has not been identified, yet (i.e., in any 0-position of x). Panel (c): binary search queries to identify the next secret position. The highlighted subsequences correspond to the subsequences of the initial queries that have been selected to apply the binary search.
Figure 2. Panel (a): secret code y and partial solution vector x. Panel (b): the initial queries σ j and their responses infoP ( σ j , x , y ) , indicating if a query and the secret code coincide in any position that has not been identified, yet (i.e., in any 0-position of x). Panel (c): binary search queries to identify the next secret position. The highlighted subsequences correspond to the subsequences of the initial queries that have been selected to apply the binary search.
Games 11 00019 g002

Share and Cite

MDPI and ACS Style

El Ouali, M.; Sauerland, V. The Exact Query Complexity of Yes-No Permutation Mastermind. Games 2020, 11, 19. https://doi.org/10.3390/g11020019

AMA Style

El Ouali M, Sauerland V. The Exact Query Complexity of Yes-No Permutation Mastermind. Games. 2020; 11(2):19. https://doi.org/10.3390/g11020019

Chicago/Turabian Style

El Ouali, Mourad, and Volkmar Sauerland. 2020. "The Exact Query Complexity of Yes-No Permutation Mastermind" Games 11, no. 2: 19. https://doi.org/10.3390/g11020019

APA Style

El Ouali, M., & Sauerland, V. (2020). The Exact Query Complexity of Yes-No Permutation Mastermind. Games, 11(2), 19. https://doi.org/10.3390/g11020019

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop