Hangman strategy

ℹ️ This article was written many years ago. Its technical content may be outdated.

The basic idea of the game Hangman is simple: think of a word that your opponent cannot correctly guess the letters of within the allowed letter limit. Recently I was looking at a Wolfram post about the best hangman words, and thought it would be worth talking about here. I’m going to be discussing the research contained in the linked article, and how we can apply this to our own games.

In my personal history of playing the game, I often found that choosing short words with few common letters was a good strategy: by minimising or avoiding the use of vowels, words like fly or jinx, while they’re “easy” words, they could fall through the gaps when your opponent is concentrating on the vowels and more common letters. However, this same strategy cannot necessarily be used against a computer: they could have a dictionary of hundreds of thousands of words, with each letter narrowing the possible candidates, and choosing the letter that is most likely to lead to a correct guess. Therefore, while _ i _ _ may not come easily to a human, a computer can soon determine that an n somewhere in the word is likely, and thereafter j and x will likely follow.

Since we all love to beat computers “at their own game” so to speak, it is interesting to think about optimal word choice to defeat a particular artificial opponent. I say particular because there is no guarantee that any two algorithms will choose their next letter in the same (or similar) way — the algorithm linked to above would be completely deterministic if they did not attempt to move toward a Nash equilibrium point by choosing letters probabilistically based on their ratio of success — for example, the article mentions a ratio of x:e of 13:1000, approximately 1:77.

It seems that my intuitive strategy for using short words was correct: a 3-letter word has a maximum of 23 incorrect guesses, so without any kind of insightful frequency analysis, there’s a much better chance with these words already — longer words allow algorithms (and humans) to get a foothold on the word, permitting easier further progress.

The best words also depend on the ‘length’ of the game you’re playing. For example, an 8-game would permit 8 incorrect guesses before the player loses, whereas a 13-game allows 5 more guesses, requiring 13 (half the alphabet) before the game ends. The researcher decided to use a ‘brute force’ method to attempt to discern the best words — that is, throw every word you can think of at it, numerous times, and see how often it gets the right answer. While time-consuming and boring for a human, thanks to the wonders of modern technology we can do this all very quickly. The results below come from the 90,000 word dictionary built into Mathematica.

Results time. The top 10 words are ranked in the table below, with the best words to use at the top.

Word rank8-game9-game10-game11-game12-game13-game

From the above table, we can see that the word jazz ranks top in all game types tested. So, if you want to beat a computer using this (or a similar) algorithm, jazz is a good bet. There are simply too many other words of the easily guessed form _ a _ _ (and with more common letters than j and z).

This is all well and good, but what about if you wanted to have the best 7-letter word? Or 10-letter word? Fear not, for the following table shows the top 10 words of each length, from 4 letters to 10 letters, played in a 10-game.

Word rank4 letters5 letters6 letters7 letters8 letters9 letters10 letters

So, in a game where the length of the word is your prerogative, go for jazz. If you’re forced to choose a 10-letter word, try zigzagging. A few caveats though:

  • This technique has proven to be effective against a computer algorithm, not human intuition.
  • Others may also know the “least often guessed words”, and may know the strategy ahead of time.
  • Make sure you have a dictionary to hand: jazzing doesn’t sound like a real word, and you’ll probably get called out on it.
  • People may get annoyed at you if they are consistently not able to guess the answer correctly!