Solve the Puzzle: Find the Check Amount

  • Thread starter Thread starter musicgold
  • Start date Start date
  • Tags Tags
    Puzzle
AI Thread Summary
The puzzle involves a man who mistakenly receives dollars for cents and vice versa when cashing a check, and after spending a nickel, he finds he has twice the amount of the check. The key equation derived is 100y + x - 5 = 2(100x + y), leading to y = (199x + 5) / 98. Attempts to solve this using trial and error and plotting have been discussed, with suggestions to use MATLAB or Excel for quicker calculations. The solution found is $31.63, and the discussion touches on the relevance of the GCD in the context of linear Diophantine equations. The conversation emphasizes the importance of integer solutions for x and y in solving the problem.
musicgold
Messages
303
Reaction score
19

Homework Statement


I am trying to solve the following puzzle. The problem is that there are two unknowns and I could come up with only one equation.

A man went into a bank to cash a check. In handing over the money the cashier, by mistake, gave him dollars for cents and cents for dollars. He pocketed the money without examining it, and spent a nickel ( 5 cents) on his way home. He then found that he possessed exactly twice the amount of the check. He had no money in his pocket before going to the bank. What was the exact amount of that check?

Homework Equations


Let x - number of dollars and y - number of cents
check amount - ## 100x + y ##
paid amount - ##100y + x ##
amount left after spending a nickel - ## 100y + x - 5 ##

So the first equation we get is:
## 100y + x - 5 = 2 (100x + y) ##

After solving it, we get
## y = \frac { 199x + 5 } { 98} ##

The Attempt at a Solution


As there is not enough info for another equation, I tried the trial and error approach. To get a whole number the numerator has to be a multiple of 98. To have an even number in the numerator, x has to be an odd number.

I tried using a few values of x but didn't get an answer. I am not sure if I am headed in the right direction. Is there a better way of doing this?

Thanks.
 
  • Like
Likes Delta2
Physics news on Phys.org
Have you tried to plot it and remember that both x and y must be integers?
 
musicgold said:

Homework Statement


I am trying to solve the following puzzle. The problem is that there are two unknowns and I could come up with only one equation.

A man went into a bank to cash a check. In handing over the money the cashier, by mistake, gave him dollars for cents and cents for dollars. He pocketed the money without examining it, and spent a nickel ( 5 cents) on his way home. He then found that he possessed exactly twice the amount of the check. He had no money in his pocket before going to the bank. What was the exact amount of that check?

Homework Equations


Let x - number of dollars and y - number of cents
check amount - ## 100x + y ##
paid amount - ##100y + x ##
amount left after spending a nickel - ## 100y + x - 5 ##

So the first equation we get is:
## 100y + x - 5 = 2 (100x + y) ##

After solving it, we get
## y = \frac { 199x + 5 } { 98} ##

The Attempt at a Solution


As there is not enough info for another equation, I tried the trial and error approach. To get a whole number the numerator has to be a multiple of 98. To have an even number in the numerator, x has to be an odd number.

I tried using a few values of x but didn't get an answer. I am not sure if I am headed in the right direction. Is there a better way of doing this?

Thanks.
You also have ## x = \frac{98 y - 5}{199}##.
 
Last edited:
  • Like
Likes jedishrfu
jedishrfu said:
Have you tried to plot it and remember that both x and y must be integers?
I tried plotting the equation using Winplot but it is hard to locate a pair that satisfies the equation.
 
musicgold said:
I tried plotting the equation using Winplot but it is hard to locate a pair that satisfies the equation.

##199## is a prime number. Does that help?
 
This is a linear diophantine equation because the x and y must be integers and they are related in a linear way.

https://en.wikipedia.org/wiki/Diophantine_equation

I did find a solution using a MATLAB clone (freemat.org) and you'll need to try solutions of x from 5 to 99 to find the corresponding y which can be done via google in the search bar. The MATLAB approach was faster because of its builtin vector calculating.

I'm not sure of any other way to solve it.
 
jedishrfu said:
This is a linear diophantine equation because the x and y must be integers and they are related in a linear way.

https://en.wikipedia.org/wiki/Diophantine_equation

I did find a solution using a MATLAB clone (freemat.org) and you'll need to try solutions of x from 5 to 99.

I'm not sure of any other way to solve it.

The fact that 199 is prime helps! But, I'm not sure how much for a pre-calc question.
 
This may be overkill for this problem but then again what is life for if not for learning new things:

https://en.wikipedia.org/wiki/Kuṭṭaka

Reduction of the problem
Aryabhata and other Indian writers had noted the following property of the linear Diophantine equations: "The linear Diophantine equation ax + by = c has a solution if and only if gcd(a, b) is a divisor of c." So the first stage in the pulverization process is to cancel out the common factor gcd(a, b) from a, b and c, and obtain an equation with smaller coefficients in which the coefficients of x and y are relatively prime.

For example, Bhaskara I observes: "The dividend and the divisor shall become prime to each other, on being divided by the residue of their mutual division. The operation of the pulveriser should be considered in relation to them."[1]
 
musicgold said:
I tried plotting the equation using Winplot but it is hard to locate a pair that satisfies the equation.

There is an elementary solution. Hint: consider the two cases where ##y < 50## and ##y \ge 50##.

Your equations are correct, but if you start again, there's a quicker way with this approach.

PS to keep things simple, assume he did have a nickel in change. I.e. ##x \ge 5##.
 
  • #10
You can also quickly brute force it with Excel.
 
  • #11
musicgold said:
## y = \frac { 199x + 5 } { 98} ##
.
If you rewrite that as ## y = 2x + \frac { 3x + 5 } { 98} ##, isn't a solution obvious?
 
  • Like
Likes musicgold, SammyS and TSny
  • #12
haruspex said:
If you rewrite that as ## y = 2x + \frac { 3x + 5 } { 98} ##, isn't a solution obvious?
Oh...got it. Thanks.

$31.63.
 
  • #13
Jedishfru,

The solution (31, 63) doesn't seem to follow that GCD rule. Am I missing something?
 
  • #14
musicgold said:
Jedishfru,

The solution (31, 63) doesn't seem to follow that GCD rule. Am I missing something?
Applying the GCD rule to the equation you ended up with in post #1, it says the gcd of 199 and 98 must be a factor of 5. Since 199 and 98 are coprime, the gcd is 1, so it is trivially true and not useful here.
Likewise, applying it to the answer, 31 and 63 are coprime, so, again, it just says 1 divides 5.
 
Back
Top