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 record word size for a gaming system? What is the record word size for a gaming system?

Posted On: February 20, 2023
I remember the "bit wars" of the late 1980s and early 1990s. The Genesis/Mega Drive and the PC Engine/Turbografx-16 were heavily marketed in the very early 90's as having twice as many &...[More]


Does Circuit Superstars support splitscreen with two (identical) controllers? Does Circuit Superstars support splitscreen with two (identical) controllers?

Posted On: March 19, 2023
Is it possible to play Circuit Superstars in split screen (i.e. local multiplayer) with two (identical) controllers? I know that the game's Steam page mentions both Split Screen and Full contro...[More]


Whats bacon good for in PVZ? Whats bacon good for in PVZ?

Posted On: September 22, 2023
In Plants vs. Zombies, Crazy Dave has bacon for sale. Its description is "Mmmmmmm. Delicious!". I've bought one or two slices of bacon, but I've never noticed a benefit. What's t...[More]


Frequency of the Golden Bowser Train? Frequency of the Golden Bowser Train?

Posted On: January 28, 2023
Does anyone happen to know how often you can go to the Golden Bowser Train? For those that don't yet know, it is a level with nothing but coins, and is a great way to bolster your extra lives.Questio...[More]


Broom races vs. type of broom Broom races vs. type of broom

Posted On: September 7, 2023
I got annoyed in previous playthroughs that I would miss the winning time by 10+ seconds or multiple hoops. This playthrough I picked a different broom from Albie Weeks, the one that mentions 'sta...[More]


Zelda TOTK, What does the blue numbers for my weapon strength indicate? Zelda TOTK, What does the blue numbers for my weapon strength indicate?

Posted On: May 20, 2023
I have a wide selection of fused weapons. Though, I noticed that many of the numbers are colored blue while the rest are white. At first I assumed it was to indicate either fused weapons or weapons...[More]


J Pippins Potions J Pippins Potions

Posted On: September 3, 2023
For some reason j pips potions will not restock spinder fangs /mongrel fur .I go back days and days have gone by nothing is available ? Anyone else have this issue ? Question from user RenoRainesnz...[More]


Can a cable be used to connect the official Xbox wireless headset to an Xbox Series controller? Can a cable be used to connect the official Xbox wireless headset to an Xbox Series controller?

Posted On: March 6, 2024
Can I use a cable to connect an Xbox Wireless Headset (the official one) to the standard Xbox wireless controller? USB-C to 3.5mm TRRS I guess?Question from user Sam at gaming.stackexchange.com.Answer...[More]


How does air intake work in Kerbal Space Program? How does air intake work in Kerbal Space Program?

Posted On: April 3, 2023
I've just started building planes and am confused about the way air intake works. For instance, the J-90 "Goliath" Turbofan Engine is specified to consume a whopping 132.272 Air/sec whil...[More]


Mob Spawning - Despawning in Minecraft Mob Spawning - Despawning in Minecraft

Posted On: May 30, 2023
So I've been building up my Villager Trading farms and halls and breeders, etc., and one of these builds is the converter - Using a zombie to convert the villager and back again to reduce trade co...[More]