Author |
Topic: Vending machine problem. (Read 1630 times) |
|
sateesp
Newbie
Gender:
Posts: 35
|
|
Vending machine problem.
« on: Feb 27th, 2010, 1:18am » |
Quote Modify
|
There is a one milk vending machine, which has three buttons. Each button has limits called min and max. These limits indicates that when you press that button , min and max milk that you can get. Given this information, how would you find, is it possible to get the milk in the range of given min and max by pressing any combination of vending machine 3 buttons.
|
|
IP Logged |
|
|
|
R
Senior Riddler
Addicted!!!
Gender:
Posts: 502
|
|
Re: Vending machine problem.
« Reply #1 on: Mar 5th, 2010, 9:00pm » |
Quote Modify
|
Can anyone explain clearly on what is being asked and what is given?
|
|
IP Logged |
The first experience seems like Magic, but the second tells you the Trick behind it.
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: Vending machine problem.
« Reply #2 on: Mar 6th, 2010, 3:37am » |
Quote Modify
|
If I had to guess, I'd say we are given intervals [a,b], [c,d], [e,f], and want to add them together in some way such that the resultant interval you get lies in [g,h]. So we want to find x,y,z such that xa+yc+ze >=g and xb+yd+zf <=h
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
Ant_Man
Newbie
Gender:
Posts: 23
|
|
Re: Vending machine problem.
« Reply #3 on: Mar 8th, 2010, 2:21pm » |
Quote Modify
|
I believe we just need g<=xa+yc+ze<=h or g<=xb+yd+zf<=h. He just wants to know if it is possible at all. It seems like the best strategy could potentially change after each button press, too.
|
« Last Edit: Mar 8th, 2010, 2:22pm by Ant_Man » |
IP Logged |
|
|
|
sateesp
Newbie
Gender:
Posts: 35
|
|
Re: Vending machine problem.
« Reply #4 on: Mar 17th, 2010, 10:01am » |
Quote Modify
|
That would be a brute force technique. Is there any better way to solve this ?
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: Vending machine problem.
« Reply #5 on: Mar 17th, 2010, 11:46am » |
Quote Modify
|
Let's first settle on what problem you want to solve. Is Ant_Man's interpretation correct, or mine?
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
sateesp
Newbie
Gender:
Posts: 35
|
|
Re: Vending machine problem.
« Reply #6 on: Mar 20th, 2010, 10:25pm » |
Quote Modify
|
Ant_Man's interpretation correct. we just need find the x,y, z such that it satisfies the following condition. g<=xa+yc+ze<=h or g<=xb+yd+zf<=h.
|
|
IP Logged |
|
|
|
|