Best Word[le] (Origin)

The above image was the third image created by Stable Diffusion when inputted the words “Wordle Solver”.

The New York Times “Wordle” is a very popular word-guessing game among all age groups, consisting of a short set of simple rules. Its sheer intuitiveness and easy-to-pick-up nature, in addition to the daily word being consistent throughout its entire player base, is one of the reasons it has climbed so high in popularity in recent times.

Its rules are as follows:

  • There is only one Wordle puzzle per day
  • Everyone has the same puzzle; everyone has to guess the same word
  • You have to guess a 5 letter word in 6 attempts
  • Every guess must be a 5 letter word from the Wordle dictionary
  • Every letter guessed that is not in the daily word is marked grey
  • Every letter guessed that is in the daily word but isn’t in the right position is marked yellow
  • Every letter guessed that is in the daily word in the right position is marked green

So here’s my story– one day, I go to school, and I see my friend absolutely ecstatic. He comes up to me and asks, “Did you do today’s Wordle yet?” Having done it in the car on my commute, I responded with an unenthusiastic “Yeah, took me 5 tries though,” (which really isn’t great just in case you’ve never played it). He then proceeds to tell me some shocking news: “I got it first try.” And at that moment, I instantly remembered that his starting had always been “crate”. “What are the chances?” he continued, and we both chuckled it off until we had to get to the second period. That was all the thought I gave it. Until two days later. I gave it a second thought. What are the chances? I guess that should be pretty easy to find out: it’s just 1 over the number of 5-letter English words, which actually ranges anywhere from 4,000 (MW Dictionary) to 158,000 (Free Dictionary). In other words, the odds are not stacked in your favor.

But then I started to ask myself more ambitious questions: questions like “With random educated guesses, what’s the chance you get the wordle right?”, and “What starting word has the highest probability to be correct?”. At the end of my intense questioning segment, I decided to answer the most important of all: What is the best starting word in Wordle?

In order to find the best wordle word, I first need to consider all possible 5-letter words.

To do so is pretty simple. First, I had to find an English dictionary that was manipulable in Python. I chose and downloaded “words_alpha.txt” from this GitHub Repository, adding it to my workbench:

Using the following lines of code:

f = open("words_alpha.txt")
bigChunkofText = f.read()

"words_alpha.txt” becomes easier to reference later on. To separate this Big Chunk of Text into individual words, I first needed to see how it was organized– I opened the file and saw that it was a long list of words, each separated by a new line.

That means that to split this big chunk of text, I could use:

words = bigChunkofText.split('\n')

to split the file into individual words, cutting a new word with every new line.

Finally, using:

words_5 = []
for w in words:
if len(w)==5:
words_5.append(w)

I created an array for words with 5 letters, called “words_5“. I also created a simple loop that tests every word in “words“; if it has exactly 5 letters, it is appended to “words_5“. If it doesn’t have 5 letters, it doesn’t get appended to the array. (words_5 Printed)

Finally, to check how many 5 letter words this dictionary contains, I ran:

print(len(words_5))

which returned:

In conclusion, using this code:

f = open("words_alpha.txt")
bigChunkofText = f.read()
words = bigChunkofText.split('\n')
print(words)
words_5 = []
for w in words:
if len(w)==5:
words_5.append(w)
print(len(words_5))

I was able to create an array of all 5 letter words (from this dictionary at least), and count that there was exactly 15920 of them.

Leave a comment