Playing Mastermind with Wordle-like Feedback

Renyuan Li, Shenglong ZhuAm. Math. Mon 2024

TL;DR

This paper introduces "Clear Mastermind," a variant of the classic Mastermind game that incorporates more precise, Wordle-style feedback. The authors analyze the optimal number of guesses required to solve this game, deriving exact formulas for different parameter regimes and showing it's significantly easier than Wordle itself.

What Problem Does This Paper Address?

The classic Mastermind game involves a codebreaker trying to guess a secret sequence of colored pegs. The feedback provided is limited: it tells you how many pegs are the correct color and in the correct position (often called "black pegs") and how many are the correct color but in the wrong position (often called "white pegs"). This feedback can be ambiguous. Wordle, a popular word-guessing game, offers more granular feedback: it explicitly tells you which letters are correct and in the right position (green) and which are correct but in the wrong position (yellow). This paper bridges these two by introducing "Clear Mastermind," which uses the precise feedback mechanism of Wordle but within the more general framework of Mastermind (arbitrary length and number of colors). The core problem addressed is determining the minimum number of guesses a codebreaker needs to guarantee a win in this new game, considering different game parameters (number of colors and sequence length). This is a fundamental question in combinatorial game theory and information theory.

Methods

The authors analyze Clear Mastermind by defining an "answer set" that represents all possible secret sequences consistent with the guesses and feedback received so far. They then develop a feedback strategy for the "codemaker" (the one who knows the secret sequence) that aims to minimize the information revealed to the codebreaker. A key technique is the use of a "tracking matrix" (a 0-1 matrix) to represent the possible answers and how they are eliminated by feedback. They leverage concepts from combinatorics, including permutations and the permanent of a matrix, to prove their results. The analysis is broken down into three cases based on the relationship between the number of colors ($k$) and the length of the sequence ($n$).

Datasets

Not discussed in the paper. The paper focuses on theoretical analysis and does not use empirical datasets.

Key Insights and Ideas

  • Wordle Feedback Simplifies Mastermind: The more precise feedback from Wordle dramatically simplifies the Mastermind problem. While classic Mastermind can be computationally challenging, Clear Mastermind has a much more tractable solution.
  • Optimal Strategy is "Easy": The paper demonstrates that for Clear Mastermind, finding an optimal strategy is "nearly trivial," in stark contrast to the NP-completeness of finding optimal strategies for Wordle.
  • Feedback Strategy is Crucial: The codemaker's strategy for providing feedback is key. The paper proposes a specific strategy that aims to eliminate possibilities efficiently without giving away too much information.
  • Case-Based Analysis: The problem naturally breaks down into three cases based on the relationship between the number of colors ($k$) and the sequence length ($n$), each yielding a different formula for the minimum number of guesses.
  • Connection to Permutations: For the case where $k=n$, the problem is shown to be equivalent to finding permutations with specific feedback, allowing the use of combinatorial tools like matrix permanents.

Key Results

The paper establishes exact formulas for the minimum number of guesses ($F(k,n)$) required to solve Clear Mastermind:

  • Case 1: $k \le n$: $F(k,n) = k$. The number of guesses is simply the number of colors.
  • Case 2: $k > n$ and $n$ divides $k$: $F(k,n) = \frac{k}{n} + n - 1$.
  • Case 3: $k > n$ and $n$ does not divide $k$: $\frac{k}{n} + n - 1 < F(k,n) \le \frac{k}{n} + n$. The paper provides bounds for this case and uses computational simulations to suggest a more precise value for $n < k < 2n$.

Limitations and Future Work

  • Third Case Bounds: While the paper provides bounds for the third case ($k > n$, $n$ not dividing $k$), it does not derive an exact formula. Computational simulations were used to explore this regime, but a formal proof for an exact value is left as future work.
  • Speculation for $F(2n-1, n)$: The authors speculate that $F(2n-1, n) = n$ for $n > 3$, but acknowledge this is difficult to prove and requires showing $F(2n-1, n) < n+1$.
  • Generalizing $F(k+n, n)$: The paper notes that $F(k+n, n) \ge F(k, n) + 1$ for $k > n$, but questions whether the equality $F(k+n, n) = F(k, n) + 1$ holds, suggesting it as another avenue for future research.
  • Computational Complexity: For larger values of $n$ and $k$, the computational complexity of simulating the game becomes a limitation, hindering the exploration of certain parameter ranges.

Summary updated

BibTeX
@inproceedings{li2024playing,
  author = {Renyuan Li and Shenglong Zhu},
  title = {{Playing Mastermind with Wordle-like Feedback}},
  booktitle = {Am. Math. Mon},
  year = {2024},
  url = {https://openreview.net/forum?id=uKHsZxvtWp},
}
Figure