157 comments

[ 3.0 ms ] story [ 228 ms ] thread
I did some work on this as well.

One thing I think this analysis seems to be missing is taking into account letter position within the word set. If you take that into account, it actually shifts the first guesses, since you're far better off to discover a green square than a yellow one.

There are some pretty weird words that pop up if you do this analysis, so I've settled on some that are slightly suboptimal but won't make me feel like a robot every day.

I will say that "cares", in my analysis, is a significantly better option than the author's suggestion of aeros, because "e" is more common in position 4 than in 2, and a is much more common in position 2 than 1.

I bet "s" in final position is much rarer than in typical text, because Wardle seems (reasonably!) to prefer base words over plurals, as well as past tense, participle, and other modifications.

For me the most useful immediate information is about vowels, making "adieu" quite useful. But "irate" and "inter" are also pretty good.

Most people focus on the yellow and green results, but the grey results can be even more informative. A grey result doesn't just tell you about its own position, but about all five. So each grey result from the first guess rules out huge swaths of the dictionary.

The more letters from ETAOIN SHRDLU you can cram into the first two guesses, the better off you are. Thus, any letters in color on the first guess would be wasted if repeated in the second word.

We all draw our lines somewhere different, of course, but to my mind, taking into account Wardle's specific choices as exposed in the source code feels like cheating, vs taking the full list of 5 letter words that his code "accepts".

Knowing what answers are actually "true" ahead of time is more information than I'm comfortable taking advantage of.

And yes, eliminating letters is crucial - in my opinion it's always better to guess 5 totally new letters for the second word.

I don't know anything about the source code, so cannot be drawing conclusions from it. Preferring non-inflected words is just good policy, for somebody running such a game.
Over the weekend I wrote a tool to help me figure this out: https://github.com/biesnecker/wordlesmith

Wordle's wordlist is interesting. There is a large (~10,000 words) list of words that it will accept as guesses but that will never be the answer, and a much smaller (~2500 words) list of words it will both accept and could be the answer.

My tool's simple algorithm scores words by taking the product of the frequency with which each of its letters appears in the wordlist multiplied by the frequency that the letter appears in that specific spot. When looking at the entire list of words the top five choices are:

1. tares 2. lares 3. cares 4. pares 5. dares

