5 research outputs found

    Wordle is NP-hard

    Get PDF
    Wordle is a single player word-guessing game where the goal is to discover a secret word ww that has been chosen from a dictionary DD. In order to discover ww, the player can make at most â„“\ell guesses, which must also be words from DD, all words in DD having the same length kk. After each guess, the player is notified of the positions in which their guess matches the secret word, as well as letters in the guess that appear in the secret word in a different position. We study the game of Wordle from a complexity perspective, proving NP-hardness of its natural formalization: to decide given a dictionary DD and an integer â„“\ell if the player can guarantee to discover the secret word within â„“\ell guesses. Moreover, we prove that hardness holds even over instances where words have length k=5k = 5, and that even in this case it is NP-hard to approximate the minimum number of guesses required to guarantee discovering the secret word (beyond a certain constant). We also present results regarding its parameterized complexity and offer some related open problems.Comment: Accepted at FUN202

    Improved Approximation Algorithm for the Number of Queries Necessary to Identify a Permutation

    Full text link
    In the past three decades, deductive games have become interesting from the algorithmic point of view. Deductive games are two players zero sum games of imperfect information. The first player, called "codemaker", chooses a secret code and the second player, called "codebreaker", tries to break the secret code by making as few guesses as possible, exploiting information that is given by the codemaker after each guess. A well known deductive game is the famous Mastermind game. In this paper, we consider the so called Black-Peg variant of Mastermind, where the only information concerning a guess is the number of positions in which the guess coincides with the secret code. More precisely, we deal with a special version of the Black-Peg game with n holes and k >= n colors where no repetition of colors is allowed. We present a strategy that identifies the secret code in O(n log n) queries. Our algorithm improves the previous result of Ker-I Ko and Shia-Chung Teng (1985) by almost a factor of 2 for the case k = n. To our knowledge there is no previous work dealing with the case k > n. Keywords: Mastermind; combinatorial problems; permutations; algorithm
    corecore