How does the program make its suggestions?
- 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://
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)