problem with GCD/Euclidean algorithm

364 Views Asked by At

This problem is in a chapter on the Greatest Common Divisor: The Euclidean Algorithm. Apparently I managed to arrive at one of the 3 possible solutions.

Problem goes 'man at a casino wins \$1020 in \$20 and 50 \$chips. if he has more \$50 than \$20 chips, how many chips of each denomination could he possibly have?'

To solve the problem I tried:

$$\gcd(20,50) = 10$$

so $20x + 50y = 10$

$$20(3) + 50(-1) = 10$$

so $20(306 - 50k) + 50(-102 + 20k) = 1020$

solved for $k$: must be $5.1\le k \le 6.12$ so one solution is if $k=6$ then $x=6$, $y=18$. (this is one of the solutions). there are two other solutions provided. not sure how to arrive at those. thanks.

2

There are 2 best solutions below

0
On BEST ANSWER

Hint $\ $ By linearity, the general solution of $\ 20x + 50y = n\ $ arises by adding to a particular solution the general solution of the associated homogeneous equation $\ 20x + 50 y = 0.\ $ This equation has solution $\, (x,y) = (5n,-2n)\,$ so the other two solutions to your problem arise from adding and subtracting $\,(5,-2)\,$ to the solution $\,(6,18),\,$ yielding $\,(11,16),\ (1,20).\ $ Further addition makes $\, x > y,\,$ and further subtraction makes $\,y < 0,\,$ so these are all the solutions in the sought range.

0
On

$50x+20y = 1020 \implies 5x+2y = 102$. Take $\pmod 2 \implies x = 2k$. Then $5k+y = 51$. Take $\pmod 5$ so $y = 5j+1$. Then $k+j = 10$ which parameterizes all solutions. Then just pick the ones based on your restrictions.