Open In App

Puzzle – Bank Cashier Mistake

Last Updated : 24 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

You went to a bank to cash your check. The bank clerk accidentally gives you: The dollar amount is in cents, and the Cent amount is in dollars. You spend 5 cents on the way home, and then you realize you have twice the amount of your cheque. What was the actual amount that was written on the cheque?

Puzzle – Bank Cashier Mistake

Solution:

Note: 1 Dollar contains 100 cents.

Let’s assume the number of dollars is x and the number of cents is y in the cheque before visiting the bank. If 1 dollar is equal to 100 cents, then x dollars will be equal to [100*x cents]. Therefore, the total amount of money before visiting the bank is [100*x + y (cents)].

After having cashed your check, it is given that the bank clerk exchanges the units of money, but the amount of money remains the same. Therefore, on observing, 

  • If initially, we had x dollars, then the x dollars become x cents, and similarly, 
  • If initially, we had y cents, then y cents become y dollars. Now, therefore, since 1 dollar = 100 cents,  y dollars = 100 * y cents. So, now after visiting the bank, we had, 100*y +x (cents).

Solution part 1

Now it is mentioned that from this amount of money, you spent 5 cents from it, and after spending it the money left becomes equal to twice the amount initially, you had in check before visiting the bank i.e., 100*x +y cents.

So, we have,

x + 100*y – 5 = 2*(100*x + y) – Amount taken from the cashier – 5 cents which you spend while going home is equal to twice the amount of money you had in your check before going to the bank.

Solution part 2

Simplifying the above equation: 

x+ 100*y -5 = 200*x + 2*y, or, 199*x+5=98*y, or, (199*x+5)/98=y

Since y is the amount in cents so it can’t exceed 99 because in the real world if cents exceed 99 then it can be considered that the total amount may have some number of dollars and some number of cents, but we had assumed y to be purely in cents so this may contradict our assumption.

Let us assume we have 143 cents which is greater than 99. Now we know that 1 dollar=100 cents, therefore, we have to convert it into dollars (the above equation should be satisfied). 

  • On converting we get 1 dollar and 43 cents (dollar = (total cents)/100 (floor division) and cents = (total cents) %100). 
  • On taking further examples we can see we can reduce our search space to [1 – 99] cents as cents will always lie between the range of 1 and 99. So, we try to apply the hit and trial method by finding the value of y which is less than 100 [Y < 100], and satisfy the equation.

Therefore, taking, x = 31, for the above equation,  we have,

 199*(31) + 5 = 6174 and on dividing it by 98 i.e. (6174/98) we get 63 which is in the range of [1 – 99], therefore, is our final answer.

Therefore, we get x = 31 and y = 63, by the above calculations. Therefore, initially, we had 31 dollars and 63 cents respectively.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads