I have a real life problem that math may be able to solve. I am no mathematician so if you have any insight please use the simplified version. This problem is way beyond me. My gut tells me there is an answer but I'm not really sure. Here is the simplified version in word problem form:
A coffee dispenser holds 10 cups of coffee. There are five buttons on the dispenser that give the option of dispensing .2, .3, .5, .7 and 1 cup of coffee. When the coffee dispenser is almost out it does not have the ability to distinguish how much coffee it has left. Meaning if there is .5 cup of coffee left in the dispenser and someone presses the .7 button than .5 cup of coffee will be dispensed. The goal is to make the dispenser stop dispensing when there is less than the desired amount in the dispenser. So if there is .5 left and the .7 button is pressed than nothing will come out. But if the .3 button is pressed .3 will be dispensed leaving .2 left in the dispenser.
There is a 1 cup excess chamber installed in the dispenser so that every time coffee is dispensed a certain amount is either stored in the excess chamber from the main chamber or expelled out of the excess chamber into the main chamber (coffee can only be dispensed to the customer from the main chamber not the excess chamber). How would you calculate how much would need to be stored or expelled in/from the excess chamber EACH time coffee is dispensed (this would also likely be different for each amount and would be cumulative) so that when there is less than 1 cup left the amounts (buttons) chosen by the customer that are more than the amount left would not be dispensed because the remaining coffee would be in the excess chamber and the amounts chosen that are less than or equal to the amount left would be available to dispense because that amount would be left in the main chamber? So if there is .3 cup left in the whole dispenser and the .5 button was pressed nothing would come out because all .3 would be in the excess chamber but if .2 was pressed than .2 would be in the main chamber and would be dispensed while .1 would be in the excess chamber.
I was thinking that every time coffee was dispensed a certain amount would be put in or taken from the excess chamber so that by the time there is less than any of the options available those options wouldn't work because the coffee would be in the excess chamber while pressing an option equal to the exact amount in the dispenser or less would be released in the main chamber and would dispense.
I tried to be as clear as possible. Let me know if you have any questions. Thanks for the help.