These last few days I’ve spent a lot of time playing Wordle, much like many of the folks on my Twitter feed right now. It’s a fun, easy, and quick game where you guess 5 letter words and see how many you got correctly and whether they’re in the appropriate order. Each player uses the same word, and there is only one a day.
Because of this, I programmed a bot to do my best in the game. Now, you could think this is dishonest, but when you consider how simple it is to “simply search up the solution for today’s problem,” I don’t see why it would be. Nevertheless, knowing the “best possible initial word” might potentially spoil the game for you, so you should stop reading now if you don’t want to know.
Well, then, let’s get going.
The first thing I did was get my hands on the game’s lexicons. In the game’s source code, you can find two lists: one for solutions, and another for guesses (so that you may input crazy scrabble terms like AAHED, but it won’t show up as an actual answer for the phrazle problem ever since its not a widely used word). The maximum number of guesses it will take is 12972, whereas the maximum number of answers is 2315.
To obtain a rough idea of how long this would take, I multiplied 12972 by 2315 to get around 30 million guesses and then multiplied that number by 2315 again to estimate that analyzing each guess would need something in the neighborhood of 60 billion computations. It may seem impossible to perform this using stupid raw force, but 60 billion computations is on the same order of magnitude as the number of operations a CPU can execute per second (4 ghz x 8 cores = 32 billion). The low overhead and familiarity with C++ were major factors in my decision to utilize it.
The bot’s source code is available on github now. I have a “basic” test ready after doing some little coding. It runs each estimate through a database containing all probable answers. Two points are awarded for “green” squares (letter in proper location), one point is awarded for “yellow” squares (letter exists in word but is in incorrect location), and no points are awarded for “grey” squares (letter does not exist in word). Returns the best-scoring guess (the term most likely to include many greens and yellows).
The performance of this system is adequate. It takes an average of 3.69017 guesses until it succeeds. Soar (“a young hawk”) is the first option it chooses. On the other hand, this bot is not invincible. 8 guesses are required to obtain the answer in the worst case scenario.
Even though this technique is lightning quick, we can improve upon it. The question “on average, how many solutions are left after making this guess?” is a more nuanced way to evaluate the quality of a guess. Only a few more hours later, I had a multithreaded version of the bot that would employ this approach and generate the desired output in a practical period of time. It takes this bot version an average of 3.49417 guesses to solve a problem, with a worst-case scenario of just 5 guesses (thus it will *always* solve the problem). In this case, ROATE is the best possible starting point.
It’s astonishing to see how quickly and easily this bot discovers answers to problems. See how fast it discovers today’s (12/29) puzzle’s right answer:
To sum up, the best first estimate in Wordle is ROATE. It means, “The cumulative net profits after taxes accessible to common shareholders, adjusted for tax-affected amortization of intangibles, for the calendar quarters in each calendar year in a specific period of time divided by average shareholder’s tangible common equity”.
On the other hand, ROATE could be the best initial guess based on average guess length, but it will never get a “hole-in-one” since it is just in the guesses list and not in the solutions list. Of course, if you want to blow away your pals, you’ll want to maximize that one-in-2,315, or 0.01%, chance of receiving it right away. In this case, RAISE is the best possible prediction. Using RAISE as your first guess, you’ll need an average of 3.49546% more guesses to complete the puzzle than with ROATE, but you’ll also have a chance at a hole-in-one. (I’ve come to like “raise” since it has the finest “worst case” performance.)
That’s it; the whole story. Wordle’s best first estimate is the letter combination ROATE. A hole-in-one is still possible with RAISE, despite its significantly lower quality. Problem solved: Wordle.
For the measure of “the size of the probable solution list following a guess,” ROATE is the best initial guess. But if “come to a solution in the fewest movements on average” is what you’re after, that’s not exactly the same thing as what I was measuring.
In an effort to improve upon the naïve brute-force approach, I attempted to code a recursive solution that would directly estimate the average number of subsequent guesses required to arrive at a solution based on every guess. However, this proved to be too much for my machine to handle. Computer epochs “greater than the age of the universe” are in play here. But I really gotta get do some real job, so I’ll make it your homework to figure this out. To your success! If you find the *actual* ideal solution, let me know through Twitter.

