solve this problem with diophantine equation

246 Views Asked by At

A man arrives in a bank to cash a cheque. for some stated amount. The teller on the counter makes a mistake and interchanges dollars and cents. I donated 5 cents to a charity box at the bank. Later, I realized that I have exactly double the money I asked for. What was the amount for I wrote the check? Hint: Form a diophantine equation

4

There are 4 best solutions below

1
On

Well if you start off with $x$ dollars and $y$ cents, then you actually have $100x+y$ cents. However, the teller exchanged the two so now you have $x+100y$ cents. You also donated $5$ so you actually have $x+100y-5$ cents. This is double than what we started with, so $$2(100x+y)=x+100y-5\\200x+2y=x+100y-5\\199x-98y+5=0\\x=(98y-5)/199.$$ Remember that $y$ has to be between $0$ and $99$, inclusive.

0
On

Suppose you wrote for x dollars and y cents. You can write your total money as $100x+y$ cents.

Can you write expression for money you have now? Then subtract 5 cents and equate to twice the money you had?

What condition you have on cents?

y<100

0
On

Let $x$ be the correct number of cents, and $y$ be the wrong number of cents that the teller gave. Then,

$$y-5 = 2x$$

Or rewritting, we have

$$2x+y = 5$$

Now, this is just your regular linear diophantine equation, with the added constraint that both variables must be positive.

Of course, you have to consider the smallest size of a note for $y$.

1
On

-5=199(-165)-98 (-335)
5=199(165)-98 (335) where x^* = 165 and y^* = 335
where x=165+( 98)t y= 335+199t

Put t=2 x=165+98 (2)= 165+196 =361 y=335+199 t =335+199(2)= 335+398=733 check the equation to put the values 199(361)-98(733)= 71839-71834=5