The door is locked with a 10-digit code, consisting of 10 distinct digits in the combination. The only way to get in is to press all the numbers correctly.
When you try 1 2 3 4 5 6 7 8 9 0 , the computer tells you that "only 4 numbers are in the right places."
When you try 5 4 0 2 3 6 1 9 8 7 , the computer still says that "only 4 numbers are in the right places."
Finally, when you try 0 2 7 9 3 1 4 6 5 8 , this time the computer says that "only 5 numbers are in the right places."
What is the right combination to this door lock?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
I wonder that, too, 'cause I proved it by all possible trial & error. Lol...
Log in to reply
Here's Python code that validates it as the unique solution. (Please excuse the sloppy coding.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Log in to reply
Ah, thank you for sharing. I'm not much of a computer expert.
Log in to reply
@Worranat Pakornrat – No problem!
I've added some comments to the code for anyone wanting to read along.
Report: 1209364857 is indeed the only possible answer confirmed to be true.
1279364980 this is also correct one.you should check out this.
Log in to reply
Um, there's no 5 in your combination (9 occurs twice). Please check your answer again.
What if the numbers common in both sequences (eg. 2, 3 and 6) are in wrong position?
Log in to reply
Well, that's a good question. Let me try explaining.
Suppose you have 3 sequences , each has 10 digits. Each sequence has the number of right digits as 4, 4, and 5. Those are:
R, R, R, R, X, X, X, X, X, X => 4 corrects.
X, X, X, R, R, R, R, X, X, X => 4 corrects.
R, X, X, X, X, X, R, R, R, R => 5 corrects
You can see that if we pair each sequence and then find that there is only one common digit in each sequence pair, those common digits must be the right digits.
Total corrects: 4 + 4 + 5 = 13
Minimum commons: 13 - 10 = 3
Total commons (1,2) + (1,3) + (2,3): 1 + 1 + 1 = 3
Therefore, all of the common digits must be the right digits.
Compare to these sequences:
R, R, R, R, X, X, X, X, X, K => 4 corrects.
R, R, X, X, R, R, X, X, X, K => 4 corrects.
R, R, X, X, X, X, R, R, R, K => 5 corrects
If we pair each sequence and then find a lot of common digits, we can't assure that the common digits are the right digits (in this case, K - the last digit - is the wrong digit). Lucky for us that this did not happen in this problem.
Total corrects: 4 + 4 + 5 = 13
Minimum commons: 13 - 10 = 3
Total commons (1,2) + (1,3) + (2,3): 3 + 3 + 3 = 9
Therefore, all of the common digits are not necessarily the right digits (the K contributed 3 commons in this example).
Hope this may help you.
Question I have is about your point (ii) above - Why should the only possible last digit be 0,7 or 8.. and not say 1,4,5, or 9??
1279364980 this is also the correct one.you should check this out.
I arrange them into 3 rows to see the same numbers in column clearly.
1 2 3 4 5 6 7 8 9 0
5 4 0 2 3 6 1 9 8 7
0 2 7 9 3 1 4 6 5 8
as you can see there are 2 same numbers in column 2, 5 and 6 (numbers 2,3 & 6). Then I cancel the remaining 2,3,6 and the number in between the same number
1 2 - 4 - 6 7 8 9 0 (2 left correct)
5 - 0 - 3 6 1 9 8 7 (2 left correct)
0 2 7 9 3 - 4 - 5 8 (3 left correct)
1 2 0 9 3 6 4 8 5 7 (Answer)
by that left numbers it becomes easy to solve. By trial and error I solved this
Me too it took time . I was supposed to study chemistry . how old are you . I am 17
Confused 😵
Problem Loading...
Note Loading...
Set Loading...
Compare each sequence:
1 2 3 4 5 6 7 8 9 0 => 4 corrects
5 4 0 2 3 6 1 9 8 7 => 4 corrects
x x x x x 6 x x x x
1 2 3 4 5 6 7 8 9 0 => 4 corrects
0 2 7 9 3 1 4 6 5 8 => 5 corrects
x 2 x x x x x x x x
5 4 0 2 3 6 1 9 8 7 => 4 corrects
0 2 7 9 3 1 4 6 5 8 => 5 corrects
x x x x 3 x x x x x
Consider that: 4 corrects + 4 corrects + 5 corrects = 13 corrects.
But the maximum number of correct digit must not exceed 10.
So, the 3 repeating digits (i.e. 6, 2, and 3) are the correct digits.
We can conclude that:
(i) The correct sequence must be like: x 2 x x 3 6 x x x x.
(ii) Because 13 corrects - 3 repeating corrects = exactly 10 corrects, the correct digit in each position must come from the digit from the three given sequences, e.g. the last digit is possible only for 0, 7, or 8.
After that, it seems only trial and error method manages to get this task done.
PS. I still wonder how to prove that there is only one possible solution, except using the brute force method.