3 variable diophantine equation word problem: coins

601 Views Asked by At

When Mr. Smith returned from Europe in 1966, he found that he had in his possession 35 British sixpence coins, 55 French ten-centime pieces, and 77 Greek drachmas. Mr. Smith converted each of these coins to its value in American money (rounded off to the nearest cent) and found that the total was worth $5.86. How much was each coin worth in 1966 (to the nearest cent)?

I started by setting up the equation 35B+55F+77G=586, but I was not sure how to solve a three-variable diophantine equation.

2

There are 2 best solutions below

5
On

This isn't generalized to other Diophantine equations but there is a pretty quick way to solve this: \begin{eqnarray} 35B+55F+77G&=&586\\ 8\cdot77=616&>&586 \rightarrow G < 8\\ 35B+55F+77G \rightarrow 2G&=&1\mod 5\rightarrow G=3\mod5 \\ 35B+55F+77\cdot 3&=&586 \rightarrow 35B+55F=355\\ 7B+11F&=&71\\ 4F&=&1 \mod7\rightarrow F=2\mod7\\ 11\cdot9&>&71\rightarrow F < 9\rightarrow F=2\\ 7B+22=71\rightarrow7B=49\rightarrow B&=&7\\ (B,F,G)&=&(7,2,3) \end{eqnarray}

0
On

The other answer is good. I just want to point out that this is a version of the Knapsack Problem, which is NP-Complete, meaning that most of the time, you won't be able to find a solution easily except for small numbers and tricks.