Beating the Bee

Lately, I’ve gotten obsessed by the daily New York Times Spelling Bee. It’s a word puzzle with seven letters. Your job is to find as many words that use some or all of them as you can. Every word has to include the letter in the center. Words must be at least four letters long. You can use letters more than once in any word.

For example:

O A I P R T Y (O in the middle)
Bee letters for July 13, 2021: O A I P R T Y

In this puzzle, you have the letters for PARTY, but that word doesn’t include the required letter (O), so it doesn’t count. AIRPORT works, though, as do PATRIOT, POOR, ROOT and TOPIARY. TOPIARY uses all the letters in the puzzle, and a word like that is called a “pangram” in the parlance of the Bee.

You score points when you find a word. Four-letter words score one point. Longer words score as many points as they have letters (a six-letter word is worth six points). Pangrams score the value of the word, plus seven points (so TOPIARY is worth 14 points).

Not every English word is legal in the Bee. Curse words and slurs aren’t permitted (POOP works above, presumably because it’s slang for “stuff” or “info”, but POOPY does not). Proper names are out (sorry, PORTIA). Specialist terminology doesn’t count (YOTTA is the ISO prefix for 10²⁴, but the Bee gives you no points for knowing that).

As you score more points, the Bee cheers you on, calling you “Good,” “Amazing” and “Genius.” If you score all the points — find all the legal words — you’re Queen Bee.

Obviously, the total number of words, and so total number of points you can score, depend on the letters for the day. On any given day, you can click on the scoring line in the game to see the day’s rank scores:

Beginner (0), Good start (5), Moving Up (13) Good (21), Nice (66), Great (105), Amazing (132), Genius (184)
Rankings for July 13, 2021

It turns out that the percentages are consistent for each level every day. Two percent is a Good Start, 5% is Moving Up, 8% is Good, 15% is Solid, 25% is Nice, 40% is Great, 50% is Amazing and 70% is Genius. 100% makes you Queen Bee.

This means that, on any given day, you can figure out the total number of points available: just double the points for Amazing. You might be off by one, if the total is odd. You can check your math and figure out whether to round up or not by dividing Genius by .7. The max score for the July 13 puzzle was 263 points.

You can deduce things about words you haven’t found yet, if you understand scoring. If you’re within 14 points of the total, you’ve found all the pangrams (because the shortest pangram scores 14). If you’re five points away, you could need one five-letter word, or five four-letter words (and it’s way more likely that you’re missing a fiver than five fours, because fours aren’t that hard to spot). And so on.

I just love playing this game. Finding words is fun. I get an extra little jolt of pleasure when I find a pangram (there may be more than one in any day’s puzzle). I like beating the scores for each level, and I find I’m consistently able to get to Genius without resorting to skulduggery.

Queen Bee, though, is super hard. In my first month of playing, I was only able to get it one time. That’s a problem for me, because if I know I’m close (remember, you can tell what the total number of points is), I get absolutely obsessed. I’ll think about words all day, like when I’m out doing errands. Sometimes even if I’m in a conversation my attention will wander back to the game. My wife has learned to recognize that middle-distance stare.

How to cheat

One thing I noticed very quickly is that the game keeps working if you are disconnected from the internet. That means it can’t be checking the game web site when you type a word; they have to be stored locally on your phone or computer.

I thought maybe the coders had used encryption or some other technique to at least obscure the answers. Nope! When you dump the page source, the entire list is there in the clear:

I cleaned that up a bit for readability, but that’s right there in the July 13 page source. Highly effective cheat, of course, but not a very fun way to win.

Quick side note here: If you look at that list, you might spot a few words you don’t actually know. That doesn’t happen to me too often, but in this game, I wouldn’t ever have found TORII — I simply didn’t know that one.

How to cheat a little less

Sometimes when you get stuck just a few points shy, you know you only need a word or two to get you to Queen Bee. There are strategies you can apply — if you have UN, IN, ED, S, ING, you can try adding those as prefixes or suffixes to words you’ve already found. Sometimes, though, you just can’t spot any more words.

In that case, you might be tempted to use a dictionary to look up qualifying words. That’s not easy with an old-school book made of paper and glue, of course, but if you’re clever at writing regular expressions and have a good word list in digital form, it’s a pretty simple thing to do on a computer.

One problem with this approach is that your word list isn’t the same as the one that the Bee’s editors use. The official word list is a real asset of the game, in my opinion — it’s well-curated and comprehensive. I can generally understand why any given word is, or isn’t, included.

The online word lists I find are much less carefully assembled. One of the best is a list of English words, sorted by frequency of use, that’s published by the company Kaggle. Using that list but discarding less-frequently-used words gave me a pretty good list to start from.

Even so, it includes false positives (that is, the list includes words that aren’t allowed by the Bee). Occasionally, it also has false negatives (words that the Bee allows that aren’t in my list). The false positives aren’t a problem; you’re not penalized for guessing words that aren’t allowed. But a false negative means you’ll miss a word and not become Queen Bee.

I wrote a shell script that does this search for me when I provide it with the day’s Bee letters. Using my modified copy of the Kaggle unigram list, my script produces a list of words including

TORII is in there, so that’s good. It’s a word I wouldn’t have found otherwise. TOTORO and TOYOTA are proper nouns so the Bee won’t like them, but that’s fine. TRAO and TOPTOP are false positives. Again, no harm.

