How to beat your friends at Wordle using maths

Wordle is an online word game available to play for free in any web browser at www.nytimes.com/games/wordle. Originally developed by Josh Wardle for himself and his girlfriend, the game has exploded in popularity since its release in October 2021 and was bought by the New York Times for an undisclosed seven-figure amount in January 2022.

The goal of playing Wordle is to guess any five-letter word in only six guesses, starting with no information. After each guess, each letter in the guess will change to a different colour: green if the letter is in that position in the target word, yellow if that letter is in the target word but in a different position, and black if that letter is not in the target word. Using these clues, the aim is to find the target word in as few guesses as possible.

Wordle’s rise to popularity can be explained by two key elements: only one puzzle is available each day (the same one for everyone), and that the results of each game can be easily shared on social media without spoiling the answer. This creates competition between players around each day’s word and prevents players from getting bored if they were to play multiple games in succession on the same day.

When starting a game of Wordle, you have no knowledge at all about the target word. So an important question is how do you choose which word to start with? We will now investigate various possible starting words (and how to choose the words after that) using maths!

The first method we use is investigating the frequency of each letter in possible target words. There is a publicly available list of the 2309 possible target words; analysing these we see that the five most commonly appearing letters in target words are E, A, R, O, and T.

This suggests possible starting words ORATE, OATER and ROATE.

Another method was proposed by Tyler Glaiel in a Medium post titled ‘The mathematically optimal first guess in Wordle’. He checked each of the 12972 possible enterable words against each of the 2309 possible target words. For each combination of enterable word and target word, a score is assigned based on how the enterable word matches the target word: 2 points for each green square and 1 point for each yellow square. While the previous method only considered the frequency of letters, this method also considers the position of letters and the overall quality of whole words.

The best starting word under this system is the enterable word with the highest average score. This gives a starting word of SOARE. After developing his method further, other possible starting words suggested by Tyler Glaiel are ROATE and RAISE.

The final method we explore was developed at MIT by Dimitris Bertsimas and Alex Paskov in their paper ‘An Exact and Interpretable Solution to Wordle’. In this paper the authors design an algorithm to complete a game of Wordle in as few guesses as possible, given a starting word. This process of actions considers a vast number of possible strategies, taking several days to run on a high-end computer.

The algorithm works by considering the state of the game and the possible actions that can be taken at each point in time. The state of the game is the set of all possible words that might be the target word, given your current information. In the game above, after one guess this list would contain PLANT and AUDIO, but not THERE (since it doesn’t contain an A). The possible actions that can be taken are guessing any of the 12972 possible enterable words.

We can then work out the probability of moving from a state s to another state t after choosing an action a. For each possible target word, choosing a will either move you from s to t, or from s to some other state. This probability is calculated as the proportion of times this transition takes place (the number of times it happens, divided by the total number of possible target words). The algorithm uses these probabilities to solve a series of equations called the Bellman equations, finding the value of each state after each number of guesses – which then shows us which actions/guesses, on average, lead to the solution the quickest.

Running the algorithm for every possible combination of starting word and target word, the paper found that the starting word with the lowest average number of guesses needed to win is SALET, taking 3.421 guesses on average. Starting with SALET also guarantees that you’ll win the game within five guesses if you follow the algorithm – no matter what the target word is! The four words closest behind SALET are REAST, TRACE, CRATE, and SLATE.

We now have many possible starting words that can claim to be the ‘best possible’ starting word. Personally, I’m going with SALET – it has four out of the five most common letters in possible target words and was found to be the best starting word in the most advanced method we explored. Feel free to experiment with different choices and see which starting word you like best!

Leave a Reply

Your email address will not be published. Required fields are marked *