How does the program make its suggestions?

Created by Leon Maurer
Keywords:
Last updated by:
Leon Maurer

It calculates the expected value of the number of words that would still be in the running after choosing a given word (http://en.wikipedia.org/wiki/Expected_value), and suggests that you use the word which is expected to eliminate the most words. It uses the following trick to do so: if one word has n correct letters, then we can eliminate every word that does not have n letters in common with that word.

For a given word.

Pn will be the probability that the word has n correct letters, and Nn will be the number of words that have n letters in common with our given word.

So, for our given word, our expected value = P0*N0 + P1*N1 + P2*N2 + P3*N3 + ...

Now, Pn = Nn/(# of words) since each word is equally likely to be the correct word.

So, the expected value boils down to:

(N0^2 + N1^2 + N3^2 + ...)/(# of words)

The words are sorted by that value -- the smaller the better (since a smaller value means less words are expected to survive, and thus more words will be eliminated)