Cows and Chickens: Solving Systems with Two Unknowns
A farmer has cows and chickens. Cows have 4 legs, and chickens have 2 legs. The farmer counts 20 animals in total and 56 legs. How many cows and chickens are there?
What You Will Learn
- Setting up systems of equations from word constraints
- Using substitution to solve two-variable systems
- Recognizing when real-world problems require integer solutions
- Checking solutions by substituting back into original constraints
- Building algebraic models for counting problems with multiple categories
Solution: Method 1 — The Substitution Approach
The key insight is that we have two constraints: a count constraint (total animals) and a property constraint (total legs). Each constraint gives us one equation, and we need exactly two equations to solve for two unknowns.
Step 1 — Define variables clearly
Let c = number of cows and h = number of chickens. I'm using h for chickens to avoid confusion with the variable c for cows.
Step 2 — Write the count equation
Total animals: cows + chickens = 20
Step 3 — Write the legs equation
Each cow contributes 4 legs, each chicken contributes 2 legs, and the total is 56 legs:
Step 4 — Solve the first equation for one variable
From c + h = 20, we get:
Step 5 — Substitute into the legs equation
Replace h with 20 - c in the legs equation:
Step 6 — Find the number of chickens
Now that we know c = 8, we can find h:
Solution: Method 2 — The "All Chickens" Mental Model
Sometimes it's easier to think about extreme cases first. What if all 20 animals were chickens? Then what would need to change?
Step 1 — Imagine all animals are chickens
If all 20 animals were chickens, each with 2 legs, we'd have:
But we actually have 56 legs, so we have:
Step 2 — Account for the extra legs
The extra legs come from having cows instead of chickens. Each time we replace a chicken (2 legs) with a cow (4 legs), we gain:
Step 3 — Find how many replacements we need
To get 16 extra legs, we need:
So we have 8 cows and 20 - 8 = 12 chickens.
Verification
Let's check both constraints with our answer of 8 cows and 12 chickens:
Animal count check:
Leg count check:
Both constraints are satisfied, so our answer is correct.
Watch Out For These
Some students write
h for cows and c for chickens, then get confused when setting up the legs equation. Always write down what each variable represents before starting.
Writing
2c + 4h = 56 instead of 4c + 2h = 56. Remember: cows have 4 legs, so the coefficient of c (cows) should be 4.
If your algebra gives you something like "6.5 cows," that's a signal to check your work. You cannot have half an animal in this context.
How to Spot This Problem Type
These are the telltale signs that you're looking at a classic "animal legs" or similar counting problem:
- "Total count" combined with "total of a property" — animals + legs, coins + value, people + ages
- Two different types of objects with different "rates" (legs per animal, cents per coin, etc.)
- Phrases like "in total," "altogether," "combined"
- The numbers usually work out to nice integers — real-world problems don't typically give fractional animals
You'll also see this same mathematical structure in problems about:
- Coins (quarters worth 25¢, dimes worth 10¢)
- Tickets (adult tickets $12, child tickets $8)
- Test questions (2-point and 5-point problems)
The Pattern Behind This
The general structure for any two-category counting problem is:
Where a and b are the "rates" for each category (legs per animal, value per coin, etc.). The solution is always:
For our problem: a = 4 (cow legs), b = 2 (chicken legs), total count = 20, total property = 56
A Brief History
This type of problem appears in ancient mathematical texts from China, India, and Greece. The Chinese Nine Chapters on the Mathematical Art (circa 100 CE) includes problems about counting animals and objects with different properties. Medieval European mathematicians called these "false position" problems because they often used guessing strategies before algebra was fully developed.
The reason these problems persist in modern curricula isn't just tradition — they perfectly illustrate how real-world constraints translate into algebraic systems. The "counting" structure appears everywhere: inventory management, resource allocation, and even DNA sequencing algorithms in bioinformatics.
Four "What-If?" Problems
Let h = horses and d = ducks
h + d = 18 (total animals)
4h + 2d = 58 (total legs)
From equation 1: d = 18 - h
Substitute: 4h + 2(18 - h) = 58
4h + 36 - 2h = 58
2h = 22
h = 11
d = 18 - 11 = 7
Count: 11 + 7 = 18 ✓
Legs: 44 + 14 = 58 ✓
11 horses and 7 ducks
Let c = cows, h = chickens, p = pigs
Given constraint: h = c (equal numbers of chickens and cows)
c + h + p = 25 (total animals)
4c + 2h + 4p = 84 (total legs)
Since h = c, substitute in both equations:
c + c + p = 25 → 2c + p = 25
4c + 2c + 4p = 84 → 6c + 4p = 84
From the first: p = 25 - 2c
Substitute: 6c + 4(25 - 2c) = 84
6c + 100 - 8c = 84
-2c = -16, so c = 8
c = 8 cows
h = c = 8 chickens
p = 25 - 2(8) = 9 pigs
8 cows, 8 chickens, and 9 pigs
Let c = number of cows and h = number of chickens
Given: h = c + 4 (4 more chickens than cows)
Total legs: 4c + 2h = 52
Replace h with c + 4:
4c + 2(c + 4) = 52
4c + 2c + 8 = 52
6c = 44
c = 7.33...
Since we can't have fractional animals, let's check our setup. Actually, let me try c = 7 and c = 8:
If c = 7: h = 11, legs = 28 + 22 = 50
If c = 8: h = 12, legs = 32 + 24 = 56
We need exactly 52 legs, which is between these values. But since we need whole animals, this problem as stated has no solution with integer animals.
The closest would be 7 cows and 11 chickens (50 legs) or adjust the problem constraints.
Let c = number of double-headed cows and h = number of chickens
Each double-headed cow contributes 2 heads and 4 legs
Each chicken contributes 1 head and 2 legs
Total heads: 2c + 1h = 28
Total legs: 4c + 2h = 60
Divide the legs equation by 2: 2c + h = 30
From the simplified legs equation: h = 30 - 2c
Substitute into heads equation: 2c + (30 - 2c) = 28
2c + 30 - 2c = 28
30 = 28 — This is impossible!
Let me check: if heads equation is 2c + h = 28 and simplified legs is 2c + h = 30, these are contradictory.
Let me solve differently: From heads: h = 28 - 2c
Into original legs: 4c + 2(28 - 2c) = 60
4c + 56 - 4c = 60 gives 56 = 60
This problem has no solution — the constraints are inconsistent. The ratio of heads to legs doesn't work out for any combination of these animals.
Frequently Asked Questions
Create one equation for the total count and one for the total legs. For cows (c) and chickens (h): c + h = 20 animals, and 4c + 2h = 56 legs. The coefficients match each animal's leg count.
Use the substitution method: solve one equation for a variable, then substitute into the other. From c + h = 20, we get h = 20 - c. Substituting into 4c + 2h = 56 gives 4c + 2(20 - c) = 56, which simplifies to solve for c.
You cannot have fractional animals in real life. If your algebra gives non-whole numbers, check your setup or arithmetic. These problems are designed so the constraints (total animals and total legs) are consistent and yield integer solutions.
2026-09-16