Open the lock

A letter lock consists of 5 different letters from the first 11 letters of English alphabet. A lock will open if any three letters match with the original code (so the order of the letters is irrelevant). What is the minimum number of tries in which you can surely open the lock?


The answer is 5.

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.

2 solutions

Kartik Prabhu
Jun 11, 2014

Let the options be the numbers 1 to 11. Firstly, we'll try the first 5 numbers, i.e. 1 to 5. If this does not open the lock, then we know that there can be at most 2 correct numbers within this set. Then we try the next 5, and if this doesn't open the lock, we can again extrapolate that there can be at most 2 correct numbers within the set 6 - 10. Therefore, after 2 turns, we are certain that the final, untried number is one of the required numbers. For the purpose of our example, this is the number 11.

So we try the set 7 to 11, and if this doesn't work, then we know that there is only one correct number between 7 and 10, and that 6 is also definitely a correct number. This is gleaned after our third try.

So then we try 11, 5, and any other three numbers from the set 7-10. If this fails, then we know that the last correct number was actually the one we just removed. So for example, if we had just tried 11,5, 7, 8, and 9, we'd know that the missing number, 10, was actually one of the 3 required to open the lock. So after the 4th attempt, we know 3 of the 5 valid digits with certainty, and can proceed to open the lock on our fifth try.

Therefore, the minimum number of attempts to open the lock = 5 = \boxed{5}

I have 2 doubts 1. Why are u not considering the possibility of repition. 2. Why are you not considering the uniqueness of position.
For example 12345 is different from54321

Kunal Dixit - 5 years, 1 month ago
Rahul Bothra
May 8, 2014

The alphabets possible will be from A-K. And any five of them are answers. First we try, A,B,C,D,E, And there are the following possibilities. All the 5 are the correct codes and so the lock will open. 4 of them are correct and lock will open. 3 of them are correct codes and so lock will open. Now if 2 or 1 of them are correct, then the lock won't open and we will go to the second chance. Now we try, F,G,H,I,J, If from A,B,C,D,E, only one was correct, then the lock will surely open in this case. But if 2 of them were correct, then we get the following cases - out of F,G,H,I,J - 3 are correct or 2 are correct and the left one is also correct. If out of F,G,H,I,J, 3 were correct, Then also the lock would open or else We come to know that the left one(k) is also a code. Next we remove one of the alphabets and place k in its place, say F,G,H,I,K - Now if the lock doesn't open, then J is also the correct code. Next we try say, F,G,H,J,K. Now if I (Which we removed is also correct), then also the lock won't open and hence we would come to know the codes and we can just use I,J,K to open the lock as the 5th attempt. 5 cases are - 1. A,B,C,D,E 2. F,G,H,I,J 3. F,G,H,I,K 4. F,G,H,J,K 5. I,J,K

why didn't you consider repetitions (for e.g.. code= AABCC)

Rohan Jain - 7 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...