However, if you just look at the words that could be answers (which I what I've decided to do), the list changes to:

1. soare 2. saine 3. slane 4. saice 5. slate

In either case I've never had a puzzle where repeatedly choosing the first suggested word didn't get me to the answer in six or fewer guesses.

The American spelling of favor got me yesterday. I'd never think of it as a possibility for a 5 letter word. That word list is pretty handy for knowing which words are in scope
One of the things noted by the OP is that you can get stuck in a rut if you don't do more info-gathering than just the first word.

I would recommend not even trying to guess the word on attempt 2 - much better almost always to guess 5 totally different letters.

Hard mode is so much more fun (which disallows this strategy). It changes it up much more each day and is more challenging.
Happy to see tares as your top choice. I used the same method and came to the same word.
Fun. I spent an hour and made this and just tried to score words with vowels and wheel of fortune consonants to start to make a good initial guess. IRATE came up. I like the frequency idea and the entropy discussion and have more ideas.

https://github.com/andyatkinson/wordle_solver

It's interesting to think about optimal starting words, as some people might be more prone to thinking in terms of phonemes ("th", "ed", "sl") rather than individual letters. For this and other reasons, I imagine cognitive scientists would also be interested in the Wordle play data, as they can look to see which hypothesis testing strategies people people use over the course of game.

Also, one version of Wordle people can play is to pick the best starting word every time, another involves starting with a different word every time.

I don't like the "exploration" strategy of playing Wordle. Once you have a start word, work onwards from there (aka "hard mode") rather than enter another random guess to narrow down more letters. I know it is a valid strategy, but idk just feels like cheating to me.
Agreed. That strategy hasn't failed me yet, and it definitely makes me think a little harder.
Agree. I used one of the strategies over a couple of days and it took all of the fun out of the game. Switching to hard mode brought all of that fun right back.

If you're going to write a program to optimise your guesses then why not just go to the source and pull the answer straight from the encoded answer list? I know people derive fun from these things in different ways but that's kind of where I landed.

Go to the gear in the top right, and enable `Hard Mode - Any revealed hints must be used in subsequent guesses`.
I was playing hard mode accidentally. I didn't realize there was a more optimal way to play.
A few days ago I got 4 of 5 letters then lost with 3 wrong guesses at the last letter. I should have spent one turn getting 5 guesses at the last letter instead of spending 3 turns guessing 3 letters.

It's not cheating, it's the better way. If you don't like it, you can turn on hard mode!

It's too bad hard mode only requires that you use positive clues, not negative. I've been trying to push "true hard mode" with my work colleagues. Where every guess must be a potential winner given the information revealed thus far.

So, hard mode, plus no reusing grey letters, plus no using yellow letters in the same incorrect slot.

What, one can re-use a gray letter in hard mode? That's not hard enough!. I find the fun challenge isn't finding the final word but finding valid guesses (i.e. words that exist and aren't using any grays) along the way.
this is my default approach unless really out of options i can think of

but i do slip up at times and jump to punch in a word that i later realize violates one of those yellow rules for instance

Without exploring, I just can't see any words that fit the known letters. I might not have that great imagination of words, or be that good to fit them to fixed clues.
I also wrote a tool for playing: https://github.com/vple/wordle-solver/blob/main/solver.js

There's probably more tuning I can do for the algo, but roughly:

- I took all the words from the site's js as the dictionary.

- From remaining eligible words, compute the letter distribution (ignoring letters you already know are in the solution).

- Pick a word that uses as many of the most frequent letters as possible.

- Use one of those as a guess.

The goal is essentially to greedily reduce the remaining candidate words as much as possible per guess.

This is pretty much what I did, but I mixed in a regexp to hold the location restrictions, and a penalty for using the same letter multiple times. (eg guessing “added” is worse than “aspen” for “a..e.”)

I do wonder if looking at how a letter splits the space of letters and words would be interesting

Yeah, I wasn't sure how I wanted to deal with duplicates so I mostly ignored them. I track letter positions directly (just a bunch of tuples), but don't actually do anything with this other than restricting candidates words.

I think if I work on this some more I'd try to factor in letter positioning when deciding what to guess. My hunch is that it won't make too much of a difference though.

So I tried an experiment using 15,918 five letter English words. I used a basic scoring strategy of scoring a word by summing up the frequency of the candidate letters in the candidate words as determined by a regexp of included and excluded letters. (e.g. `.aves` would score `waves` 1, but `saves` as 0 since `s` is already included)

Variations included adding in the frequency of the letter at a particular position, and adding in the frequency of two letter combinations.

Interestingly enough, the winning strategy was using single letters and using figuring in the position. Second second best was using two letters and position.

ngram=1 posfreq=True mean attempts: 4.34 WinPct 91.280%

ngram=2 posfreq=True mean attempts: 4.35 WinPct 91.186%

ngram=2 posfreq=False mean attempts: 4.37 WinPct 90.074%

ngram=1 posfreq=False mean attempts: 4.38 WinPct 90.445%

Since my base dictionary is way bigger than the Wordle one, I also mixed in a smaller 1,382 word dictionary (google-10000-english.txt) and then combined them by either just sorting by the score, or normalizing the scores, and then sorting. Normalizing the scores was strictly worse.

normalize=False ngram=1 posfreq=True mean attempts: 4.34 WinPct 91.280%

normalize=True ngram=1 posfreq=True mean attempts: 4.43 WinPct 90.281%

FWIW, the absolute worse one was:

normalize=True ngram=1 posfreq=False mean attempts: 4.43 WinPct 89.835%

I should write this up.

Which solution list did you use to calculate the mean attempts?

Another comment mentioned https://botfights.io/game/wordle, if you evaluate your solver on their word list you could compare scores.

I'm sure this is an application for Bayesian Inference, but I'm too uneducated to say anything more insightful than that.
It seems clear to me that there is an optimal starting word, but that the best second word has to depend on the info you gain from the first.

Case in point: If you get 3 green 2 yellow in the first word, you can solve on the next guess.

Of course, you can constrain your strategies to "I always use the same two/three starting words", and in many cases that will be fine. But it's quite obviously not optimal.

Also, the optimal strategy must depend on your goal metric. Do you go for "least average guesses", "least maximum guesses", or "least average guesses while never losing"? There's lots of unstated assumptions in all the analyses thrown around...

> Case in point: If you get 3 green 2 yellow in the first word, you can solve on the next guess.

That's a very specific edge case, though.

I agree with you that the second word should vary depending on the first result, but picking the best first and second words require lots of analysis. The first word should be picked in order to open up the best options for second word, and while I believe the second word should not contain letters from the first, unless you got extremely lucky, the distribution of letters of remaining available words probably changes which letters you want to cover.

Failing to do the required analysis, my current strategy is to pick two words that cover the 10 most common letters in english, ETAOINSHRD. Sometimes it's "ethos" and "nadir", sometimes "thine" and "roads", etc. So far, it's worked well.

> It seems clear to me that there is an optimal starting word

I took one step further and calculated the optimal starting word for obtaining green matches (I assume that this also makes it likely to produce yellow matches, although I did not explicitly optimize for that).

Beginning with the full list of 5-letter words, I calculated the frequency of each letter of the alphabet in each of the 5 possible positions for a 5 letter word.

Then I iterated through the list a second time, this time assigning a score for each word equal to the sum of frequencies for each letter in its respective position.

By a significant margin, the highest score is SLATE (over 1400). Runners up (over 1300) are SAUTE, SHIRE, and CRATE.

Caveat: this approach assumes that all possible words are equally likely to be the answer.

Interestingly, doing a similar analysis where we bucketed each word into 243 (3^5) buckets based on the possible result, we found "RAISE" as the best word. Source[0]

[0] https://gist.github.com/popey456963/a654e98d0180566b897b70ee...

RAISE also sounds pretty plausible.

How is the score calculated? What is the trade-off between expectation greens / expectation yellows?

Intuitively I expect that greens are significantly more "valuable" than yellows, since they reduce the search space much more...

Maybe this is all the wrong approach and the right metric is how many legal answers remain after the first guess?

I would say that the distribution of yellow letters in the remaining word determines the value. If you have a yellow "X" or "Q" or one yellow vowel after testing all 5 vowels, that is a lot more meaningful than a yellow "T", which could really go anywhere. A yellow "G" but grey "I" tells me (at least intuitively, not quantitatively) a bit more than a green "I" and grey "G".

A recent word had a single vowel. This made it reasonably easy to guess where those vowels could go and to also choose a consonant-heavy next word that would really tear apart the search space if even one consonant was valid.

I think I'll switch to using RAISE or SLATE as a first choice. It was ADIEU before, but there's almost never an A in slot 1, U in slot 5, or D in slot 2, and I don't feel like any of these letters has a significantly most common position with just the info from these 5 letters. The yellow/grey letters are helpful after ADIEU, but I still need to explore at least 4 more letters (including O, and usually N or C) to even get a good idea of where any matches might go. In the moments that letter 4 is "E" while guessing ADIEU on round 1, that actually doesn't help me much with round 2. In fact, then I'm faced with the decision to explore unguessed letters in general, words with two "E"s, and/or words with "E" in 4th position. (same with "I" in 3rd)

I've implemented your last suggestion of scoring words by how much they reduce the pool of potential candidates (12k+). Testing it against the 1,000 most frequent words (targets), the word LORES seems to work best on average.
I did the same and ended up with ARISE.

My word list was alphabetical and the system picked up the first one :P

> Beginning with the full list of 5-letter words, I calculated the frequency of each letter of the alphabet in each of the 5 possible positions for a 5 letter word.

There’s a great many 5-letter words that the creator will never consider because they’re too obscure. Treating all 5-letter words as possible is a mistake when calculating strategy for this.

High-frequency letters will be over-represented in your analysis.

GP might’ve pulled the wordlist from the site. It’s in the bundle iirc.
Yep, it's the site wordlist.
(comment deleted)
Interesting. I've been using ORATE as it knocks out a lot of the top frequency letters from the english language as a whole. But I guess the distribution in five letter words, and more so in a subset of five letter words, may skew differently.
From what I saw, T shifts down noticeably when restricted to 5 letters exactly. Intuitively, it sort of make sense -- there are a ton of short T words. ('that' and friends).
Nice. I tried a simpler method of only looking at the wikipedia table of overall letter frequency in dictionaries (not in 5 letter words) and the vowels are high, especially E and I followed by A. Then I checked the frequeny of starting letter and that is led by "S". So my guess for a 5 letter word became one with at least two vowels from E,I,A, starts with an S, and has the remaining two characters from the reasonably high frequency set (R, T, N, etc). My guess then was SIREN which has that property. Just out of curiosity, if you still have the output from your program, how bad was SIREN compared to SLATE?
That is a really interesting approach -- if you remove the words with any of the letters in SLATE, what is the highest ranked word? (If you have it to hand)
> It seems clear to me that there is an optimal starting word, but that the best second word has to depend on the info you gain from the first.

Definitely. The likelihood of a letter appearing in a given place changes depending on the letters around it. A Q will almost always be followed with a U, for example.

I wrote a script yesterday which spits out the relative probabilities of possible letters in each unknown position, given the current known/excluded letters -- it was interesting to see the effect in action.

What's the opposite - a "bongcloud" for Wordle?
I've spoken to a lot of people who say they take this "exploration" strategy, but I think it misses the human language element of deduction.

I've been playing Wordle for a while and while I'm no wordsmith, if you take an analytical strategy to word selection from line 2 onward it's never that difficult to get 3/6 (which I presume is the highest score attainable without significant luck).

English is one of the most irregular languages, with so many influences and variations, but it still has structure and common patterns. Once you have knowledge from a well selected exploratory 1st line, there's a lot you can deduct about potential variants in the word structure of the answer to make an informed 2nd line choice that'll be dual purpose: both being a good exploratory word and also a reasonably hopeful lucky guess.

Afterall, if you're aiming for 4/6 you're not really aiming very high.

100% agree. Wordle is not a hard game - it has a pleasing mix of luck and skill, and while all the theories and strategising are interesting, none of them are really necessary. I don't understand the "exploration" strategy at all - playing "hard mode" means every guess is a possible winner.

I've done about 30 now and my highest amount of guesses was 5 when I had the "ank" of CRANK and from there it was pure guessing as there were multiple, equally likely (as I understand it) possibilities.

My best score was 2 guesses and it felt like a very hollow victory - just a lucky guess, really. 3 feels like you've done some work and yeah, 4 feels average.

(comment deleted)
This strategy seems to avoid words that Wordle will accept, while not choosing them as word-of-the-day, e.g. SERAI.

If your goal is to minimize the number of remaining words in the worst case, I think SERAI is the winner, leaving you with at most 697 choices. [Assuming my code is right]

Genuinely curious, why would you use SERAI rather than ARISE? Functionally equivalent, doesn't seem like a made-up word, and might actually be the answer one day.
S is very common as the first letter, so having it in that position gives you more information than having it in fourth position (due to higher probability of green).
As CrazyStat hints, anagrams are not equivalent in Wordle, because changing the word order means that you're also changing the bucketing, the words in the anagram shifting between yellow and green.

To be more specific, I counted 882 possible words in the worst case using ARISE, versus 697 using SERAI.

I really like the "hard" version of Wordle better where you can only guess clues which make sense given the clues. It seems more in the spirit and although there may be 26 ideal starting words it would be very hard to memorize the set list of words that could be the best guesses as a result.
I prefer to minimise vowels in early guesses, because I find i'm good at filling in the blanks between consonants, but not the other way around.
You could probably have fun with

Player 1) create a predictable process that can guess wordle words

Player 2) given the full code of 1 find a word that will not be found by that process in 6 steps

