# An algebra teacher drove by a farmyard full of chickens and pigs. The teacher happened to notice that there were a total of 100 heads and 270 legs. How many chickens were there? How many pigs were there?

Jan 31, 2017

There were $65$ chickens and $35$ pigs in the farmyard.

#### Explanation:

We shall represent the chickens as $x$ and the pigs as $y$. From the data of heads and feet, we can write two equations:

$x + y = 100$, since each have one head.
$2 x + 4 y = 270$, since chickens have two legs and pigs have four.

From the first equation we can determine a value for $x$.

$x + y = 100$

Subtract $y$ from each side.

$x = 100 - y$

In the second equation, substitute $x$ with $\textcolor{red}{\left(100 - y\right)}$.

$2 x + 4 y = 270$

$2 \textcolor{red}{\left(100 - y\right)} + 4 y = 270$

Open the brackets and simplify.

$200 - 2 y + 4 y = 270$

$200 + 2 y = 270$

Subtract $200$ from each side.

$2 y = 70$

Divide both sides by $2$.

$y = 35$, the number of pigs.

In the first equation, substitute $y$ with $\textcolor{b l u e}{35}$.

$x + y = 100$

$x + \textcolor{b l u e}{35} = 100$

Subtract $35$ from each side.

$x = 65$, the number of chickens.

Jan 31, 2017

There were $65$ chickens and $35$ pigs in the farmyard.

#### Explanation:

We shall represent the chickens as $x$ and the pigs as $y$. From the data of heads and feet, we can write two equations:

$x + y = 100$, since each have one head.
$2 x + 4 y = 270$, since chickens have two legs and pigs have four.

From the first equation we can determine a value for $x$.

$x + y = 100$

Subtract $y$ from each side.

$x = 100 - y$

In the second equation, substitute $x$ with $\textcolor{red}{\left(100 - y\right)}$.

$2 x + 4 y = 270$

$2 \textcolor{red}{\left(100 - y\right)} + 4 y = 270$

Open the brackets and simplify.

$200 - 2 y + 4 y = 270$

$200 + 2 y = 270$

Subtract $200$ from each side.

$2 y = 70$

Divide both sides by $2$.

$y = 35$, the number of pigs.

In the first equation, substitute $y$ with $\textcolor{b l u e}{35}$.

$x + y = 100$

$x + \textcolor{b l u e}{35} = 100$

Subtract $35$ from each side.

$x = 65$, the number of chickens.