Follow Tangyuan back to Weekly Puzzle

The Farmyard Puzzle (Heads and Legs!)

Some chickens and rabbits share Grandma's pen. Count the heads, count the legs — can you work out how many of each?

Welcome to Puzzle #1 of our weekly series — and we are starting with one of the most famous puzzles in the world. It comes from a Chinese math book, the Sunzi Suanjing, written about 1,500 years ago. There it starred 35 heads and 94 legs! Farmers everywhere have been scratching their heads over it ever since. Here we shrink the numbers — the thinking stays exactly the same.

The Puzzle

Grandma keeps some chickens and some rabbits in the same pen. Counting heads from above, there are 12 heads. Counting legs from below, there are 34 legs.

12 heads · 34 legs — how many chickens? How many rabbits?

Every animal is exactly one of these: a chicken has 2 legs, a rabbit has 4. No heads missing, no legs extra.

Think First, Peek Later

Don't rush to the answer. Stuck is fine — each hint you open takes you one step closer:

Hint 1: What if all 12 were chickens?
Then there would be 12 × 2 = 24 legs. But the pen really has 34 legs — where did the extra 34 − 24 = 10 legs come from?
Hint 2: Swap one chicken for one rabbit. What changes?
Heads stay at 12 — nothing changed there. But legs go up by 2. So the 10 extra legs were added 2 at a time: 10 ÷ 2 = ?
The full solution (think first, read after)

Method 1: Make a list

Start from "all chickens" and swap one rabbit in at a time. Every swap adds 2 legs, until we hit exactly 34:

ChickensRabbitsLegs
12024
9330
7534 ✓

Method 2: The lifting-legs trick

Imagine a whistle blows and every animal lifts 2 legs: each chicken plops down on the ground, while each rabbit still stands on 2 legs. The legs still touching the ground are 34 − 12 × 2 = 10 — and every one of them belongs to a rabbit.

34 − 12 × 2 = 10; 10 ÷ 2 = 5 rabbits; 12 − 5 = 7 chickens

Check

7 × 2 + 5 × 4 = 14 + 20 = 34 ✓ (heads: 7 + 5 = 12 ✓)

So the pen holds 7 chickens and 5 rabbits.

For Parents

The treasure here is not the answer — it is the idea of making an assumption: suppose everything is a chicken, then ask where the difference came from. It is often a child's first taste of thinking "algebra-style" before algebra has a name. Younger kids do great with the list method — careful trying-out is real mathematics; older kids can aim for the lifting-legs trick.

Solved it? Offer the original from the Sunzi Suanjing as a boss level — 35 heads and 94 legs. (Answer: 23 chickens and 12 rabbits.)

Liked it? Come back next week for Puzzle #2. To warm up first, try the free Multiplication Starter Course or play a practice round.

Follow Tangyuan back to Weekly Puzzle