The game is over if someone can decide a process that catches all valid 5 letter words in 6 steps.

“A strange game. The only winning move is not to play.”
That applies more to life than to wordle
Well that's bleak. Life can be pretty good, too! Talk to someone if you need to, it helps.
I feel the best strategy to win at Wordle would be to see if someone already posted the answer.

If no answer, use reliable hints ( i.e on Twitter) to better inform the initial guess.

Beyond that, the best initial word goes beyond information theory, letter frequency, etc to also be a word that has a realistic chance of being word of the day. As a trivial example, AEIOU may reveal some information on the first guess, but I find it extremely unlikely that you will win Wordle in 1 with this guess.

If you’re looking up the answer, then you’re cheating. What’s the point? You can already get it via JavaScript if you’re so inclined.
I made my own Wordle solver recently that uses frequency analysis of letters and bigrams of five letter English words as a scoring function. It works fairly well.

Someone in this discussion suggested using frequency analysis at position, which seems interesting, especially when trying to locate misplaced letters. I might have to try that.

https://github.com/jonathankoren/wordle-solver

What was your source for "English words"? This is an interesting problem, itself.
Googling will give you countless lists. The internet solved that problem decades ago.

The biggest problem is when your guessing dictionary contains words that aren’t in the acceptable word list in Wordle. For that, I generate 10 guesses on each turn. At least one of them should show up. I didn’t want to use Wordle’s dictionary because that felt like cheating.

