Need to understand how to solve the following question:
You have 50 coins that add up to 1 dollar. What are the possible combinations of pennys, nickels, dimes, and quarters that will satisfy these limits?
P + N + D + Q = 50
.01P + .05N + .10D + .25Q = $1
I know the answers are available online, but I want to know how I would go about solving it. Any suggestions?
multiply the second equation by $100$, and substract first from second. you get $$4N+9D+24Q=50$$ So, for $Q$ , you have three choises. $0$,$1$, or $2$.
if $Q=2$ then $4N+9D=2$ this is impossible.
if $Q=1$ then $4N+9D=26$, $D$ must be $2$mod $4$. trying $D=2$ we get $N=2$ and $P=45$
if $Q=0$ then $4N+9D=50$. again $D$ must be $2$mod $4$. trying $D=2$ we get $N=8$ so $P=40$. we cant choose $D=6$ because then $N$ is negative. so solution is $$\begin{matrix} P & N & D & Q \\ 45 & 2 & 2 & 1 \\ 40 & 8 & 2 & 0 \\ \end{matrix}$$