Solving Simultaneous Equations - Algebra A store sold $213$ bicycles during the year $2002$. For the first few months they sold $20$ bicycles per month, then for some months they sold $16$ bicycles per month and in the remaining month(s) they sold $25$ bicycles per month. For how many months did they sell only $16$ bicycles per month?
I have formulated two equations. First,
$$ 
20x+16y+25z=213 
$$
and secondly, 
$$
x+y+z=12
$$
where $x,y$ and $z$ are in months. However, these are not enough to solve the question and I need one more equation to solve. Please check the above equations and explain how to solve.
I have seen a solution where the answers are  $x=3$ months,  $y=8$ months and  $z= 1$ month. I do not know how this was attained and also if this is correct.
 A: You have two equations and three unknowns as you say so it is apparent that you need a third equation to solve your problem. However the condition of integer for the solution can be used as a substitute for the missing third equation. 
From your two equations you can eliminate ,say, $z$ so you get the equation
$$5x+9y=87$$ whose general solution is given by
$$x=3+9t\\y=8-5t$$ For the value $t=0$ of the parameter you get the good solution you has writen and infinitely many more solutions for other integer values of $t$.
A: Augmented matrix of the given equation system is
$$\begin{bmatrix}1&1&1&12\\20&16&25&213\end{bmatrix}$$
with RREF
$$\begin{bmatrix}1&0&\frac{9}{4}&\frac{21}{4}\\0&1&-\frac{5}{4}&\frac{27}{4}\end{bmatrix}$$
So, the solution of this system is
$$\begin{aligned}
x&=\frac{21-9t}{4}\\
y&=\frac{27+5t}{4}\\
z&=t
\end{aligned}$$
where $t$ is a parameter.
Since $x$ and $z$ are natural number, there are only 2 possible value of $t$, i.e. $t=1$ or $t=2$. But, only for $t=1$, we get a natural number solution for $y$. That is
$$y=\frac{27+5\cdot1}{4}=8$$
Hence, the answer is 8 months.
A: Reiterating my hint above, $20$ and $25$ are both multiples of $5$, but neither $16$ nor $213$ are multiples of $5$.
In math-heavy terms, we can go from $20x+16y+25z=213$ to $20x+16y+25z\equiv 213\pmod{5}$.  Now, simplifying, $y\equiv 3\pmod{5}$ meaning that $y\in\{\dots,-2,3,8,13,\dots\}$.
I suspect that you might not have seen this notation before, so think of it this way.  Imagine for a moment that the bikes cost $\$1$ each and imagine that each month, all of the sales are done by a single person and that person prefers using $\$5$ and $\$10$ dollar bills whenever possible.  That is to say, in the first few months the person buys twenty bikes using two $\$10$ bills, the next few months he buys sixteen bikes for one $\$10$, one $\$5$ and one $\$1$ dollar bill, and the last few months he buys using two $\$10$'s and one $\$5$.
Now, at the end of the year, we look at all of the money that was spent and we see that we have $\$213$ in the safe.  Clearly, some of those bills must be $\$1$'s.  Most of the rest will be $\$10$'s and others will be $\$5$'s, but we are interested in the $\$1$'s specifically.  Since the only time we were given $\$1$'s was in those middle months, if we can figure out how many $\$1$'s were used that directly tells us the number of months where we sold $16$ bikes.
So... if our total was $\$213$, that means that either there are three $\$1$ bills, or eight $\$1$ bills, or thirteen $\$1$ bills or ...  but remember, this all happened in only one year, so we have narrowed it down to being either three or eight $\$1$ bills.

Now, suppose for a moment that it was the case that $y=3$.  That means that every other month we sold at least $20$ bikes, possibly more.  If we were to look at that possiblity more closely, that would mean that the total number of bikes would at least $3\cdot 16 + 9\cdot 20$, possibly more, but $3\cdot 16 + 9\cdot 20 = 228$ which is too many.
So, we've learned that it must be the case that $y=8$
Now, you should be able to continue using techniques that you are familiar with, you are left with two equations and two unknowns.
A: You have extra constraints: $x,y,z$ are nonzero integers, hence in the range $[1,10]$.
After elimination of $z$,
$$9y=87-5x.$$
Thus $87-5x$ must be a multiple of $9$ which ends either in $7$ or $2$ and lies between $82$ and $37$. Only $\color{green}{y=8}$ can work, and it does with $x=3$.
Caution: we must not forget to check the value of $z$, which happens to be $1$. Fine.
