Related Articles

# Puzzle | (When will the sheep be safe )

• Difficulty Level : Hard
• Last Updated : 02 May, 2019

There is an island with infinite grass and vegetation. The island is inhabited by 1 sheep and n lions . The lions can survive by eating the sheep or vegetation, but they prefer to eat the sheep .

The catch is that, when a lion eats the sheep, it gets converted into a sheep itself and then can in turn be eaten by other lions. The lions want to eat the sheep, but not at the risk of being eaten themselves.

What is the number n for which the sheep will be safe?
Hint: A lion will eat a sheep, only if there is no chance of it being eaten by any other lion when it is converted into a sheep.

Solution:

1. In case, when there is only 1 lion then the lion eats the sheep, it becomes the sheep itself and there are no lions to eat it. Therefore, in this case, the sheep is not safe.
2. If there are 2 lions then if either of the two lions eat the sheep, it will get converted into a sheep and there will still be a lion left ( same as the previous case ). This lion would then eat the new sheep and become a sheep itself. So, in this case, neither of the two lions would eat the sheep and the sheep would be safe.
3. If there are 3 lions, then, if any one of the three lions eat the sheep, it will get converted into a sheep and there will be 2 lions left ( same as the previous case ). We know from previous case that this is a stable state where neither of the two remaining lions eat the sheep. Therefore, in this scenario, one of the lions will definitely eat the sheep and the sheep is not safe.
4. If there are 4 lions, then, if any one of the three lions eat the sheep, it will get converted into a sheep and there will be 3 lions left (same as previous case ). We know from previous case that this the lion which ate the sheep will itself be eaten. Therefore, no lion would eat the sheep and the sheep would be safe.

Similarly, it can be seen that, for every case where n is odd, the sheep would be in danger and for every case where n is even, the sheep would be safe.

Therefore, for sheep to be safe, the value of n should be any even number.

Reference:

1. The Great Book of Puzzles

This article is contributed by Mrigendra Singh. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.