Friday, December 08, 2006

confused bank teller

A confused bank teller transposed the dollars and cents when he cashed a check for Ms Smith, giving her dollars instead of cents and cents instead of dollars. After buying a newspaper for 50 cents, Ms Smith noticed that she had left exactly three times as much as the original check. What was the amount of the check? (Note: 1 dollar = 100 cents.)

Solution to puzzle : Confused bank teller
Solution by Diophantine Equation
Let x be the number of dollars in the check, and y be the number of cents.Then 100y + x - 50 = 3(100x + y).Therefore 97y - 299x = 50.
A standard solution to this type of Diophantine equation uses the Euclidean algorithm.
The steps of the Euclidean algorithm for calculating the greatest common divisor (gcd) of 97 and 299 are as follows:
299 = 3 × 97 + 8
97 = 12 × 8 + 1
This shows that gcd(97,299) = 1.
To solve 97y - 299x = gcd(97,299) = 1, we can proceed backwards, retracing the steps of the algorithm as follows:
1
= 97 - 8 × 12

= 97 - (299 - 3 × 97) × 12

= 37 × 97 - 12 × 299
Therefore a solution to 97y - 299x = 1 is y = 37, x = 12.Hence a solution to 97y - 299x = 50 is y = 50 × 37 = 1850, x = 50 × 12 = 600.It can be shown that all integer solutions of 97y - 299x = 50 are of the form y = 1850 + 299k, x = 600 + 97k, where k is any integer.
In this case, because x and y must be between 0 and 99, we choose k = -6.This gives y = 56, x = 18.So the check was for $18.56.

No comments: