Empty one of three buckets by doubling pours
Three buckets contain whole numbers of litres, say a, b and c, all positive, with plenty of spare capacity. The only allowed move is a doubling pour: choose two buckets X and Y and pour from X into Y exactly as much as Y currently holds, so Y doubles and X loses that amount (X must contain at least that much).
Prove that, whatever the starting amounts, a sequence of doubling pours can always empty one of the buckets.
Show a hint
Order the buckets so that a is the smallest. Write b = qa + r with r less than a. Use the binary digits of q to decide, at each doubling of the smallest bucket, whether to pour from the second bucket or the third. Show the smallest amount strictly decreases.
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.