Is it possible to derive a natural solution to simultaneous equations without trial and error? I was reading a mathematics puzzle in a newspaper, and wondered if there was a way to solve it without brute forcing.
The puzzle goes like this: you need to find a number of items (at certain prices) such that the sum of the prices is equal to the sum of the quantities of items. One group of items is £4 per item, one £7 per item and one £0.75 per item. Both the sum of the prices and the total number of items sum to 89.
Hence, is it possible to solve these equations for all values without trial and error?
\begin{align*}
4x + 7y + 0.75z &= 89\\
x + y + z &= 89
\end{align*}
I have already solved $z$ as being $12x + 24y$, 
\begin{align*}
(4x + 7y + 0.75z = x + y + z) &= (3x + 6y + 0.75z = z)\\
&= (3x + 6y = 0.25z)\\
&= (12x + 24y = z)
\end{align*}
and I know that $3y - 3.25z = 267$,
$$4(x + y + z) + 3y - 3.25z = 89$$
and $13x + 25y$ is $89$, 
$$\text{if } (z = 12x + 24y) \text{ and } (x + y + z = 89), \text{ then } 89 = 13x + 25y$$
but I do not know where to go from here. Any help?
 A: So you have the right idea.  You get $89 = 13x + 25y$, and you know that $x$ and $y$ both need to be nonnegative integers.  This means that $y \le 89/25$, so if there are any solutions they'll have $y = 0, 1, 2$ or $3$.  You can easily check all of these to get $y = 2, x = 3$.  
If you really want no brute force at all, use the extended Euclidean algorithm (https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm) to find the solution.
Note that there's nothing guaranteeing there will be a solution in nonnegative integers.  If $89$ were replaced with $88$, i. e. you had 90 items summing to £88 in price, then you'd have $87 = 13x + 25y$.  Since 13 and 25 are relatively prime, by the extended Euclidean algorithm this has integer solutions.  But the solutions to this are of the form $(x, y) = (-1 + 25n, 4 - 13n)$ and no integer $n$ will make both $x$ and $y$ simultaneously positive.  (A disclaimer: I found that solution by brute force, because I can't do the extended Euclidean algorithm in my head.)
A: You've heard the expression "n equations, m unknowns"?
In general if you have $n $ linear equations and $n $ variables, you can find one set of solutions (assuming the equations aren't "dependent").  If you have $n $ variables but $m <n$ equations there are an infinite number of solutions and you can express them in terms of $n-m $ variables.
In this case you have 2 equations and 3 unknowns so there will be an infinite number of solutions.  And the can be expressed as: $x$ (or any vatiable) can be anything you want; $y$ will be have one specific value based on what you chose for $x$ and $z $ will have on specific value also based on $x$.
In this case: $y= \frac {89-13x}{25} $
And $z= 12x +\frac {24 (89-13x)}{25}
And that is as far as you can go.  If $x =0$ then $y=\frac {24}{25}89$ and $z=\frac {1}{25}89$.  That's an answer.  If $x=10$ then $y=-\frac {41}{25}89 $ and $z=120-\frac {24}{25}41*24$.  That's also an answer.
Now, if you want to assume further that x,y,z are nonnegative integers, you must assume $25|89-13x $  as there are only so many values of $x $ possible before $89-13x $ becomes negative we could try them all.  As we must have $13x=14,39,64,89$ it's easy to see $x=3;y=2;z=84$
For larger values we can solve using modulo arithmatic.  $13x\equiv 89 \mod 25$.
