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]

Why did Donkey Kong 64 require more than 4 MB of memory? Why did Donkey Kong 64 require more than 4 MB of memory?

Posted On: August 1, 2023
As most of you know, the N64 Donkey Kong game had a game breaking bug on the 4 MB memory version. They needed to include the expansion memory just so that bug wouldn't happen. I can imagine in ...[More]


Does an achievement system exist on Nintendo Switch? Does an achievement system exist on Nintendo Switch?

Posted On: April 12, 2023
Does the Nintendo Switch have an achievement system like trophies on PlayStation or achievements on Xbox? Has Nintendo Switch any board with progress in games? Question from user TravelerVihaan ...[More]


What does a plus cells and gems icon on the Dead Cells world map mean? What does a plus cells and gems icon on the Dead Cells world map mean?

Posted On: April 18, 2023
During a run with 2 Boss Stem Cells enabled, I noticed something odd on the World Map screen. The box for the Ossuary biome had icons of cells, gems, and a plus sign over it. When I died and started a...[More]


Tell me why I should like Minsc Tell me why I should like Minsc

Posted On: September 27, 2023
Because he’s the first person at camp that I don’t like (well except Mizora). I don’t like his character and at this point I don’t really. Red a ranger. Question from user B...[More]


Risk of Rain 2 is not reading my controller inputs? Risk of Rain 2 is not reading my controller inputs?

Posted On: April 16, 2023
I've run into an issue with Risk of Rain 2 on my steam deck, where it no longer accepts controller inputs. In settings, under controller options, most inputs are labeled with an error saying there...[More]


How can I defeat guardians in Breath Of The Wild? How can I defeat guardians in Breath Of The Wild?

Posted On: August 9, 2023
I have not been able to discover a method of defeating guardians. I have to run away every time. What are some methods to defeating these giant instant death laser creatures? Question from user Gar...[More]


Will PS4 game discs work on PS5 Console? Will PS4 game discs work on PS5 Console?

Posted On: May 4, 2023
I recently bought a PS5, after long wait. So, the first few games that I plan are - Bloodborne and Demon Souls. The only discs for PS4 available on Amazon India are that from PS4. So, will those di...[More]


Is there any way I can give myself 360° vision in game? Is there any way I can give myself 360° vision in game?

Posted On: March 15, 2024
A key gameplay mechanic in Project Zomboid is that your character can only see what's in front of them, even though the game has an isometric perspective. Anything behind becomes shrouded. That's fine...[More]


Who killed the party people on the yacht in Max Payne 3? Who killed the party people on the yacht in Max Payne 3?

Posted On: April 11, 2023
I want to understand some details of the Panama mission; was the mission even part of the main story, contribute to it? Or is it shown as a side story, one episode from Max's past missions as the ...[More]


How to enable redstone wiring with a flick of a lever? How to enable redstone wiring with a flick of a lever?

Posted On: March 30, 2024
I'm looking for a solution to enable redstone wiring (completing a circuit) by flicking a lever. If you don't know what I'm asking for, imagine that sticky pistons could push redstone dust, and flicki...[More]