padlock has a 4 digit key code

2657 - has two correct digits but neither are in the correct place
0415 - Has one correct digit but it's in the wrong place
4268 - Has no correct digits
1749 - Has two correct digits, both in the correct place.

All the 4 digits in the key are different.
`what is the code for the padlock?

Respuesta :

Answer:

5739

Step-by-step explanation:

We start by using the information:

4268 - Has no correct digits

This means that the digits 2,4,6 and 8 are not in the combination. (A)

Next, we analyze the information:

2657 - has two correct digits but neither are in the correct place

From what we said above, 2 and 6 are NOT present in the combination - so the correct digits here must be 5 and 7. However, they are not in the correct place. (B)

0415 - Has one correct digit but it's in the wrong place

From what we said in (B), the correct digit here must be 5 - however, it's not in the correct place. So, the 5 should be either the 1st digit or the 2nd digit of the combination. Also, since there is only 1 correct digit here, we can also exclude the digits 0 and 1 from the combination. (C)

1749 - Has two correct digits, both in the correct place.

Since we said that 7 is a correct digit (A) and 1 and 4 are not part of the combination (B and C), the other correct digit here must be 9. Since the 7 and the 9 are at the correct place, the combination now is:

X 7 X 9

We also know that 5 is another correct digit (B), and it is not at the 3rd place (C), therefore it must be at the 1st place; so we have:

5 7 X 9

Finally, we notice that so far we have excluded the following digits:

0, 1, 2, 4, 6, 8

And since 5,7 and 9 are already present, the only missing digit is 3; so the combination is:

5739