Tiger and Sheep
Table of Contents
A Practical Guide To Quantitative Finance Interviews 收录了一些量化面试中的经典题目. 本文介绍的是来自第二章的「Tiger and Sheep」.
Tiger and Sheep #
Problem #
One hundred tigers and one sheep are put on a magic island that only has grass. Tigers can eat grass, but they would rather eat sheep. Assume:
- A. Each time only one tiger caneat one sheep, and that tiger itself will become a sheep after it eats the sheep.
- B. All tigers are smart and perfectly rational and they want to survive.
So will the sheep be eaten?
Solution #
如果 $k$ 只老虎的情况, 羊会被吃, 那么 $k + 1$ 只老虎的情况下羊不会被吃; 如果 $k$ 只老虎的情况, 羊不会被吃, 那么 $k + 1$ 只老虎的情况下羊会被吃; 因此 $100$ 只老虎的情况与 $1$ 只老虎的情况相反. 显然后一种情况下羊会被吃, 因此 $100$ 只老虎的情况下羊不会被吃.