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]

In Assassins Creed 3, What is the best way to expose a ships powder stores? In Assassins Creed 3, What is the best way to expose a ships powder stores?

Posted On: April 16, 2023
On some of the ship missions, there is an optional objective of "sink ships by firing on their powder stores". I know how this works broadly - I've shot up some ships and got the spec...[More]


How do I lick a plane? How do I lick a plane?

Posted On: November 21, 2014
A friend of mine told me that I would get an Achievement if I managed to lick the plane that's flying around in the world but, he won't tell me how to get close to it.I tried many different things. Ju...[More]


setworldspawn is not spawning players to the exact place setworldspawn is not spawning players to the exact place

Posted On: March 27, 2023
I am trying to make a Minecraft map but I can't set the world spawn. I did /setworldspawn then /kill and I ended up 10 blocks away then I tried again I was still 5 blocks away. . In the map it ...[More]


How do I check which video clips I've watched in Yakuza 0? How do I check which video clips I've watched in Yakuza 0?

Posted On: March 17, 2023
One of the completion list tasks in Yakuza 0 is to watch 30 different video clips at the erotic video store. Rewatching a clip you've already seen doesn't count. Is there a way to check wha...[More]


Is Hogwarts Legacy on Hard Difficulty really that difficult? Is Hogwarts Legacy on Hard Difficulty really that difficult?

Posted On: May 26, 2023
I finished downloading the game the other day and I haven’t had time to really start it. I like a bit of a challenge but I don’t want anything too crazy. Question from user Interesting-...[More]


STUCK Lvl 39. 100% STUCK Lvl 39. 100%

Posted On: September 11, 2023
PLEASE HELP. I haven’t seen any recent posts on this issue so I’m am reaching out. . I have completed HL to 100%. And I mean 100%, on EVERYTHING. There is no room for any more XP - not ...[More]


How to get the Operating Profit Graph for the entire game? How to get the Operating Profit Graph for the entire game?

Posted On: September 6, 2023
The game shows it only for last few years:. Is it possible to get similar graph for the entire game duration? Question from user ZakiMa at stackexchange. Answer: It's not possible. The...[More]


Can you rename your ship? Can you rename your ship?

Posted On: March 18, 2024
After completing the tutorial in Helldivers 2, you are asked to name your ship. Is it possible to rename your ship later on?Question from user Stevoisiak at gaming.stackexchange.com.Answer:You can ren...[More]


Does leaving the car on use up fuel? Does leaving the car on use up fuel?

Posted On: March 3, 2024
In Pacific Drive, when I put the car in park I can exit the car without turning off the engine. Does leaving the engine turned on use up fuel if the car isn't moving?Question from user Stevoisiak at g...[More]


Where is Eluned in the final stages of Song of the Elves? Where is Eluned in the final stages of Song of the Elves?

Posted On: June 27, 2023
I'm at the final boss battle of Song of the Elves, but my teleport crystal is out of charges. I looked for Eluned in Lletya, where she has been throughout the quest, but she's not here. I trie...[More]