A friend just had an interview in a top investment bank technology division. The hiring manager asked him to solve the tigers and sheep puzzle.
The Tigers and Sheep puzzle is a classic interview-style logic problem often used to test structured reasoning under uncertainty.
The puzzle is:
There are tigers and sheep locked together.The rules are as follows
Let’s solve this puzzle.
If , there’s 1 tiger and 1 sheep. The tiger eats the sheep. It turns into a sheep, but there are no other tigers left to eat it. It survives, well-fed. Outcome: Sheep gets eaten.
Now, . Two tigers, one sheep. Tiger A knows that if it eats the sheep, Tiger A becomes a sheep. That transforms the state into —which we just proved is a guaranteed death sentence for the remaining sheep. Because Tiger B is completely rational, Tiger B will eat Tiger A. Knowing this, Tiger A refuses to eat the initial sheep. Tiger B won’t either. Outcome: Sheep lives.
Look at . Three tigers, one sheep. If Tiger A eats the sheep, it turns into a sheep, reducing the state to tigers and 1 sheep. But we just established that in an scenario, no tiger dares to eat the sheep. Therefore, Tiger A can eat the sheep with total impunity, knowing the remaining two tigers will enter a stalemate. Outcome: Sheep gets eaten.
It alternates based on parity.
- (Odd): Sheep is eaten.
- (Even): Sheep lives.
- (Odd): Sheep is eaten.
- (Even): Sheep lives.
If is odd, the tiger that eats the sheep turns the game into an even number of tigers, which is a stable, safe state where no one attacks. So an odd number of tigers always leads to the sheep being eaten by the quickest tiger.
If is even, eating the sheep transitions the system into an odd number of tigers, which is unstable and results in the new sheep being eaten. Since survival is priority number one, no rational tiger makes the first move. Therefore, for —an even number—the system remains in a permanent deadlock. The sheep lives.