PUZZLE IBM-321
The irrational three-jug problem
IBM Research · Ponder This · 2025-01
IBM Ponder This #321 · January 2025
This puzzle was suggested by Latchezar Christov - thanks!
Three jugs A, B, and C have volumes
To achieve the solution of the problem, we perform a sequence of steps that can only be one of the following:
- Pour water from the tap into a jug until it is filled to the top.
- Empty a jug into the sink.
- Pour water from one jug into another until either the source jug is empty or the receiving jug is filled to the top, whichever happens first.
We assume that these steps are performed with absolute accuracy and no water is spilled.
Our goal is to measure a specific amount of water, meaning we seek to arrive at a state where any one of the jugs (no matter which one) contains this specific amount. As it is impossible to measure with these jugs any rational, non-zero volume with a finite number of steps, we will relax the condition: Instead of measuring a volume of
The solution should be presented as a list of two-letter strings that represent the steps of the solution, in which the first letter denotes the source, and the second letter denotes the recipient. The tap is denoted by T and the sink by S. The list should also be preceded by a number representing the minimum number of steps.
For example: If the task is to measure
6 TA AB BS AB TA AB
Upon completion of the above sequence of six steps, jug A would contain 1.00803 liters of water, a volume within the specified tolerance.
Your goal: Find a sequence of steps measuring
A bonus "*" will be given for solving the following problem: Keeping the same jugs A and B, replace jug C with one of the volume
is a rational number: , where and are integers. . liters can be measured with 11 steps.- 11 is the minimum possible number of steps.
has the smallest possible value.
Submit
Solution
Best opened after a real attemptTo be added.