Optimal strategy for guessing a four-digit password with feedback

1 reply · 3K views · last reply
Science Advisor
Messages
1,229
Reaction score
0
There's a funny flash game where one of the puzzles is to guess a four-digit password with digits from 1 to 8. After each guess, the puzzle gives you some number of x's and some number of o's, with the x's indicating how many numbers you guessed correctly and in the right place, and the o's indicating how many numbers you guessed were correct but in the wrong place. Incidentally, you get nine guesses to find the password. Is there a simple optimal strategy for this?

Also no digits appear more than once in the password and you can't guess a password with digits appearing more than once.
 
Last edited:
You might try looking up strategies for Mastermind, it's very similar. In mastermind you have only 6 choices for the digits (colours actually) and repetitions are allowed. Mastermind can apparently be done in 5 guesses.