The Chinese Farmer's Riddle comes from the tradition of well-told problems: a simple framework, a clear difficulty and a solution that seems almost obvious when it has already been seen.

The Chinese Farmer's Riddle

Riddle statement

A farmer buys 100 animals for exactly 100 coins.

  • Each buffalo costs 10 coins.
  • Each pig costs 3 coins.
  • Each chicken costs 1/2 coin.

How many animals of each type can he buy?

Show solution

Solution

Answer: 5 buffaloes, 1 pig and 94 chickens.

Approach:

Let $b$ be the number of buffaloes, $c$ the number of pigs and $p$ the number of chickens. The conditions of the problem give two equations:

$b + c + p = 100$
$10b + 3c + 0.5p = 100$

Multiplying the second by 2 to eliminate decimals:

$20b + 6c + p = 200$

Subtracting the first equation from this:

$19b + 5c = 100$

As $b$ and $c$ must be positive integers, the possible values of $b$ are very limited. The only integer solution with $b \geq 1$ and $c \geq 1$ is $b = 5$, $c = 1$, whence $p = 94$.

Verification:

$5 + 1 + 94 = 100 \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\text{ animales}$
$5 \times 10 + 1 \times 3 + 94 \times 0.5 = 50 + 3 + 47 = 100 \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\text{ monedas}$