Chicken & Rabbits โ€” Heads and Legs Puzzle

A classic olympiad story problem. Learn two fast methods and try the interactive solver.

The Puzzle

On a farm there are only chickens and rabbits. You count the heads and the legs. Using this information, can you find how many chickens and how many rabbits there are?

Teacher tip: reinforce the facts โ€” every animal has one head; chickens have two legs; rabbits have four legs.

Quick Facts

Head 1 per animal

Chicken 2 legs

Rabbit 4 legs

Heads = H, Legs = L. Feasible only if L is even and 2H โ‰ค L โ‰ค 4H.

Method 1 โ€” Algebra

Let c be the number of chickens and r be the number of rabbits. Then c + r = H and 2c + 4r = L. Solving gives r = (L โˆ’ 2H) รท 2 and c = H โˆ’ r.

Feasibility Checks

  • L must be even.
  • 2H โ‰ค L โ‰ค 4H.
  • c and r must be whole numbers.

Method 2 โ€” Leg Swap Trick

Imagine all H animals are chickens. That gives 2H legs. You need L legs in total, so you are short by L โˆ’ 2H legs. Each time you swap a chicken for a rabbit, legs increase by 2. So the number of rabbits is (L โˆ’ 2H) รท 2. The rest are chickens.

This method is fast under time pressure and avoids solving equations explicitly.

Interactive Solver

Enter
Try H = 35, L = 94.

Worked Example

Example: H = 35 heads and L = 94 legs. Rabbits r = (94 โˆ’ 2ร—35) รท 2 = (94 โˆ’ 70) รท 2 = 24 รท 2 = 12. Chickens c = 35 โˆ’ 12 = 23.

Check

  • Heads: 23 + 12 = 35 โœ“
  • Legs: 2ร—23 + 4ร—12 = 46 + 48 = 94 โœ“

Pitfalls & Quick Checks

  • If L is odd, impossible.
  • If L < 2H, not enough legs (some animal would have fewer than 2 legs).
  • If L > 4H, too many legs (more than 4 per animal on average).
  • Watch units: H is heads count, L is legs count.

Practice โ€” Warm Up

  • H=20, L=56
    Answerr=(56โˆ’40)/2=8, c=20โˆ’8=12
  • H=18, L=44
    Answerr=(44โˆ’36)/2=4, c=14
  • H=30, L=76
    Answerr=(76โˆ’60)/2=8, c=22
  • H=12, L=28
    Answerr=2, c=10
  • H=25, L=70
    Answerr=(70โˆ’50)/2=10, c=15

Practice โ€” Olympiad Style

  • At a fair, there are only chickens and rabbits in a pen. There are 48 heads and 136 legs. How many of each?
    Showr=(136โˆ’96)/2=20, c=28
  • A farm has 60 animals. At least 10 are rabbits and at least 20 are chickens. If legs total 176, find (c,r).
    Showr=(176โˆ’120)/2=28 โ‡’ c=32 (fits both bounds)
  • Generalize: with animals having a and b legs, with a<b, show r=(Lโˆ’aH)/(bโˆ’a).
    HintSet c+r=H and ac+br=L then solve.

Quick Reference

Formulas: r = (L โˆ’ 2H) รท 2, c = H โˆ’ r. Conditions: L even and 2H โ‰ค L โ‰ค 4H.