Home > Riddles > Empty a cubo

Empty a cubo

A problem of transfers and invariants disguised as cubes and marbles: the scene seems local, but the good solution is already thinking globally.

There are three buckets with marbles. In each move you can choose one of them and double its number of marbles, taking from the other two cubes, between them, exactly as many marbles as that cube had.

For example, if the cubes contain:
12, 7 and 3 You can double the cube of 3 by taking 3 of the cube of 12, and go like this to:
9, 7 and 6 You start with cubes that contain:
12, 7 and 3 Can you make one of the three cubes empty? And, if it is possible here, will it always happen, whatever the initial distribution?

Hints

Show hints
  1. In the specific case, a long sequence is not necessary.
  2. Try to fold the middle cube.
  3. In general, think of a version of Euclid's algorithm: reducing one cube using the other two.

Solution

Show full solution

In the specific case, one movement is enough. We start from 12, 7, 3. If we double the cube of 7, we need to add 7 marbles to it. We can take them like this:

  • 4 of the cube of 12
  • 3 from the cube of 3 So we get 8, 14, 0 and there is already an empty cube. In general, it can also always be done. The idea is to order the cubes from smallest to largest, such as a, b and c, and use the movements to reduce the median cube b, in a way similar to Euclid's algorithm. We write b = qa + r, with r between 0 and a-1. Through a succession of foldings of the small cube, it can be achieved that the medium cube loses exactly qa marbles and is reduced to r, which is already less than a. Then the cubes are rearranged and the operation is repeated. At each stage, the median cube strictly decreases. Since it cannot decrease indefinitely without reaching a smaller non-negative integer, the process necessarily ends when one of the buckets reaches 0.

Related riddles

Keep practicing

If you enjoyed this one, try more pure-logic riddles, explore this theme, browse the full archive, or read the riddle-solving guide.

← Previous: The urn that reveals itself · Next: The monk and the mountain →