About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
January 2025 - Solution
January 2025 Solution:
One possible solution for the main problem is:
39 TC CA TC CA AS CA TC CB TC CB CA BC CA AS CA TC CA AS CA TC CA TC CA AS CA TC CA TC CA AS CA TC CA AS CA TC CA TC CA
The solution of the bonus is
4224/3187 11 TA AB AC TA AC CS AC CS AC TA AC
A relatively simple approach to the problem is to model the contents of a jug as a tuple where
which means the contents of the jug are
.
We can then describe each state of the system as a triple of such tuples, and work with a directed graph
whose nodes are those triples, and edges can be computed relatively easy given the concrete values of . On this graph, as simple BFS can provide the shortest path to a "good" node.
For the bonus part, some of the solvers used continued fractions in order to determine the desired fraction, due to the amazing power of continued fractions to provide the best approximations (denominator size wise) for a given irrational number.