Thursday, 28th March 2024 13:12
Home / Features / Solving in the wonderful world of Wordle, puzzlers’ new obsession

Wordle has gripped the world. But has a British mathematician come up with a formula to play it perfectly? We investigate.


The world’s puzzle obsessives have had a new passion over the past few months: Wordle, a brilliantly simple game created by a New York software engineer as a personal gift for his wife. The intended original audience of one has now grown to an estimated 3 million. It’s an incredible viral smash-hit.

Poker players, of course, have taken Wordle to heart. It combines two things they love more than anything: problem solving and then bragging about it. (Wordle encourages sharing ones daily results on social media.) Furthermore, the limited parameters of Wordle’s gameplay seems to suggest it is potentially “solvable”, and so hundreds of fanatics have been seeking optimal approaches to play.

For all the endeavours of poker players, however, Wordle may already have been “solved” by a British mathematician named Alex Selby. Selby thinks he has answered the question “What is the mathematically best way to play Wordle?” And certainly, there doesn’t seem to be anyone to refute him.

WHAT IS WORDLE?

The aim of Wordle is to deduce an unknown five-letter word in a maximum of six guesses.

At the start, the player knows nothing about the word beyond its length, so guesses a random five-letter word. The game then responds by showing the player five coloured blocks.

Getting there in Wordle

If a block is GREEN, it means that the selected letter is IN THE TARGET WORD, and, what’s more it is IN THAT POSITION in the target word.

If a block is YELLOW, it means that the selected letter is IN THE TARGET WORD, but it is currently in the wrong position.

If a block is BLACK, it means that the selected letter is NOT in the target word.

Using this information, the player now makes a second guess. It must be another legitimate five-letter word, but the player has more information to go on. They can a) repeat the selection of any “green” letter, b) move the position of any yellow letter, and c) discard any letter they know is not in the word. With these restrictions, the number of possible words is necessarily greatly reduced.

The process then repeats with letters gradually confirmed or rejected, until the player is able to deduce the target word.

Like all the best and most successful puzzle games, Wordle has incredibly simple rules and gameplay, but it requires great mental agility to prevail.

For most people, the aim is just to determine the target word before running out of guesses. But for the dedicated problem solver, that aim will always be to deduce the target word in as few guesses as possible — and for that reason, the very first guess is going to be crucial.

This is where Selby’s research comes in.

THE BURNING QUESTION

Part of the reason Wordle is so appealing to players of all linguistic abilities is that its target words come from a list of only 2,315 commonly-used five-letter words. Although there are 12,972 five-letter words in the English language, and players are free to make a guess from this larger list, Wordle’s inventor Josh Wardle didn’t want players essentially chasing after “words” they had no better chances of guessing than if they let their pet cat pace across their keyboard.

(This is in contrast to, say, Scrabble, which permits use of all legitimate words, and whose elite players spend hours delving into the dictionary’s dustiest corners to learn every permissible word, no matter how obscure.)


READ: Strategy tips for SCRABBLE | SUDOKU | BACKGAMMON | RISK


Selby’s analysis therefore takes as its starting point these two lists of words: a full list of nearly 13,000, from which players can guess, and a much smaller list of 2,315 potential target words. He then tries to figure out how we can get to each of the target words from all the possible, following all the rules of the game, in the fewest guesses.

This will them determine what he describes as “the burning question you never knew you wanted answered”, namely what is mathematically the best way to play Wordle?

Selby lays out the algorithms and formulae he uses to make this journey towards the target word. It is far beyond anything I could possibly understand, but it’s all there to see on his website titled Sonorous Chocolate.

One of Alex Selby’s formulae

This incredible analysis — essentially a map from every permissible “test word” to every permissible target word — allows him to rank the full list of first test words against one another, and to determine precisely which is the best word to start with.

That word will be the one that, on average, starts the player off on the path requiring the fewest guesses.

GET YOUR SALETS ON

Selby doesn’t beat around the bush. “If you imagine you are up against a random allowable word, then the strategy that minimises the average number of guesses…starts with the guess SALET,” he writes.

According to the data, choosing SALET as an opening word in Wordle, and then following an optimal subsequent list of guesses, results in an average of 3.5084 guesses required to reach the target word. The second-best word to choose is LEAST, from which the target word will be reached in an average of 3.5106 guesses. Then it’s “REAST” and “CRATE” in third and fourth.

Wordle’s best guesses

Selby also provides what he calls “strategy files”, which essentially guides a player along the optimal path through the game, from first guess to the solution. (Wordle has an “easy” and “hard” setting, where rules are slightly different, and there’s one file for each setting.)

After their initial guess, players can input the hints provided by the game (“G” for a green letter; “Y” for yellow; and “B” for black), and the strategy files reveal the next optimal guess. It quickly becomes much less a test of mental dexterity and more an exercise in data entry. But if you want to get to the answer quickly, all the material is there for you.

It’s perhaps tempting to draw a comparison here with solvers in poker, which lay out optimal paths for play in no limit Texas hold’em, and suggest the percentages with which a player should be raising, calling and folding various holdings in various situations. However, poker is necessarily far more complex, where decisions are based on incomplete information. The data underpinning Wordle is finite, and the game therefore “solvable”.

Starting with “SALET” and following the formula

SALET is a satisfying word for most amateur Wordle players because it fits with what they have probably figured out already. It helps to determine where/whether an A or an E fits into the puzzle, as well as the common consonants S and T.

(A SALET, by the way, is a mediaeval helmet, more commonly spelled SALLET. But you knew that already.)

THE END OF WORDLE?

Now that it’s been solved, that’s the end of Wordle, right? Well, no. For a number of reasons.

Firstly, the vast majority of Wordle players will never even hear of Alex Selby’s work, much less have any interest in applying it to their games. It essentially takes all the fun out of it.

Furthermore, there are already many variations of Wordle coming out, some with more letters in the words (presumably making any solution trees even longer and more complicated) and some with different restrictions. This should keep avid players on their toes for a long while yet.

Wardle, the game’s creator, is also completely uninterested in monetising his viral invention, so does not seem to mind about people taking his original idea and running with it. That should mean all manner of small changes to keep the puzzle fresh.

 

People will continue to share their Wordle progress

It should be noted that Selby has form in destroying puzzles. (And by “destroying”, I mean solving.) Back in 2000, a British aristocrat and advisor to a former Prime Minister created a puzzle named “Eternity”, whose name was a hint to how long it might have remained unsolved. The aristocrat offered a £1 million prize to anyone capable of cracking Eternity.

Suffice to say, Selby, who was then 32 and working with a friend named Oliver Riordan, took a little less time than eternity to get to the bottom of it. He had it cracked in seven months. “We were a bit lucky,” Selby said at the time. Not so the aristocrat, who said he had to sell his home to pay the reward. The full story of Selby vs. Eternity, reported in the British newspaper The Guardian, is very much worth a read.


Further reading:

Wordle Game
Alex Selby’s website

Study Poker with Pokerstars Learn, practice with the PokerStars app