I generally resort to this script only if I’m very close to Queen Bee, have been obsessing over words for a while, and want to reclaim my brain from the game for the day. I run it, and I almost always spot a couple of words in the output that I didn’t see in the game. MOTTO plagued me for most of one day last week (and I had already gotten MOOT!). Sometimes you just don’t see them.

Getting the last few words lets me think about other things. I don’t count that as actually winning, since I had to cheat to do it, but it’s a relief for me to be able to stop thinking about it.

You could, over time, refine your word list by deleting the false positives and adding the false negatives (the complete word list for the previous day is published with each day’s puzzle). It would be pretty easy to automate that, but with so many letter combinations to choose from, I think it would take a long time to converge on the authoritative list used by the editors.

How to augment yourself without really cheating

When I start the Bee on any day, I kind of scan the letters thinking about words, and answers pop into my head pretty quickly. Once I get to “Amazing” status, though, new ones get harder to find, and I try to get a little systematic — trying to find all the words that start with ORA, for example.

When I’m very close to Queen Bee, I sometimes try to be even more systematic, taking a single letter, and then cycling through all possible second, third, fourth letters. This is a hard thing to do! I get distracted pretty often by words I’ve already found, or I lose track of where I am on choices for the third or fourth letter, and so on.

I think it would be fair to use a pencil and a piece of paper to make lists of possible words for the Bee, which would solve the problem of getting distracted. Of course it would also be very slow, and you’d need a pile of paper — total number of possible six-letter combinations from the Bee is 7⁶, or 117,649 combinations you’d need to look at. Of course a bunch of those are simply impossible under the rules of English spelling (no words start with RTY or contain TTTT, for example).

I wrote a Python program that lets me explore different prefixes to see if I think they might lead to words. This basically replaces the pencil and paper with a screen and keyboard, but it’s still my job to judge the prefixes and decide whether or not they’re promising. And, of course, you need enough vocabulary to recognize the actual words. So I don’t think this is cheating.

The program systematically iterates through the possibilities. Whenever you think a prefix is unlikely to yield results, you cut that area of exploration short, pruning the search space and saving yourself time. When you spot a word you know, you can save it; it gets displayed at the top of the screen. When you’re all done, you can type those words into the Bee, and it’ll accept or reject them.

Here’s what it looks like as I am exploring the solution space for the July 13, 2021 Bee:

Using my iterator program on the July 13, 2021 Bee

Here’s what I can tell you about this approach:

  • It works! The first time I ever tried it, I got to Queen Bee.
  • It’s exhausting! You’re staring at a screen, trying to stay focused and make good decisions on different prefixes, for a long time. It took me two hours, start to finish, to win the game using this program. In fairness, it’s always taken me more than two hours of elapsed time to beat the Bee completely, but that’s generally been broken up by other activities while my subconscious carried on working the puzzle without me.

For those of you who use, or look at, the code, I’m defiant in my choice of the curses package for managing the display. I’m an old Berkeley guy. Even so, I admit that the user interface is kind of sucky. It’s easy to mess up and skip away from a promising prefix, or to fail to save a word. I kept paper next to me and used a pen to jot myself a note when that happened.

In the end, though, this is a really terrible way to play the Bee. You wind up hunched over a keyboard for hours. I still got a tiny blast of joy when I spotted a word, but those moments were separated by long periods of drudgery, trying to hit the space bar and the ‘s’ and ’n’ keys at the right times. Besides, you’ll realize that ORATORY is coming up, but you don’t want to get distracted and accidentally skip past ORATORIO. It’s hard to stay sharp.

I did try to organize the code so that if some person cleverer than I am trains up a machine learning model to use in place of their own brain for ruling on prefixes, it would be fairly easy to modify the code to use it. You’d perform that surgery in the UI.score method. If you do that, hit me up with a comment on this page or with a pull request on my github. I’d love to hear how it works.

Possible future work

I’d really like a version of the game that allowed submission of words via a RESTful API, and that returned yes/no and score info. That would make it simple to code up some bots and aim them at the game to play automatically, without human intervention. I assume there’s a way to fake keystrokes to the web UI , which ought to make it pretty simple to create the API. Clueful folks are encouraged to weigh in.

It would be fun to try some different strategies out. As there’s no penalty for wrong guesses, a liberal word recognizer/generator would likely score well. And it would be interesting to pit different dictionaries against one another, to see if I could figure out which one the editors started from. All of that, though, would require automation.

If you’ve got any other cheats or insights, I’d be glad to hear about them, too!

Now that I’ve proven that my approach works, I don’t think I’ll ever play a complete game in the iterator again. It just fails the fun test. If you are thoughtful about the order in which you specify letters to the iterator, you could use it to search a portion of the solution space without doing all of the possibilities. I don’t know whether I’d ever want to do that, but it’d at least be possible.

I’m sure I’ll resort to my dictionary search script from time to time, if a particular game gets wedged too deeply into my day. That cheat’s been useful to me in the past. My compulsive habits are unlikely to improve at this point in my life, so it’s good to have that escape hatch.

Looking at the day’s answers in the page source is too shameless a cheat for me, so I don’t think I’ll ever do that.

Most of the time, though, I’ll just play the game the way it’s meant to be played. It’s so fun!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mike Olson

Berkeley-based techie with an interest in business. Worried about the world.