Problema Solution

Solve the following problem twice-

1. by substitution and by elimination

Farmer Red had 12 animals in his barnyard, all either cows or ducks. If the animals had a total of 38 legs, how many were cows and how many were ducks?

Answer provided by our tutors

Let


x = number of cows

y = number of ducks


number of cows + number of ducks = total number of animals


x + y =12


since every cow has 4 legs and every duck has 2 legs we have:


4*x + 2*y = 38


Lets solve the system


x + y =12

4*x + 2*y = 38


1) by substitution


from x + y =12 we can write x = 12 - y and substitute in the second equation


4*(12 - y) + 2*y = 38


48 - 4*y + 2*y = 38


-2*y = 38 - 48


-2*y = - 10 multiply both sides by (-1)


2*y = 10


y = 10/2


y = 5 ducks


x = 12 - y = 12 - 5 = 7 cows


2) by elimination


x + y =12

4*x + 2*y = 38


Multiply both sides of first equation by (-2) and add it to the second


-2x - 2*y = - 24

4*x + 2*y = 38

-------------------

-2x - 2y + 4x + 2y = - 24 + 38


-2x + 4x = 14


2x = 14


x = 7 cows


y = 12 - x = 17 - 7 = 5 ducks


There are 7 cows and 5 ducks in the barnyard.