Is Wordle always beatable under optimal play?

[BACK]
Is Wordle always beatable under optimal play?
Posted On: June 15, 2023

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. An examination of Wordle's source code shows that there are 2,315 possible target words and 10,657 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)?


Question from user Zags at stackexchange.


Answer:

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/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 2,315 word list when actual Wordle has 12,972 allowed guesses). It uses the starting word "LANCE", along with a curated list for some of the 2nd and 3rd round guesses, and the word that creates the smallest max split for the rest of it's guesses. 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 every game on hard mode: https://gist.github/zags/a093467ee6e71fd35ff849a5b76f22e5.


It's worst case performance is 6 moves, and 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.


Answer from user Zags at stackexchange.



[BACK]
Is Wordle always beatable under optimal play?
Posted On: June 15, 2023

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. An examination of Wordle's source code shows that there are 2,315 possible target words and 10,657 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)?


Question from user Zags at stackexchange.


Answer:

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/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 2,315 word list when actual Wordle has 12,972 allowed guesses). It uses the starting word "LANCE", along with a curated list for some of the 2nd and 3rd round guesses, and the word that creates the smallest max split for the rest of it's guesses. 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 every game on hard mode: https://gist.github/zags/a093467ee6e71fd35ff849a5b76f22e5.


It's worst case performance is 6 moves, and 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.


Answer from user Zags at stackexchange.



[BACK]

What is the minimum safe spacing between trees to contain forest fires? What is the minimum safe spacing between trees to contain forest fires?

Posted On: November 14, 2011
After trying to implement a minor controlled burn to tame the wild forests surrounding my home, I managed to create what I shall heretofore refer to as The Burning Land.It occurred to me that we do no...[More]


How to enhance match objectives in Fifa 23 career matches How to enhance match objectives in Fifa 23 career matches

Posted On: April 30, 2023
I play Fifa 23 on a PC with an Xbox controller and intend to achieve the enhanced objectives when a career match begins. I can see the objectives screen and it says I should press L + Hold L. Ho...[More]


Storyline of Hogwarts Legacy Storyline of Hogwarts Legacy

Posted On: April 7, 2023
Did anyone else feel like the storyline of the entire game was too weak? Like I loved the game and its beautiful creation of the world of Hogwarts but the main storyline about the ancient magic, ranro...[More]


What are the advantages of alignment in Star Wars The Old Republic? What are the advantages of alignment in Star Wars The Old Republic?

Posted On: May 10, 2023
How do Dark Side and Light Side points work with regard to your faction? . In Star Wars the Old Republic, you can earn alignment points towards light side or dark side from conversation choices and...[More]


Can a cart system between 2 spawners work? Can a cart system between 2 spawners work?

Posted On: January 27, 2023
I have 2 spawners 63 blocks apart. I want to create a cart network so that I can.go front and back from a spawner to another for them to work in my xp farm since the spawning radius for a spawner is o...[More]


In Hogwarts is how do I get to this chest behind the revolving statues? In Hogwarts is how do I get to this chest behind the revolving statues?

Posted On: February 12, 2023
There are some caves that has these chests behind the revolving statues. Standing on the platform rotates and you end up on the other platform, rather than the other side of the wall. How do I get ...[More]


What does SP do? What does SP do?

Posted On: May 19, 2023
I recently decided to subscribe to Nintendo Switch Online, so I can play the NES games included in the service. When I launched the NES Nintendo Switch Online app, I noticed that some games were li...[More]


Anyone else not using the Hogwarts Legacy curses? Anyone else not using the Hogwarts Legacy curses?

Posted On: June 8, 2023
Question from user Zealousideal_Chef137 at HogwartsLegacyGaming at reddit.com. Answer: I did on one of my playthroughs; I put a lot of points into potions and plants. It was a great time. I e...[More]


Why Can’t I Change How Dirty I am Why Can’t I Change How Dirty I am

Posted On: October 19, 2023
When I got to the celebration at the camp with the tieflings, I tried rizzing up Gale and chose a line that said I was secretly a nymph. Gale hit me with “hmm no because nymphs bathe regularly a...[More]


Which frigate in Eve has the fastest sub-warp speed after fittings and skills? Which frigate in Eve has the fastest sub-warp speed after fittings and skills?

Posted On: March 9, 2023
In Eve, one can easily look up the base stats for various ships by checking their info pages from the market. The interceptors are probably the fastest ship class in the game, but it's hard to ...[More]