The Vending Machine Puzzle


Question 1: The Tantalus Vending Machine Model Four accepts up to 4 coins for payment. Since the same vending machine is used in many countries, it is programmable. The owner can teach the machine to recognize the size and value of any set of coins.

The owner of a campground buys a Tantalus Four, planning to fill it with items the campers might want after he's closed his store. To avoid headaches about theft, he decides that he will sell poker chips to the campers for use in the machine, and train the vending machine that different color poker chips represent different values.

He first imagines selling red, green, blue and yellow poker chips, assigned the values of 1, 2, 3 and 4 cents. This way, he can charge every possible value between 1 and 16 cents. He can't sell anything for 17 cents, since no more than 4 coins can be used at a time.

Then he realizes that if he simply increases the value of the yellow poker chip to 5 cents, he can still form every value between 1 and 16 cents, but he can also make the nice round figure of 20 cents too. In fact, he can also make 17 and 18 cents, but now he realizes that he can't make 19. So the first price he's missing is 19. After adjusting the values a little, he was able to get all the prices to 20, and a bit beyond.

There's still a lot of slack in this system. How high can you go if you choose values for the chips carefully? Remember, your "score" is the value of the lowest unattainable price.


Question 2: One day, a user, trying to cheat the machine, jams a slug into one slot. The slug cannot be removed, and now the machine only accepts three coins at a time. The camp owner continues to use all four color poker chips as coins. But he discovers that, with his current set of values, he can't even charge 15 cents. Can you come up with a valuation of the four poker chip colors that will increase the attainable price range when only three can be used at a time?


I give up, show me the solution.


Last revised on 24 June 2005.