Logical Puzzles Medium 5 min

A person has four identical-looking keys and four identical-looking locks. Each key opens exactly one lock. What is the minimum number of individual key-lock tests needed in the worst case to guarantee matching every key to its lock?

Hint
Think of eliminating possibilities after each unsuccessful test.

Answer

6 tests.

Explanation

For four keys, test three possible locks for the first key in the worst case. Once its lock is identified, three keys and locks remain. The next key needs at most two tests, and the next needs at most one. Total = 3 + 2 + 1 = 6.

Step-by-Step Solution

First key: at most 3 tests.
Second key: at most 2 tests.
Third key: at most 1 test.
Fourth key is determined automatically.
Total = 6.
6 puzzles