Problem about grandfather and grandson playing detectives
Problem about grandfather and grandson playing detectives
Anonim

Determine how many attempts it will take to pick up the keys to the boxes.

Problem about grandfather and grandson playing detectives
Problem about grandfather and grandson playing detectives

One morning little Vitalik found on the bed a note from his grandfather with the following text: “There are three boxes and three keys in the top drawer of my desk. Each key fits only one box. Find the key to each of them in three attempts. If you can do it and open all the boxes, you will collect three pieces of the map for the next task."

Will the grandson take three attempts to find the keys?

Let's designate the keys with the letters A, B, C, and the locks of the boxes with the letters D, E, F and consider the possible scenarios.

First try: Key A does not match lock D. So this key opens lock E or F.

Second try: Key B does not match lock D. So this key matches lock E or F. Then the remaining key C fits to lock D.

Third attempt: if key A does not open lock E, key B will fit, and key A will fit lock F.

If key A goes straight to lock D, one more attempt will be enough to find out which of the remaining keys matches which lock.

Answer: three attempts will be enough for the grandson. And if you're lucky, even two.

You can solve the problem differently.

First and second attempts: use key A to check the two locks in turn. If options D and E don't fit, F will definitely do.

Third attempt: use key B to check any of the two remaining locks. If it does not match lock D, it will go to F. The remaining key C will open the remaining lock.

Answer: three tries are still enough.

Show answer Hide answer

The original problem can be viewed.

Recommended: