Broken Coffee Machine Puzzle: Expected Presses to Fill the Cup
Source: Mind Your Decisions Blog Related Problem: Expected Length of Last Straw - Breaking the back of a Camel - CSE Blog Problem: Your boss tells you to bring him a cup of coffee from the company vending machine. The problem is the machine is broken. When you press the button for a drink, it will randomly fill a percentage of the cup (between 0 and 100 percent). You know you need to bring a full cup back to your boss. What’s the expected number of times you will have to fill the cup? Example: The machine fills the cup 10 percent, then 30 percent, then 80 percent–>the cup is full plus 20 percent that you throw away or drink yourself. It took 3 fills of the cup. Solution: Highlight the part between the * symbols for the answer. * Answer: e = 2.71828... fills. Let X_i be the fraction dispensed on press i (uniform on [0,1]) and S_k = X_1 + ... + X_k. You press a (k+1)-th time exactly when S_k < 1, so the expected number of presses is 1 + su...