> The biggest problem is when your guessing dictionary contains words that aren’t in the acceptable word list in Wordle.

A dictionary is not interesting, but for the selection of the contents.

> Googling will give you countless lists. The internet solved that problem decades ago.

That's not a solution when the definitive lists all differ. English is a high context language, so the existence of words is both a function of frequency and locality (this includes time periods). Deciding on what's the canonical list isn't "look up what Wordle uses" anymore than Webster or Oxford. That's the problem I'm referencing.

I did the same. My source of words was the Unix dictionary found in macOS. The path is:

  /usr/share/dict/words
When I did the frequency analysis, I scoped it to only 5 letter words.

If you're looking for a great "first guess word", "trace" is one of the words that will yield the most clues.

My first two words are POINT and SHEAR though I'm going to change it to SNARE. This covers most of the vowels and frequently occurring letters. From then on it's trying to guess the other consonants and the position of the letters.
I pretty much always start with stare
This strategy optimizes for figuring out all the letters that are used in today’s word. But that’s not the goal of the game, it’s finding one word in particular. Those sound similar but are not.

In the example given, the first guess already told you there is an E, but then it’s not used in the next guesses. Figuring out the position of that letter, instead of trying to find a third one, will massively reduce your search space, I’m sure someone can do the math on this being more beneficial.

