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]

Do you pay a gold tax when beating the final boss in Heroes Of Hammerwatch? Do you pay a gold tax when beating the final boss in Heroes Of Hammerwatch?

Posted On: March 10, 2023
Throughout the game, you can deposit your found gold and ore in elevators to take to the surface, at a tax rate that depends on how much gold you have collected. I decided to be brave, and do an entir...[More]


How much stardust do I need to trade my Charcadet in Pokemon Go? How much stardust do I need to trade my Charcadet in Pokemon Go?

Posted On: March 9, 2024
This is my Charcadet. I tried to trade it with my other account but it said I don't have enough stardust.Question from user Kaito at gaming.stackexchange.com.Answer:It depends on if the other account ...[More]


How to move my save game to another PC in Raft? How to move my save game to another PC in Raft?

Posted On: February 21, 2023
I have a new PC and want to move my Raft saved game. Just copy/paste doesn't seem to work. I'm not using any digital platform or service. Question from user Juan Carlos Oropeza at gaming.st...[More]


More questions from an outsider More questions from an outsider

Posted On: October 24, 2023
As I've seen more footage from Baldur's Gate 3 (As an outsider who can't play), I've become curious about a few more things, if people would feel up to answering them for me! . I...[More]


In YuGiOh, How to verify if a card is banned, limited, semi-limited for an event festival In YuGiOh, How to verify if a card is banned, limited, semi-limited for an event festival

Posted On: February 16, 2023
There are two events coming soon in Yu-Gi-Oh! Master Duel, the Legends Anthology, and the XYZ Festival.If I were to pre-build decks for those events, how do I verify if the card I want to use can be u...[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]


I deleted the portal to the end city in minecraft I deleted the portal to the end city in minecraft

Posted On: February 3, 2023
I was messing around with my Minecraft world and accidentally deleted the portal on the main end island that leads to the first end city (don't ask me how). Does anyone know how I can put it ba...[More]


Is it possible to do The Pitt without a slave outfit in Fallout 3? Is it possible to do The Pitt without a slave outfit in Fallout 3?

Posted On: June 19, 2023
I found the slave camp before I found The Pitt guy. I killed the slavers, freed the slaves, talked to The Pitt guy and didn't choose the right dialog options. Then went back to Megaton to do a who...[More]


In Guild Wars 2, Is the area between Kessex Hills, Gendarran Fields and Lions Arch reachable? In Guild Wars 2, Is the area between Kessex Hills, Gendarran Fields and Lions Arch reachable?

Posted On: March 31, 2023
Well, I always thought it wasn't reachable since it's inhabited by the tengu, blocked off by the Dominion of Winds. But when I browsed through the explored map on the Guild Wars 2 Wiki, I foun...[More]


Why are my Dungeon Crawl items losing points? Why are my Dungeon Crawl items losing points?

Posted On: May 8, 2023
I started a new game playing Crawl Stone Soup and have noticed that my weapons and armor get weaker over time. My weapon started at +2/+2 and is now at +2/-4. My armor went from +1 to -1. Wha...[More]