## SGU – Episode #410 – Who’s That Noisy?

**Question**

A bank teller made a mistake today. The teller switched the dollars and cents when they cashed a check for Mrs. Jones, giving her dollars instead of cents and cents instead of dollars.

After buying a newspaper for 5 cents, Mrs. Jones realized that she had remaining exactly twice as much as the original check.

**
**What was the amount of the original check?

**Answer**

Let original check be x dollars and y cents. So the money given is y dollars and x cents. Therefore:

100y + x – 5 = 2(100x + y)

So,

199x – 98y = -5

We require integer values of x and y that solve this equation (a Diophantine equation). Following the algorithm to solve a Diophantine equation:

199=2*98+3

98=32*3+2

3=1*2+1

2=2*1

1=3-1*2=3-1(98-32*3)=33*3-1*98=33(199-2*98)-1*98=33*199-66*98-1*98=33*199-67*98

(* denotes multiplication).

So, a=33 and b=67 solves the equation 199a-98b = 1. Multiplying both sides by -5, we get:

199(-5a)-98(-5b) = -5.

Hence, x = -5×33 = -165 and y = -5×67 = -335, solves the equation 199x – 98y = -5. However, these are not the only solutions. The general solution is given by:

x = -165+98n and y = -335+199n, where n is an integer.

Check:

199(-165+98n)-98(-335+199n) = -199*165+199x98n+98×335-98x199n = -199×165+98×335 = -5

We require a solution where both x and y are positive. The first solution of this kind occurs when n=2, giving:

x = -165+98*2 = 31 and y = -335+199*2 = 63.

Hence, the original check was 31$63c.

No trackbacks yet.