Yesterday I got one green one yellow in the first guess, and got the word in three steps from there. There are very few words that could fit after those two letters + all the excluded ones. You literally just iterate through the alphabet and possible words in your head while excluding the gray letters.

EDIT: just did today in 4 guesses again using this approach. Lucky streak?

My starting word is BACON.

> Lucky streak? My starting word is BACON.

I see what you did there

I computed the Pareto optimal frontier of initial Wordle guesses, showing the tradeoff between maximizing green squares and maximizing yellow squares in this thread: https://twitter.com/adereth/status/1478435989982875648
correct me if I'm wrong, but it seems like greens are strictly more valuable than yellows, so giving them equal weight doesn't make much sense to me.
Yes, that’s true. But how much more valuable? Would you trade 0.1 expected greens for 0.2 expected yellows? Computing the Pareto optimal frontier shows you all your options.
This is interesting, you should re-do this analysis using the actual lists of 2000 valid words and 10,000 valid guesses, since it does fairly significantly change the math vs. a normal English dictionary (the word can almost never be plural, for example, dramatically reducing the frequency of S in the final position).
Two things I've wanted to explore with Wordle:

1. Some sense of "par". Can you crawl twitter for everyone's solution tweets and get a sense of the average guesses for the day? 2. "Unwordle". For people who follow the hard-mode rules, how far can you get deciphering their guesses based on their shared color grid? Could you make it competitive between friends to see how well you can guess each others guesses? Would that encourage more creative guesses to trick your friends?

I built a command line wordle solver that provides an updated best guess as the game progresses and you learn more. Right now it's just based on word frequency, but working to add more.

Also added a command line version of wordle in case you want to play more and practice and a simulator I'm using now to explore optimal strategy more.

https://github.com/jkatzur/wordle-solver