Oooh, so the computer has to guess the word that the human is thinking of.
I'm officially stumped. The only thing I can think of is this:
1.) Say the human is thinking of "apple", and the computer picks a word at random - for example, "orange."
2.) The human then tells the computer that the correct letters are A and E.
3.) The computer searches the dictionary for any word that has A and E but not O, R, N, or G.
4.) The computer guesses the first word it comes to that meets the criteria - let's say "ape."
5.) The human tells the computer that the correct letters are "a", "p", and "e".
6.) The computer searches the dictionary for any word that has A, P, and E, but not O, R, N, or G.
7.) And so on...
I don't know if that's helpful or not, but it's the only way I can think of.
EDIT: Never mind, I just re-read your first post and I forgot that you don't know which letters are right, you just know how many of them are right. Hmm... this is a hard one, I'm going to have to think about it a little more.