A bank has an ATM machine. For a particular week, the usage of cash in millions as below.
- 5- Monday
- 4- Tuesday
- 1- Wednesday
- 15- Thursday
- 6- Friday
- 2- Saturday
- 4- Sunday
The bank hires a depositing company to deposit money in 5, 3, or 1 rounds per week.
The depositing company provides following packages to the bank when charging for depositing money,
Cost for depositing in 4 rounds per month- 21135
Cost for depositing in 12 rounds per month- 32000
Cost for depositing in 20 rounds per month- 41975
Ordering remains as Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday. This order shouldn’t be violated when categorizing values.
Example
- 5 rounds
[(5+4),1, 15, 6, (2+4)]
[(5+4), 1, (15+6)=20+1, 2, 4]
can have many other combinations which don't break order.
- 3 rounds
[(5+4+1), 15, (6+2+4)]
[(5+4), (1+15), (6+2+4)]
can have many other combinations which don't break order.
- 1 round
[(5+4+1+15+6+2+4)]
Also the bank has to bear a holding cost of 0.019% of the remaining amount at the end of the day.
Example
Consider 1st week usage of cash as follows.( in millions)
Mon- 13
Tue- 5
Wed- 4
Thu- 4
Fri- 2
Sat- 11
Sun- 1
5 - rounds
1st week Cash depositing order - 13, (5+4), 4, (2+11), 1
Assuming depositing is done in 5 rounds for all 4 weeks of the month, (5*4 = 20)
Total depositing cost = 41975
1- 13 deposited, 13 withdrawn, 0 remaining, 0 holding cost
2- (5+4) deposited, 5 withdrawn, 4 remaining, 4*0.00019 holding cost
3- 0 deposited, 4 withdrawn, 0 remaining, 0 holding cost
4- 4 deposited, 4 withdrawn, 0 remaining, 0 holding cost
5- (2+11) deposited, 2 withdrawn, 11 remaining, 11*0.00019 holding cost
6- 0 deposited, 11 withdrawn, 0 remaining, 0 holding cost
7- 1 deposited, 1 withdrawn, 0 remaining, 0 holding cost
Total holding cost for 1st week = 4*0.00019 + 11*0.00019 = 0.00285 millions= 2850
Likewise I need to find the total holding cost for the month considering each particular week.
3- rounds
Cash depositing order for 1st week - 13, (5+4+4), (2+11+1)=(1+1+12)
Edit- Assuming 12 rounds per month package is choosen, therefore 3 rounds per week( 3*4 =12)
Total depositing cost = 32000
1 - 13 deposited, 13 withdrawn, 0 remaining, 0 holding cost
2- (5+4+4) deposited, 5 withdrawn, (4+4) remaining, (4+4)*0.00019 holding cost
3- 0 deposited, 4 withdrawn, 4 remaining, 4*0.00019 holding cost
4- 0 deposited, 4 withdrawn, 0 remaining, 0 holding cost
5- (2+11+1) deposited, 2 withdrawn, (11+1) remaining, (11+1)*0.00019 holding cost
6- 0 deposited, 11 withdrawn, 1 remaining, 1*0.00019 holding cost
7- 0 deposited, 1 withdrawn, 0 remaining, 0 holding cost
Total holding cost for 1st week = (4+4)*0.00019 + 4*0.00019 + (11+1)*0.00019 + 1*0.00019 = 0.00475 millions = 4750
Likewise I need to find the total holding cost for the month considering each week.
Edit - suppose the 41975 package is picked. Then it means cash deposited in 20 rounds per month. That means 5 rounds per week. If the 32000 package is picked, then 12 rounds per month. That means 3 rounds per week. If the 21135 package is picked, then it means for 4 rounds per month, that means 1 round per week. There are no mixed combinations of 5,3,1 for the four weeks of a particular month. Only all four weeks are done in 1, 3 or 5 rounds. We have to select the best package considering holding cost and package cost.
A good combination of 5 rounds which doesn't violate order, can be better than all the 3 rounds solutions and the 1 round solution. Same applies for 3 rounds solution aswell. Or else 1 round solution can be better than all 5 rounds and 3 rounds solutions.
When depositing rounds increase, holding cost reduces but depositing cost increases. When rounds decrease, depositing cost reduces but holding cost increases. So I need to find the order of depositing money for each week of the month and the monthly depositing package which can make a good tradeoff between total holding cost and total depositing cost, consuming the least time.
Any insight to the approach will be really helpful.