So I was again scrolling through the homepage of Youtube when I came across this video by Cipher, which proposes the following question:$$\text{A farmer buys }120\text{ head of livestock for }8000\text{ dollars.}$$$$\text{Horses cost }100\text{ dollars each, cows }60\text{ dollars each, and a sheep }30\text{ dollars each.}$$$$\text{If the farmer buys at least one animal of each type and buys more horses than cows,}$$$$\text{what is the least number of sheep the farmer can buy?}$$While I was able to solve it (somewhat), I am not sure if the solution that I got is correct or if there is an easier way that I would be able to solve it.
My attempt at solving it
Setting up the system of equations to solve the equation
Here is what I know
A sheep can be bought at the price of $30$ dollars, a cow at $60$ dollars, and a horse at $100$ dollars. We also know that the total number of animals bought is $120$, and that the total cost is exactly $8000$ dollars, no more, no less. We also know that the number of cows bought is less than the number of horses bought, and that at least one animal of each type was bought. The system of equations can be visualized as:$$30s+60c+100h=8000$$$$s+c+h=120$$$$1\leq c\leq h-1$$$$1\leq c\lt h$$$$1\leq s$$$$\{c\lt h\}$$$$\text{ (What this does in Desmos is if }c\text{ is less than }h\text{ it returns a value of }1\text{, otherwise it returns a value of undefined}$$$$\text{As how the mod notation would be inputted into Desmos}$$
$$\operatorname{mod}(8000-30s,100h+60c)=0$$
$$\text{As how the mod notation would be represented usually}$$
$$8000-30s\pmod{100h+60c}=0$$But I'm pretty sure it's fine either way.
I actually wasn't able to make a whole lot of progress on my own, since Desmos, while it is great for creating sliders (and putting limits on the sliders) and for variable affecting large amounts of equations at once, it isn't really great for solving it otherwise, as while sometimes I was able to get the number of animals to add up to $120$, I wasn't really able to find any real way to get the remainder to equal $0$ or get the total cost to $120$. I actually got really desperate and plugged$$30s+60c+100h=8000$$$$s+c+h=120$$into Wolfram Alpha and got$$c=7n+2$$$$h=62-3n$$$$s=56-4n$$$$n\in\mathbb{Z}$$However, for this equation, I had to put the restriction that$$n\geq0$$Since $n$ cannot be a negative number, since plugging in $-1$ for $n$ gets us$$s=60$$$$h=65$$$$c=-5$$Which is not a possible solution. Now, all we need to do is plug in numbers for $n$ to find the minimum value for $s$ that is possible:
| $n$ | $s$ | $h$ | $c$ |
|---|---|---|---|
| $0$ | $56$ | $62$ | $2$ |
| $1$ | $52$ | $59$ | $9$ |
| $2$ | $48$ | $56$ | $16$ |
| $3$ | $44$ | $53$ | $23$ |
| $4$ | $40$ | $50$ | $30$ |
| $5$ | $36$ | $47$ | $37$ |
So far, so good! But what happens if we plug in $6$ for $n$?
| $n$ | $s$ | $h$ | $c$ |
|---|---|---|---|
| $6$ | $32$ | $44$ | $44$ |
The problem with this is, even if we add $3$ horses and subtract $5$ sheep from our current total, even though all of the other previous conditions will be satisfied, we will only have $32+47+39=118$ animals, which fails to satisfy the requirement of having a total of $120$ animals, no more, no less.
The original equations:
The equations substituting $47$ for $h$ and $39$ for $c$:
Therefore, the minimum number of sheep that the farmer could buy is $36$
My question
Is there anything that I could have done to achieve the solution to the problem without having to use Desmos/Wolfram Alpha? If so, what could I have done?


You could solve the system for $h$ and $c$, and get $$h = \frac{3}{4} s + 20 \\ c = 100 - \frac{7}{4} s $$
So $s$ is a multiple of $4$. Moreover $\frac{3}{4} s + 20> 100- \frac{7}{4} s$ so $\frac{10}{4} s > 80$. Maybe $s=36$ ?