Image courtesy Google Images, original painting by Leslie Stones.

Here is a typical problem from a generic math competition: *Farmer Brown has pigs and hens in a pen. If he sees \(12\) heads and \(38\) legs, then how many pigs are in then pen?*

We've all been taught how to do this in school. Let \(h\) be the number of hens, and let \(p\) be the number of pigs. We see that we have the following system: \[\left\{\begin{array}{l}h+p=12 \\ 2h+4p=38\end{array}\right.\]

Then we'd maybe divide the second equation in half to get \(h+2p=19\), subtract the first from this new equation to get \(p=7\), and we'd be done. Same ol' same ol'.

However, if you have ever been to a math competition before, you have probably seen some people do these problems. Just after giving out the number of hens and pigs, they can immediately give out an answer, before you can even write out the system. How do they do it? Do they memorize? Is there some sort of formula?

If you have ever thought these thoughts before, then you're in luck; today, I will be talking about shortcuts in solving these linear systems.

**Step 1:** Assume there are only pigs, or only hens. Well, let's assume there are only hens. Since there are \(12\) heads, there will be \(24\) legs. However, we've fallen short! This is where the trick comes.

**Step 2:** Calculate how many *more* legs would be there if instead of a hen, there was a pig. This is simple; since before, there will be \(2\) legs, and after, there will be \(4\) legs, there is a \(2\)-leg increase.

**Step 3:** Calculate how much of this increase we need. Since we want \(38\) legs, and we only have \(24\), we need \(38-24=14\) more legs.

**Step 4:** Solve. Since replacing one hen with one pig will give us \(2\) more legs, we need to replace \(14\div 2=7\) hens with \(7\) pigs to increase the amount of legs by \(14\). We are done now; there are \(7\) pigs, and \(12-7=5\) hens.

You may think that this is a lot more work than just setting up the system of equations and solving like that, but try it yourself. You'll be surprised by how fast you can do it with practice.

Before we dive into the details, here is a practice problem for you: *A dark attic houses spiders and flies. If there are \(10\) heads and \(76\) legs in the attic, how many spiders are inside?*

Let's look at the system of equations again: \[\left\{\begin{array}{l}h+p=12 \\ 2h+4p=38\end{array}\right.\] What did we do? Well, at first, we assumed that all the animals were hens. We can represent this by pretending that the pigs had two legs: \[\left\{\begin{array}{l}h+p=12 \\ 2h+2p=??\end{array}\right.\] We can see that \(24\) should replace the \(??\). This corresponds to our first step.

Now obviously, \(24\ne38\), so we have to continue solving. What did we in step \(2\)? Well, we calculated how many more legs we needed. So why not do the calculation now: \[\begin{array}{lr}& 2h+4p=38\\ - & 2h+2p=24\\ \hline & 2p=14\end{array}\]

Aha! We can see that the \(2\) corresponds to how many more legs per switch, and the \(14\) corresponds to how many more legs we need. Now that we are done with step \(2\) and \(3\), we get get on with step \(4\), which should be obvious now.

We simply divide by \(2\) from both sides to get \(p=7\), and we are done rigor-fying our procedure.

This procedure, when shown mathematically, seems no simpler than the classic elimination procedure, but the real power comes when this trick is put into play. Before you know it, you'll have mastered this trick and people will be asking **you** why you're so good at math.

**PROBLEMS**

**1. ** On the planet Boorg, there are three-armed inhabitants and five-armed inhabitants (one head per inhabitant as usual). If in a house there are \(11\) heads and \(41\) arms, then how many five-armed inhabitants are there? How about three-armed inhabitants?

**2. ** I have some \(3\) cent stamps and some \(5\) cent stamps. If I have a total of \(18\) stamps and \(68\) cents, then how many \(5\) cent stamps do I have? How many \(3\) cent stamps?

**3. ** There are some more spiders and flies in an attic. If there are \(12\)
heads and \(70\) legs, how many flies are there? Did the trick work? Why or why not?

**4. ** Why is it easier to calculate how much of the thing with the larger amount of whatever they have, let it be cents, arms, or legs, than the the thing with the smaller amount? In other words, why is it easier to calculate how many \(5\) cent stamps there are than \(3\) cent stamps?

