Chicken-Rabbit Cage Solver: Formula and Interactive Model
Enter 4-18 heads and a valid leg count, then see the chicken-rabbit formula in a visual model. Includes four methods and a 10-head example.
The chicken-rabbit cage problem, also called Ji tu tong long or chickens and rabbits in the same cage, gives two facts:
- the total number of heads
- the total number of legs
The goal is to find how many chickens and how many rabbits are in the cage.
Have your own numbers? Open the interactive chicken-rabbit model and enter 4-18 heads plus an even leg count between twice and four times the heads. It shows the resulting mix and the extra-legs calculation. For larger numbers, use the general formula below.
The most useful version is:
A cage has 10 heads and 28 legs. How many chickens and rabbits are there?
Direct Formula
If every animal is either a chicken or a rabbit:
rabbits = (legs - 2 x heads) / 2
chickens = heads - rabbits
For 10 heads and 28 legs:
rabbits = (28 - 2 x 10) / 2
rabbits = (28 - 20) / 2
rabbits = 4
chickens = 10 - 4 = 6
So the answer is 4 rabbits and 6 chickens.
The interactive model can check this example and other valid inputs in its stated range. It is a visual aid; the formula works for any nonnegative whole-number solution with two-legged chickens and four-legged rabbits.
Method 1: Assumption Method
This is usually the cleanest method for elementary Olympiad problems.
Assume every head is a chicken. Since chickens have 2 legs, 10 heads would make:
10 x 2 = 20 legs
But the problem says there are 28 legs, so there are:
28 - 20 = 8 extra legs
Every rabbit has 2 extra legs compared with a chicken:
4 - 2 = 2
So the number of rabbits is:
8 / 2 = 4 rabbits
The remaining animals are chickens:
10 - 4 = 6 chickens
This method works because the head count stays fixed. You are only measuring how many 2-leg upgrades are needed.
Method 2: Equation Method
Let:
c= chickensr= rabbits
The head count gives:
c + r = 10
The leg count gives:
2c + 4r = 28
From the first equation:
c = 10 - r
Substitute into the leg equation:
2(10 - r) + 4r = 28
20 - 2r + 4r = 28
20 + 2r = 28
2r = 8
r = 4
Then:
c = 10 - 4 = 6
The equation method is the same reasoning as the assumption method, just written with symbols.
Method 3: Table Method
A table helps students who are not ready for equations.
| Chickens | Rabbits | Heads | Legs |
|---|---|---|---|
| 10 | 0 | 10 | 20 |
| 9 | 1 | 10 | 22 |
| 8 | 2 | 10 | 24 |
| 7 | 3 | 10 | 26 |
| 6 | 4 | 10 | 28 |
Each row swaps one chicken into one rabbit. The head count stays at 10, and the leg count increases by 2 each time.
The row with 28 legs is 6 chickens and 4 rabbits.
Method 4: Visual Swapping
Draw 10 animals as chickens first. That gives 20 legs.
Then swap one chicken into a rabbit:
20 -> 22 -> 24 -> 26 -> 28
It takes four swaps to reach 28 legs, so there are four rabbits. The other six animals stay chickens.
This is the method behind the interactive chicken-rabbit cage model.
Common Variations
More legs than heads allow
If the legs are too high, start from all chickens and add rabbits until the leg total matches.
Fewer legs than possible
If legs are less than 2 x heads, the problem has no solution because even all chickens would have too many legs.
Odd number of extra legs
If legs - 2 x heads is odd, the problem has no whole-number solution. Each rabbit adds exactly 2 extra legs.
Different animals
The same method works for any two types with different counts:
number of high-count animals =
(total count - low count x total items) / (high count - low count)
Chicken-rabbit is just the most famous version because the gap is easy:
4 legs - 2 legs = 2 extra legs
What to Practice Next
If this problem felt new, practice these related models:
- Chicken-Rabbit Cage Solver for visual swapping
- Sum-Difference-Multiple Bar Model for hidden quantities
- Groups Sharing Lab for equal-sharing structure
- Grade 4 multi-step word problems for Common Core practice
The goal is not to memorize one puzzle. The transferable move is: fix one quantity, compare the difference, then divide by the per-swap change.
Parents also ask
What is the fastest formula for the chicken-rabbit cage problem? +
Why do we divide the extra legs by 2? +
Can this problem be solved without algebra? +
Try the methodology yourself
See a sample thinking-trace report, or jump into a Grade 3 mission and produce your own.
More from the blog
- Math Resources
Lazy Math Guide PDF: General Mathematics UDFs v1.5
Download LazyMath's 64-page General Mathematics UDF Guide v1.5. Read the English PDF, find its subject coverage, and follow the TI-Nspire CAS setup links.
- Study Tool Reviews
Knowt vs Gizmo for Math Study: Import, Practice, Tutor and Export
Compare Knowt and Gizmo using their published help pages: what you can import, how free practice differs, what AI tutors do, and how to save a deck as PDF.
- Study Methods
Spaced Repetition Method for Math: A Review Plan You Can Use
Use spaced repetition for math facts without mistaking recall for understanding. Try a simple review calendar, worked examples, and a check for when to revisit a concept.