Is Wordle always beatable under optimal play?



  • Is Wordle always beatable under optimal play on easy mode (where you can guess any valid word)?

    To put the question more formally, does there exist a deterministic computer program that can play Wordle successfully, without cheating, for every target word? Wordle is a deterministic game besides the hidden target word, and there is a known, finite list of target words, so this question should be decidable. https://www.reddit.com/r/wordle/comments/s4tcw8/a_note_on_wordles_word_list/ shows that there are https://gist.github.com/cfreshman/a03ef2cba789d8cf00c08f767e0fad7b possible target words and https://gist.github.com/cfreshman/cdcdf777450c5b5301e439061d29694c additional allowed guess words (12,972 total allowed guess words).

    Bonus questions

    (These are included in case an answer happens to have them; they are not necessary to answer the question.)

    • Is the answer different for easy mode (where you can guess any valid word) vs hard mode (where your guess has both be a valid word and match the clues you've been given so far)?

    • If there is such a program, what is the word it uses for it's first guess? (If the program is deterministic, it should always use the same opener)

    • What is the worst case performance of an optimal program (ignoring the 6 guess limit if there is no optimal program that always wins)?



  • Wordle is always beatable under optimal play, on both easy and hard modes. This is doable using Knuth's minmax algorithm for mastermind with a curated starting guess tree.

    Here is an example program that does so on easy: https://codegolf.stackexchange.com/a/242412/73123 .

    This program wins in at most 5 moves despite being suboptimal (at a minimum, the codegolf challenge restricts the guess space to the 2315 word list when actual Wordle has 10657 allowed guesses). It uses the starting word "LANCE". Its win distribution is:

    • Turn 1: 1
    • Turn 2: 49
    • Turn 3: 871
    • Turn 4: 1354
    • Turn 5: 40

    Here is an example that wins on hard mode: https://gist.github.com/zags/a093467ee6e71fd35ff849a5b76f22e5

    It uses the starting word "CALMS" and if it's a total miss, uses "BENTO"; otherwise, it uses the word that creates the smallest max split, with a small weight for guessing valid answer words over non-answer words. Its win distribution is:

    • Turn 2: 94
    • Turn 3: 834
    • Turn 4: 1120
    • Turn 5: 253
    • Turn 6: 14

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2