Jake has a 4-digit number in mind and asks Raj to guess the number. Raj can have 7 guesses, and Jake will give him some hints after 6 guesses.

Raj makes these 6 guesses:

- 6 3 5 8
- 9 3 0 6
- 4 8 8 2
- 6 7 2 8
- 1 1 9 1
- 5 6 2 7

These were all wrong, but Jake says every guess had exactly one (and only one) correct digit in the correct position. Additionally, all the digits are different.

What should Raj’s 7th guess be?

#### Solution

4321

There are a couple of ways to deduce the answer, but the quickest way is:

- Since there are 6 guesses and only 4 digits, that means there
*must*be 2 guesses with the same correct digit as 2 other guesses. There are only 4 possibilities:- First digit is 6
- Second digit is 3
- Third digit is 2
- Last digit is 8

- But we know that every guess has exactly one correct digit, and therefore has three incorrect digits.
- If 6 were correct, 6358 and 6728 would mean 3, 2, and 8 were all incorrect, which contradicts our finding above.
- If 8 were correct, the same two guesses result in a similar contradiction.
- Therefore 6 and 8 are incorrect, and 3 and 2 are correct.

- Since 3 and 2 are correct, we have already identified the correct digit in these guesses: 6
**3**58, 9**3**06, 67**2**8, 56**2**7. We have 4882 and 1191 left to work with. - The correct digit in 4882 must be 4, because the second and third digits have already been identified and 2 has already been used (remember that all the digits are different).
- Finally, there is only one unidentified digit left, the last digit, and it must be 1 so that 1191 has a correct digit. So the answer is 4321.

4321…

6328