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 use of making dinosaurs poop in Ark? What is the use of making dinosaurs poop in Ark?

Posted On: June 20, 2023
I'm kinda new to Ark, and exploring the (awkward) menus I've discovered that it's possible to force a tamed animal/dinosaur to poop. Why? Is there any actual advantage for doing this? O...[More]


In Lost Ruins, Does the Goblin Shamans Mask work on Rosies second form? In Lost Ruins, Does the Goblin Shamans Mask work on Rosies second form?

Posted On: March 26, 2023
The description for the Goblin Shaman's Mask says it increases damage to goblins and orcs by 50%. Does this include Rosie's second form during her boss fight when she transforms into a goblin?...[More]


How to perform a flat spin? How to perform a flat spin?

Posted On: April 1, 2024
In Asphalt Extreme, I am asked to perform a flat spin to achieve stars and stuff. What is this, and how do I pull such a move off?Question from user Mathias711 at gaming.stackexchange.com.Answer:A fla...[More]


Does closing the game reset Blood Moons timer in Breath Of The Wild? Does closing the game reset Blood Moons timer in Breath Of The Wild?

Posted On: July 23, 2023
According to Zelda dungeon, Blood Moon regularly occurs every 2 hours and 48 minutes of gameplay (every unskipped 7 days in-game). Another answer confirms that it's a time-based event. So I&...[More]


Can I disable DLC in Dead Cells? Can I disable DLC in Dead Cells?

Posted On: April 6, 2023
I purchased Dead Cells on Steam with all the DLC and am finding the experience to be overwhelming. Can I disable the DLC to only play with the original content? If yes, how would disabling the DLC imp...[More]


Why does shift-queuing blink in Starcraft 2 have unpredictable results? Why does shift-queuing blink in Starcraft 2 have unpredictable results?

Posted On: May 9, 2023
I was messing around with some of the "Challenge" missions and discovered a Protoss a mechanic that I don't quite understand (Protoss is my least played race by far, so sorry if this is ...[More]


Sheathe wand Sheathe wand

Posted On: September 15, 2023
If there are going to be any dlc or a second game , i beg you game developers to make a button to sheathe the wand or to have it in your hand until you manually put it back . It is a nice little detai...[More]


How can two squads of COD friends join the same DMZ instance? How can two squads of COD friends join the same DMZ instance?

Posted On: May 9, 2023
In the Call of Duty DMZ mode, you are in squads of 3 players, however it's possible to create an alliance when in game by inviting other squads to join you. You can invite a squad using the pin...[More]


Do maps fill out while exploring underground? Do maps fill out while exploring underground?

Posted On: April 26, 2024
When a craftable map is held, exploring the world will fill out areas of the map with an image of the world surface. Will said map be updated the same way if held while exploring underground? Or will ...[More]


What does shadow cache option exactly do in resident evil 4 remake? What does shadow cache option exactly do in resident evil 4 remake?

Posted On: April 10, 2023
Resident evil 4 remake on PC has the graphics option "shadow cache", what does it exactly do? The comparison picture they provide does not show any difference really. Is it dynamic or for mo...[More]