You have six guesses to figure out a 3 digit code. After each guess, you will be told exactly how many digits are correct but in the wrong place and how many digits are correct and in the right place. You have made these five guesses already:

  • 865: exactly one digit in the right place
  • 964: exactly one correct digit but in the wrong place
  • 983: no correct digits
  • 548: exactly two correct digits but in the wrong places
  • 812: exactly one correct digit but in the wrong place

What is the correct 3 digit code?


Solution

425

548 has two correct digits but in the wrong places. But 8 is not one of those digits, since 983 has no correct digits. So two of the digits must be 4 and 5.

865 has one digit in the right place. It can’t be 6, since 964 has a 6 in the same place and you are told 964 only has a digit in the wrong place. It can’t be 8, since 983 has no correct digits. So the last digit must be 5.

964 has one correct digit but in the wrong place. We know 4 is one of the correct digits and it is not the middle digit, so 4 must be the first digit.

812 has one correct digit but in the wrong place. It can’t be 8, since 983 has no correct digits. It can’t be 1 because the correct digit is in wrong place and we’re only missing the middle digit. So the middle digit must be 2, giving us 425.

7 Comments

  1. 425
    If 8 9 3 is out
    You have 1 2 4 5 6 7 left
    When 5 and 6 were said that one was correct and in the right place, I thought for sure it was 5, because in the second code, the 6 was in the same place, and there was only one (4) correct, but in the wrong place. Then when it was 548, I knew 8 was out, four was wrong place, so I put 4 at the first, 5 was in the wrong place, but I knew it was last. So it was 4_5.
    When they said 812 (8 is out) that one is correct but in the wrong position, that just proves that 1, is out, so then I came up with 425

    • “983: no correct digits” tells us 8 cannot be one of the correct digits

      “548: exactly two correct digits but in the wrong places” tells us 5 and 4 must be correct (since 8 is not correct), but in the wrong places – therefore 4 can’t be in the middle

Leave a Reply

Your email address will not be published. Required fields are marked *