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]

Is hacking spectres in the game mode Attrition recommended? Is hacking spectres in the game mode Attrition recommended?

Posted On: May 17, 2023
When hacking a spectre in the game mode 'Attrition', you'll get points (about 4) for that and nearby spectres change sides and start following you. But they now can be killed by the enemy ...[More]


What does the keyword Treble do? What does the keyword Treble do?

Posted On: April 14, 2024
What does the keyword Treble do? The following description is not clear to me.Add Treble to the left side. Other Keywords x2 -> x3.Question from user GnomeSlice at gaming.stackexchange.com.Answer:Ot...[More]


Great Hall area Field Guide Pages Great Hall area Field Guide Pages

Posted On: July 31, 2023
Can anyone please help me find the last field guide page in the Great Hall area? It says I only have 23 out of the 24 for that area. I have used online guides and visited every single one of the page ...[More]


What is the Eraser Trick in StarCraft? What is the Eraser Trick in StarCraft?

Posted On: July 4, 2023
What is the eraser trick mentioned in this StarCraft video? Note: This is referring to the 1998 game, not the current game. Question from user C. Ross at stackexchange. Answer: Here's ...[More]


Why remove redstone dust from my command block contraptions? Why remove redstone dust from my command block contraptions?

Posted On: December 29, 2023
Whenever I show my command block contraptions to my friends, they always comment that I should remove the redstone dust from them. They say it causes lag and that redstone can be unpredictable, but I&...[More]


Why do I create 2 characters when starting a new playthrough? Why do I create 2 characters when starting a new playthrough?

Posted On: August 8, 2023
The character creation process is very confusing to me. I know it's early access and things are being polished continuously, but it's unclear why I need to create 2 characters. After comple...[More]


Do the Illithid powers have any negative consequences? Do the Illithid powers have any negative consequences?

Posted On: August 11, 2023
Throughout the game, you can improve your hidden Illithid Powers skilltree by consuming more mindflayer worms. You also get [Illithid] skillchecks from time to time. However when you do either of t...[More]


How to catch Latios and Latias? How to catch Latios and Latias?

Posted On: September 20, 2023
I'm starting to play Pokemon Emerald! How can I catch or encounter Latios or Latias in the game? I want this Pokemon so bad! This is my childhood Pokemon because it can one shot Rayquaza! So cool!...[More]


What does food satisfies a random group member mean? What does food satisfies a random group member mean?

Posted On: November 5, 2023
On the Witch's Hut event map, the trick card for Foggy Food says:. Food satisfies a random group member. What does that description mean? What does Foggy Food actually do? Question from u...[More]


How to quit an online match? How to quit an online match?

Posted On: March 6, 2024
I'm trying to run for the Platinum trophy before the server closure, so I'll soon start to get game modes I don't need anymore, and I don't want to waste my time.Is there a way to leave an online matc...[More]