Ponder This

Welcome to our monthly puzzles.
You are cordially invited to match wits with some of the best minds in IBM Research.

January 2025 - Solution

<< December

January 2025 Challenge


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 (a,b,c) where a,b,c\in\mathbb{Z} which means the contents of the jug are aV_{A}+bV_{B}+cV_{C}.

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 V_A, V_B, V_C. 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.