**5. ** Write your own problem of this type, and then solve it yourself using this tactic in two different ways.

## Comments

Sort by:

TopNewestThanks for reading my 4th #CosinesGroup post. This time it's about a neat trick for solving certain types of linear equations. I feel that this came out very well, but of course feedback is still--and always will be--appreciated. If you have any questions, feel free to ask.

Thanks,

Daniel – Daniel Liu · 2 years, 10 months ago

Log in to reply

– Peng Ying Tan · 2 years, 10 months ago

Great. My teacher had taught this technique before, but Daniel's explanation is very clear. Easy to understand. Looking forward to your next post! :-)Log in to reply

– Bob Krueger · 2 years, 10 months ago

I love it Daniel. Thinking about a standard problem with more problem solving techniques than rote mathematics. Always appreciated.Log in to reply

I guess that is kind of my style: to expose the simple and elegant solutions to mathematics.

One time in math class, I was arguing with a fellow classmate on if math can be elegant. He strongly disapproved of that notion, saying things like "saying math is elegant is like saying an elephant is skinny". But I do believe in the elegance of mathematics; and I plan on showing this to the rest of the world.

Linear systems may be one of the most routine, monotonous and boring tasks for any Algebra student; however, there exists an elegance to many systems. For example, this system: \[\left\{\begin{array}{l}a+b=1\\ b+c=2\\a+c=3\end{array}\right.\]

I hope with posts like these, more people will understand that math isn't just about memorization and computation. There is more to math than that. – Daniel Liu · 2 years, 10 months ago

Log in to reply

I'd also like to have a word with your classmate. ;) – Mursalin Habib · 2 years, 10 months ago

Log in to reply

– Happy Melodies · 2 years, 10 months ago

Agree! Thank you for the interesting post! :) I did this method for my math tests in the past too ! :)Log in to reply

– Ravi Ranjan · 2 years, 3 months ago

yeah,i have a question.What do sin(theta) and cos(theta) mean in trignometry?Log in to reply

Great post! Liked it. While trying to solve your "spider-fly" problem, I discovered the fact that I am not sure about how many legs does a fly have....HAHA – Aiman Rafeed · 2 years, 10 months ago

Log in to reply

Oops, I typoed... The questions should be solvable now. – Daniel Liu · 2 years, 10 months ago

Log in to reply

Log in to reply

*solutions. – Akshat Jain · 2 years, 10 months agoLog in to reply

– Queen Ang3l · 2 years, 10 months ago

are you Alex?Log in to reply

– Daniel Liu · 2 years, 10 months ago

He's minimario. Never discloses his real name...Log in to reply

How does the attic problem work? At a minimum considering all creatures are flies you get total legs[min] \(60=10*6\). But there are only 50 legs. How is this possible? – Yash Talekar · 2 years, 10 months ago

Log in to reply

– Yash Talekar · 2 years, 10 months ago

Spiders have \(8\) legs.Log in to reply

– Daniel Liu · 2 years, 10 months ago

Sorry. fixed. Thanks for bringing this up to my attention.Log in to reply

When twice the no.of heads is subtracted from no.of legs we get twice the no.of pigs..Because., if x=no.of hens,y=no.of pigs Then no.of legs -twice the no.of heads = (2x+4y) - (2x+2y) =2y=twice the no.of pigs. So we can get no.of pigs,, by subtracting it from no.of heads we can get the no.of hens.

When heads are 12 and legs are 38 , no.of pigs=(38 - 24)/2=14/2=7, no.of hens=12-7=5 – Komma Patali · 2 years, 3 months ago

Log in to reply

Awesome trick :) I enjoyed it, although, like Aiman Rafeed, I didn't know how many legs were in a fly.... \[\boxed{6 \text{ legs...}}\] – Kevin Mo · 2 years, 9 months ago

Log in to reply

Daniel Liu, great! You, as to my observation, are one of the best post-writers on Brill. I am surely looking forward to your upcoming posts and your brilliant idea of "Elegance of Math". – Akshat Jain · 2 years, 10 months ago

Log in to reply

Daniel, it's a great one. But I think there'a typo in the' practice problem' possibly in the figures. – Bhargav Das · 2 years, 10 months ago

Log in to reply

– Daniel Liu · 2 years, 10 months ago

Yep, fixed.Log in to reply