Linear Equation very basic question about number of animals in zoo.

319 Views Asked by At

A zookeeper was asked how many animals are there in the zoo. He replied that there are all lions but 5, all monkeys but 7, and all elephants but 4. How many animals are there?

2

There are 2 best solutions below

3
On

We obtain the equations $l+5 = m+7 = e+4 = l+m+e$.

From here we obtain $e = m+3$ and $l = m+2$. Substituting this into the right hand side we get $m+7 = m+3 + m + m+2 = 3m+5$, and so $m+7=3m+5$ gives $m=1$.

So there are $3m+5 = 8$ animals in total.

2
On

@auscrypt's solution assumes there are no other animals.

But maybe there's a penguin?

So I started with: $A= l+5 = m+7 = e+4 = l+m+e+o$

from $m+7 = e+4$ we get $e=m+3$ and from $l+5 = m+7$ we get $l=m+2$

Finally we take: $m+7 = l+m+e+o$ and plug in $e=m+3$ and $l=m+2$ :

$m+7 = m+2 + m + m+3 +o$

$m+7 = 3m+5 +o$

$7-5 = 2m+o$

$2 = 2m + o$ --> so, $m = 1 - o/2$

If $o = 0$, we get $m=1$, $l=3$, and $e=4$, giving total of $8$

If $o = 1$, we get half a monkey, which doesn't make sense.

If $o = 2$, we get $m=0$, $l=2$, and $e=3$, giving total of $7$, which is a valid solution: All but $7$ are monkeys ($7-0=7$). All but $5$ are lions ($7-2=5$). All but $4$ are elephants ($7-3=4$).

Assuming all numbers are positive integers, there are no other solutions.