Following up on my previous post about optimal hangman strategy, I’ve run some more experiments, fixed up and tested my script, with some interesting results.

First of all, I tested the script in a game of hangman against every single word in a 70k word dictionary. I played with 10 lives before losing, which is probably on the conservative side, 12 seems like a common figure. The script lost on 469 words, of which 99 were 3 letters long. There were 20 words 7 letters long, all of which ended in ‘ing’. There were no words of 8 letters or longer.

I’ve made a complete list of losing words available, as running the test takes several hours to complete.

In terms of getting around this – unfortunately it is impossible to do better. The only improvement that could be made is randomizing between choices of letter that have equal probability, so that the words that are unreachable cannot be determined. This results in a larger number of words that potentially lose, but a lower probability of losing on those words (and no words will definitely lose).

Obviously you’ll get different output from different dictionaries, larger dictionaries will result in more failures.

These are fairly promising results though, unless you were guessing against an opponent who also had access to optimal-strategy data and knew which words were most likely to be difficult to guess, you’re going to be able to win most of the time with this approach.