Buying dogs and Cats and mice

71 Views Asked by At

This problem is only considering positive integer solutions: You must spend exactly 100 and purchase exactly 100 animals. Each dog costs 15 and each cat costs 1 and each mouse costs .25. How many of each must be purchase? At least one animal of each must be bought.

1

There are 1 best solutions below

0
On BEST ANSWER

As per the statement of the problem,

$$100 = 15 qty_{dogs} + qty_{cats} + 0.25 (100 - qty_{dogs} - qty_{cats}) = 25 + 14.75 qty_{dogs} + 0.75 qty_{cats}$$

Thus

\begin{eqnarray} \frac{59}{3} qty_{dogs} + qty_{cats} &=& 100 \\ qty_{mice} &=& 100 - qty_{dogs} - qty_{cats} \end{eqnarray}

Since both $qty_{dogs}$ and $qty_{cats}$ are between $0$ and $100$ and integer, the first equation only allows two possibilities for the number of dogs: either $0$ or $3$ (it needs to de dividable by 3; 6 dogs would mean that there is a negative number of cats).

Using both equations, we deduce that we have either $100$ cats or $3$ dogs, $41$ cats and $56$ mice.

If we need to purchase at least one dog, than the only solution is $3$ dogs, $41$ cats and $56$ mice.

Please let me know if you have any questions.