My friend has in his wallet some notes of $\displaystyle{ 20 }$ , $\displaystyle{ 50 }$ and $\displaystyle{ 100 }$ euros. He has $\displaystyle{ 15 }$ notes and the total value of them is $\displaystyle{ 690 }$ euros. Tell me the amount of $\displaystyle{ 20 }$ , $\displaystyle{ 50 }$ and $\displaystyle{ 100 }$ euros he has in his wallet.
My solution:
$\displaystyle{ 20x+50y+100z=690 \Leftrightarrow 2x+5y+10z=69 (1) }$
$\displaystyle{ x+y+z=15 (2) }$
$\displaystyle{ x,y,z> 0 }$
$\displaystyle{ y\equiv 1 mod 2 }$ and $\displaystyle{ 5\cdot14=70 > 69 }$ so $\displaystyle{ y< 14 }$.
Then, $\displaystyle{ y=1,3,5,7,9,11,13 }$.
Also $\displaystyle{ x\equiv 2 mod 5 }$. Then, $\displaystyle{ x=2,7,12 }$.
We also have that $\displaystyle{ 10\cdot7=70 >69 }$, so $\displaystyle{ z<7 }$.
From the equation $\displaystyle{ (2) }$ we get that $\displaystyle{ (x,y) = (7,9) , (7,11) , (7,13) , (12,5) , (12,7), (12,9), (12,11), (12,13) }$ are rejected. We know that $\displaystyle{ z<7 }$, so $\displaystyle{(x,y) = (2,1), (2,3), (2,5), (7,1) }$ are rejected, too.
So I check every $\displaystyle{ (x,y) = (2,7) , (2,9), (2,11), (2,13)}$ (rejected because $\displaystyle{z=0}$ ) ,$\displaystyle{(7,3), (7,5), (7,7), (12,1), (12,3)}$ (rejected because $\displaystyle{z=0}$ ) to find out which ones are ok with equations $\displaystyle{ (1) , (2) }$. The final answer is : $\displaystyle{ x=7, y=5, z=3 }$.
My question:
How can I find the solution using parameters? Thanks!
Subtracting equation (2) from equation (1) twice yields $$3y+7z=39.$$ Since $y$ and $z$ are positive integers, there is precisely one solution which is quickly found.