Skip to content

Worst-case trials to match five keys to five locks

Question

Five distinct keys each open exactly one of five distinct locks, with a one-to-one correspondence. Using the best possible procedure, what is the largest number of key-in-lock attempts you might need before you know which key belongs to every lock?

Short answer

1010. For the first lock, at most four keys need testing, since if four fail the fifth is known. Then three for the next, then two, then one: 4+3+2+1=104+3+2+1=10.

Adapted from QuantQuestions.io; question and answer rewritten by SelfMadeQuant.com.

Reveal 10 worked solutions and unlock TENALPHA ($99 → $69/month)

Open the worked solution

Lessons behind this question