A cat is hiding in one of the five boxes. The boxes are numbered one to five and are all sitting in a row, lined up in order. Each night, the sneaky little cat hides in an adjacent box, exactly one box away from the box it’s in during the day. Each morning, you can open exactly one box to see if the cat is in there. Can you say with certainty that you will find the cat ? How can you go about this hide and seek game to ensure you find the cat?
Yes, it is possible to ensure a victory in this hide and seek game. Since the cat always jumps into an adjacent box, you’ll know after opening the first box when the cat is in an odd or even numbered box.
First, consider the case when the cat started in an even numbered box, i.e., 2 or 4.
On day 1, check box numbered 2. If you find the cat, you win. Otherwise, the cat must have been in box numbered 4 (considering only for even number case). So, next day the cat will move to either box numbered 3 or 5.
On day 2, check box numbered 3. If you find the cat, you win. Otherwise, the cat must have moved to box numbered 5 and which means the cat can now only move to box numbered 4 on the next day. So, now we check box numbered 4 and we will certainly find the cat!
Now, let’s consider the case when the cat started in an odd numbered box, i.e., 1, 3 or 5.
Following the previous strategy, till day 4 cat would be in either box numbered 2 or 4 because:
On day 1, cat is in an odd numbered box 1 or 3 or 5.
On day 2, cat will be in an even numbered box 2 or 4.
On day 3, cat will again move to an odd numbered box.
And therefore on day 4, cat will be either in box numbered 2 or 4 again.
This situation is same as the previous case. We can follow the same strategy of checking boxes “2, 3 and then 4” and we will find the cat.
Hence, final solution is 2, 3, 4, 2, 3, 4
Other solution could be 2, 3, 4, 4, 3, 2
This puzzle can be extended for n boxes. And for more insights, check this video:
This article is contributed by Lakshya Sethi. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Puzzle 15 | (Camel and Banana Puzzle)
- Puzzle 24 | (10 Coins Puzzle)
- Puzzle 27 | (Hourglasses Puzzle)
- Puzzle 28 | (Newspaper Puzzle)
- Puzzle 29 | (Car Wheel Puzzle)
- Puzzle 31 | (Minimum cut Puzzle)
- Puzzle 33 | ( Rs 500 Note Puzzle )
- Puzzle 34 | (Prisoner and Policeman Puzzle)
- Puzzle 36 | (Matchstick Puzzle)
- Puzzle 38 | (Tic Tac Toe Puzzle)
- Puzzle 39 | (100 coins puzzle)
- Puzzle 51| Cheryl’s Birthday Puzzle and Solution
- Puzzle 81 | 100 people in a circle with gun puzzle
- Puzzle 85 | Chain Link Puzzle
- Puzzle | Elevator Puzzle
- Puzzle | 3 Priests and 3 devils Puzzle
- Puzzle | Man fell in well Puzzle
- Puzzle | Cat, Mice and 4 Boxes
- Puzzle 2 | (Find ages of daughters)
- Puzzle 8 | (Find the Jar with contaminated pills)