Question 123 of 134
Q.There are n locks and n matching keys. If all the locks and keys are to be perfectly matched, then the maximum number of trials is:
(a)
(b)
(c)
(d)
Puducherry TnboardTamil Nadu HSC First Year (DGE) Board 2024MCQ· 1mImportance★★★★★
92% · 123/134 Questions
You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.
Start your 14-day free trial to unlock the full solution →Matching n keys to n locks one lock at a time, the worst-case total number of trials needed is .
Work on the locks one at a time, always trying the remaining untried keys on the current lock.
For the first lock, there are n candidate keys. In the worst case you try n-1 wrong keys first, and even the final (guaranteed correct) key still needs to be physically inserted and turned to open the lock, so opening the first lock can take up to n trials.
For the second lock, only n-1 keys remain (the correct key for lock 1 is now used up), so it takes up to n-1 trials.
…
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.