A chest is locked with a three-digit code. You are given five clues: '6 8 2' has one correct digit in the correct position. '6 1 4' has one correct digit in the wrong position. '2 0 6' has two correct digits, both in wrong positions. '7 3 8' has no correct digits. '7 8 0' has one correct digit in the wrong position. What is the three-digit code?
042
From '7 3 8', digits 7, 3, and 8 are incorrect. In '7 8 0', 0 must be correct but not in position 3. In '6 8 2', 8 is wrong, leaving 6 in pos 1 or 2 in pos 3. If 6 were correct, it would contradict '6 1 4' (where 6 is in pos 1 but stated as wrong position). Thus 6 is wrong and 2 is in pos 3. In '2 0 6', 2 and 0 are correct; since 0 cannot be in pos 3 or 2, 0 is in pos 1. Finally, '6 1 4' leaves 4 for position 2.
About this riddle
Logic riddles give you a few facts and ask what must be true. List what you know, cross out what cannot be, and see what is left.
Difficulty: Hard. More like this: Logic riddles with answers or try Einstein's Logic Grid for a different kind of puzzle.
More logic riddles
A bag contains red and blue marbles. If you draw two marbles at random without replacement, the probability that both are red is exactly 1/2. What is the smallest possible total number of marbles in the bag?
The ice cream cone is smaller than the sand castle, and the sand castle is smaller than the swimmer. Which one is the biggest?
Three boxes of chocolates are placed on a table. One contains milk chocolate, one contains dark chocolate, and one contains a mix of both. Every box is mislabeled. You pull one piece from the 'Mixed' box and it is dark chocolate. What is inside the box labeled 'Milk'?
Three workers—Adam, Beth, and Carl—finish their shifts at 2 PM, 4 PM, and 6 PM. Beth finishes two hours after Adam. Carl does not finish at 6 PM. What time does each person finish?
A drawer contains loose red, blue, and green socks. If you pull socks out one by one without looking, what is the minimum number of socks you must remove to guarantee getting a matching pair?
Three chests are marked with metallic plaques. Gold chest plaque: 'The silver chest contains the treasure.' Silver chest plaque: 'The gold chest does not contain the treasure.' Bronze chest plaque: 'The treasure is in this chest.' Exactly one of these plaques makes a true statement. Which chest holds the treasure?

