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]

Attempting my first honor mode run Attempting my first honor mode run

Posted On: September 10, 2024
I've beat the game twice on balanced with different party combos and classes to familiarize myself with as much as the game as possible. .My plan for my HM run is:.Spores Druid Tav, OH Monk Karlach (m...[More]


Can a redstone latch in Minecraft Java Edition be supplemented with a toggle function? Can a redstone latch in Minecraft Java Edition be supplemented with a toggle function?

Posted On: April 3, 2023
SR latches and T-flip-flops are trivial circuitry in Minecraft redstone, but it appears that there is little to be found for a circuit that combines both, allowing for both SR and T functionality. ...[More]


How does Health and Healing work in BattleBit Remastered How does Health and Healing work in BattleBit Remastered

Posted On: July 6, 2023
I am new to Battlebit Remastered and am a bit confused on how the healing works as it seems to be different from most traditional FPS games (especially Battlefield 4 which it seems to draw a lot of in...[More]


Should I get Hogwarts Legacy for Console or PC? Should I get Hogwarts Legacy for Console or PC?

Posted On: May 1, 2023
Looking to buy this game but debating between Pc or Xbox. (Don’t have a steam deck) but leaning toward Xbox so I can play on the couch. Thoughts? Question from user mattgm1995 at HogwartsLega...[More]


What is this treasure in Lara’s trophy collection? What is this treasure in Lara’s trophy collection?

Posted On: March 3, 2024
In the Croft Manor section of Tomb Raider 3, there is a hidden trophy room containing relics from Lara’s previous adventures. Most of these are references to previous games - fragments of the Scion ...[More]


Why didnt the game save some of my Walking Dead choices? Why didnt the game save some of my Walking Dead choices?

Posted On: March 25, 2023
In Season 1, and the first time when Kenny, Lee, Clem, Katya, Duck, and others found the abandoned car with supplies in it, I chose NOT to take it and told Clem that we would be okay without it. Howev...[More]


What is the Concerned Citizen in The Witcher 3? What is the Concerned Citizen in The Witcher 3?

Posted On: June 8, 2023
In Novigrad I keep finding sheets of paper with messsages involving the "Eternal Fire" and Novigrad's church. They seem to be written by someone who is against Magic, Witches, Mages a...[More]


Is Hearthstone a game-within-game? Is Hearthstone a game-within-game?

Posted On: August 25, 2023
Hearthstone's visuals suggest that the game is played in a tavern in the World of Warcraft universe on a (possibly magical) game board. Is Hearthstone a game-within-game in WoW? When you play H...[More]


Do cursed chests replace normal chests in Dead Cells? Do cursed chests replace normal chests in Dead Cells?

Posted On: April 9, 2023
The description for the "Damned" aspect says "Cursed chests spawn rate is doubled". Do the extra cursed chests replace normal non-cursed chests that would have spawned? Question...[More]


Returnal Why cant I destroy this energy barrier with my melee attack? Returnal Why cant I destroy this energy barrier with my melee attack?

Posted On: May 4, 2023
This energy barrier doesn't appear to be any different than any of the other energy barriers I've destroyed (unless it's another colour blind issue), so I'm really confused as to why I...[More]