An ATM stocks notes of only three denominations: ₹2,000, ₹500 and ₹100. At the start of a particular day it held 6 notes of ₹2,000, 14 notes of ₹500 and 25 notes of ₹100. It was not refilled during the day.
The ATM follows these rules for every request:
- A single request cannot exceed ₹10,000. A larger request is declined outright, and nothing is dispensed.
- Otherwise, the ATM first dispenses as many ₹2,000 notes as possible (without exceeding the amount requested and without exceeding its stock of ₹2,000 notes), then as many ₹500 notes as possible for the balance, and then ₹100 notes for whatever remains.
- If, after following the above procedure, the exact amount cannot be made up from the notes in stock, the request is declined and nothing is dispensed.
Eight customers, P1 to P8, used the ATM that day in the order given below. Each made exactly one request.
| Customer | P1 | P2 | P3 | P4 | P5 | P6 | P7 | P8 |
|---|---|---|---|---|---|---|---|---|
| Amount requested (₹) | 7,400 | 12,000 | 4,900 | 3,800 | 2,600 | 4,500 | 1,900 | 2,300 |
The ATM follows these rules for every request:
- A single request cannot exceed ₹10,000. A larger request is declined outright, and nothing is dispensed.
- Otherwise, the ATM first dispenses as many ₹2,000 notes as possible (without exceeding the amount requested and without exceeding its stock of ₹2,000 notes), then as many ₹500 notes as possible for the balance, and then ₹100 notes for whatever remains.
- If, after following the above procedure, the exact amount cannot be made up from the notes in stock, the request is declined and nothing is dispensed.
Eight customers, P1 to P8, used the ATM that day in the order given below. Each made exactly one request.
| Customer | P1 | P2 | P3 | P4 | P5 | P6 | P7 | P8 |
|---|---|---|---|---|---|---|---|---|
| Amount requested (₹) | 7,400 | 12,000 | 4,900 | 3,800 | 2,600 | 4,500 | 1,900 | 2,300 |
Question 1
Numerical answer
How many ₹500 notes did the ATM dispense in all during the day?
Show answer and solution
Answer: 14
Trace of the day (notes given as 2000/500/100; stock after the request):
| Customer | Request | Dispensed | Stock after |
|---|---|---|---|
| P1 | 7,400 | 3/2/4 | 3/12/21 |
| P2 | 12,000 | declined (limit) | 3/12/21 |
| P3 | 4,900 | 2/1/4 | 1/11/17 |
| P4 | 3,800 | 1/3/3 | 0/8/14 |
| P5 | 2,600 | 0/5/1 | 0/3/13 |
| P6 | 4,500 | declined (only ₹2,800 left) | 0/3/13 |
| P7 | 1,900 | 0/3/4 | 0/0/9 |
| P8 | 2,300 | declined (only ₹900 left) | 0/0/9 |
₹500 notes dispensed = 2 + 1 + 3 + 5 + 3 = 14 (the entire stock).
Tip: at each step apply the greedy rule strictly – e.g. P5 asks ₹2,600 when no ₹2,000 note is left, so the ATM gives five ₹500 notes and one ₹100 note.
| Customer | Request | Dispensed | Stock after |
|---|---|---|---|
| P1 | 7,400 | 3/2/4 | 3/12/21 |
| P2 | 12,000 | declined (limit) | 3/12/21 |
| P3 | 4,900 | 2/1/4 | 1/11/17 |
| P4 | 3,800 | 1/3/3 | 0/8/14 |
| P5 | 2,600 | 0/5/1 | 0/3/13 |
| P6 | 4,500 | declined (only ₹2,800 left) | 0/3/13 |
| P7 | 1,900 | 0/3/4 | 0/0/9 |
| P8 | 2,300 | declined (only ₹900 left) | 0/0/9 |
₹500 notes dispensed = 2 + 1 + 3 + 5 + 3 = 14 (the entire stock).
Tip: at each step apply the greedy rule strictly – e.g. P5 asks ₹2,600 when no ₹2,000 note is left, so the ATM gives five ₹500 notes and one ₹100 note.
Question 2
Single correct option
Which customer was the first to have a request declined because the ATM could not make up the exact amount?
- A. P2
- B. P5
- C. P6
- D. P8
Show answer and solution
Answer: (C) P6
Trace of the day (notes given as 2000/500/100; stock after the request):
| Customer | Request | Dispensed | Stock after |
|---|---|---|---|
| P1 | 7,400 | 3/2/4 | 3/12/21 |
| P2 | 12,000 | declined (limit) | 3/12/21 |
| P3 | 4,900 | 2/1/4 | 1/11/17 |
| P4 | 3,800 | 1/3/3 | 0/8/14 |
| P5 | 2,600 | 0/5/1 | 0/3/13 |
| P6 | 4,500 | declined (only ₹2,800 left) | 0/3/13 |
| P7 | 1,900 | 0/3/4 | 0/0/9 |
| P8 | 2,300 | declined (only ₹900 left) | 0/0/9 |
P2's request is declined only because it exceeds the ₹10,000 limit – not because of a shortage. The first shortage-based decline is P6: after P5, the ATM holds only 3 × ₹500 + 13 × ₹100 = ₹2,800, which is less than ₹4,500.
| Customer | Request | Dispensed | Stock after |
|---|---|---|---|
| P1 | 7,400 | 3/2/4 | 3/12/21 |
| P2 | 12,000 | declined (limit) | 3/12/21 |
| P3 | 4,900 | 2/1/4 | 1/11/17 |
| P4 | 3,800 | 1/3/3 | 0/8/14 |
| P5 | 2,600 | 0/5/1 | 0/3/13 |
| P6 | 4,500 | declined (only ₹2,800 left) | 0/3/13 |
| P7 | 1,900 | 0/3/4 | 0/0/9 |
| P8 | 2,300 | declined (only ₹900 left) | 0/0/9 |
P2's request is declined only because it exceeds the ₹10,000 limit – not because of a shortage. The first shortage-based decline is P6: after P5, the ATM holds only 3 × ₹500 + 13 × ₹100 = ₹2,800, which is less than ₹4,500.
Question 3
Single correct option
What amount of cash was left in the ATM at the end of the day?
- A. ₹1,300
- B. ₹900
- C. ₹2,800
- D. ₹0
Show answer and solution
Answer: (B) ₹900
Trace of the day (notes given as 2000/500/100; stock after the request):
| Customer | Request | Dispensed | Stock after |
|---|---|---|---|
| P1 | 7,400 | 3/2/4 | 3/12/21 |
| P2 | 12,000 | declined (limit) | 3/12/21 |
| P3 | 4,900 | 2/1/4 | 1/11/17 |
| P4 | 3,800 | 1/3/3 | 0/8/14 |
| P5 | 2,600 | 0/5/1 | 0/3/13 |
| P6 | 4,500 | declined (only ₹2,800 left) | 0/3/13 |
| P7 | 1,900 | 0/3/4 | 0/0/9 |
| P8 | 2,300 | declined (only ₹900 left) | 0/0/9 |
Opening cash = 6 × 2,000 + 14 × 500 + 25 × 100 = ₹21,500. Amount dispensed = 7,400 + 4,900 + 3,800 + 2,600 + 1,900 = ₹20,600. Cash left = ₹900 (nine ₹100 notes), which also explains why P8 was declined.
| Customer | Request | Dispensed | Stock after |
|---|---|---|---|
| P1 | 7,400 | 3/2/4 | 3/12/21 |
| P2 | 12,000 | declined (limit) | 3/12/21 |
| P3 | 4,900 | 2/1/4 | 1/11/17 |
| P4 | 3,800 | 1/3/3 | 0/8/14 |
| P5 | 2,600 | 0/5/1 | 0/3/13 |
| P6 | 4,500 | declined (only ₹2,800 left) | 0/3/13 |
| P7 | 1,900 | 0/3/4 | 0/0/9 |
| P8 | 2,300 | declined (only ₹900 left) | 0/0/9 |
Opening cash = 6 × 2,000 + 14 × 500 + 25 × 100 = ₹21,500. Amount dispensed = 7,400 + 4,900 + 3,800 + 2,600 + 1,900 = ₹20,600. Cash left = ₹900 (nine ₹100 notes), which also explains why P8 was declined.
Question 4
Numerical answer
Suppose P2 had requested ₹10,000 instead of ₹12,000, all other requests remaining the same. How many of the eight customers would then have had their requests declined?
Show answer and solution
Answer: 5
Re-run the rules with P2 = ₹10,000:
| Customer | Dispensed (2000/500/100) | Stock after |
|---|---|---|
| P1 7,400 | 3/2/4 | 3/12/21 |
| P2 10,000 | 3/8/0 | 0/4/21 |
| P3 4,900 | declined – only ₹4,100 left | 0/4/21 |
| P4 3,800 | 0/4/18 | 0/0/3 |
| P5 2,600 | declined | 0/0/3 |
| P6 4,500 | declined | 0/0/3 |
| P7 1,900 | declined | 0/0/3 |
| P8 2,300 | declined | 0/0/3 |
Declined: P3, P5, P6, P7, P8 → 5 customers.
Note how P4 is served (four ₹500s and eighteen ₹100s) even though P3 before him was declined – each request is judged on the stock at that moment.
| Customer | Dispensed (2000/500/100) | Stock after |
|---|---|---|
| P1 7,400 | 3/2/4 | 3/12/21 |
| P2 10,000 | 3/8/0 | 0/4/21 |
| P3 4,900 | declined – only ₹4,100 left | 0/4/21 |
| P4 3,800 | 0/4/18 | 0/0/3 |
| P5 2,600 | declined | 0/0/3 |
| P6 4,500 | declined | 0/0/3 |
| P7 1,900 | declined | 0/0/3 |
| P8 2,300 | declined | 0/0/3 |
Declined: P3, P5, P6, P7, P8 → 5 customers.
Note how P4 is served (four ₹500s and eighteen ₹100s) even though P3 before him was declined – each request is judged on the stock at that moment.
Saved on this device. Sign in or create a free account to keep it on every device.