12

You have 3 identical bottles with a capacity of 4 litres:

  • The first bottle contains 2 litres of liquid A
  • The second bottle contains 3 litres of liquid B
  • The third bottle contains 4 litres of liquid C

Each turn you can take a bottle and pour its contents into another bottle until either the source bottle is empty or the target bottle is full. As you do this, the liquids in the target bottle will mix evenly. This process can be repeated as long as you need. Is there a way that you can get one bottle to contain an equal and non-zero amount of each of the three liquids? If not, then how close can you get to it?

Here is a detailed example (optional to read):

From the starting state you cannot pour the first bottle into the third bottle as the third bottle is already full. However, you can go the other way - pour 2 litres of the third bottle into the first bottle. This will lead to the first bottle being a mixture of 2 litres of liquid A and 2 litres of liquid C, while the third bottle will just have 2 litres of liquid C left. Now, if you pour the first bottle back into the third bottle then the first bottle will have 1 litre of liquid A and 1 litre of liquid C, while the third bottle will have 1 litre of liquid A and 3 litres of liquid C. We can describe the transformations as follows:

Original state is (2, 0, 0), (0, 3, 0), (0, 0, 4)
3->1 leads to the state (2, 0, 2), (0, 3, 0), (0, 0, 2).
1->3 leads to the state (1, 0, 1), (0, 3, 0), (1, 0, 3).

Dmitry Kamenetsky
  • 35,897
  • 5
  • 66
  • 276

3 Answers3

7

It is impossible.

Note a couple of lemmata.

Pouring liquid from a bottle does not change its proportionality so that if we do achieve a balanced proportionality then we will achieve a balanced proportionality in a full bottle i.e. we will have 4/3 litre of each liquid in one bottle.

Also

The initial levels of the bottles are 4-3-2. We can either move to another 4-3-2 state or a 4-4-1 state. Once we are in a 4-4-1 state we can only move to another 4-4-1 state.

Now,

Consider the amount of liquid B in any given bottle. I claim that for as long as we are in a 4-3-2 state, any non-zero amount of liquid B written as a fraction in lowest terms is $3m/2^n$ for some $m$ and $n$. This is because to transition from 4-3-2 to 4-3-2 we pour the 4 bottle into one of the other bottles. By induction, I am creating a full bottle with either $3m_3/2^{n_3}+3m_4/2^{n_4+2}$ or $3m_2/2^{n_2}+3m_4/2^{n_4+1}$ of liquid B and leaving behind either $9m_4/2^{n_4+2}$ or $3m_4/2^{n_4+1}$. All of these expressions are of the required form.

Now

When I make a transition to a 4-4-1 state this can either be pouring the 2-bottle into the 3-bottle, in which case the amount of liquid B in each bottle continues to be of the form $3m/2^n$, or I pour from the 3-bottle into the two bottle creating amounts of liquid B that can be expressed fractionally in least terms as $k/2^n$ for some $k$ and $n$.

From this point onwards

I can only transfer liquid from a full bottle to the bottle with 1 litre in it. This will only create quantities of liquid B of which are $k/2^n$ in reduced fractional form. Thus I can never obtain a bottle with 4/3 litre of liquid B in it.

Informally

You only have one chance to divide by the prime 3; the rest of the time you are dividing by 2 or 4.

I suspect

That there is a best solution. One can achieve arbitrarily close approximations to 4/3 of the form $k/2^n$. However, given $s$ steps the highest value of $n$ that is achievable is at most $2s$, this puts a bound on how close we can get with any fixed number of steps. On the other hand with more mixing one should find that all of the bottles tend towards a 2/9, 1/3, 4/9 mixture and the rate of convergence should put a lower bound on the distance from 1/3,1/3,1/3 that can be achieved (though we can prevent convergence by choosing some point to only mix between two bottles).

Daniel S
  • 6,748
  • 20
  • 40
6

I have no proof that this is the best possible.

After the following steps

$$3 \rightarrow 2\ ,\ 2 \rightarrow 3\ ,\ 3 \rightarrow 2\ ,\ 2 \rightarrow 1\ ,\ 1 \rightarrow 3\ ,\ 3 \rightarrow 2\ ,\ 2 \rightarrow 1\ ,\ 2 \rightarrow 3\ ,\ 3 \rightarrow 2\ ,\ 2 \rightarrow 3\ ,\ 1 \rightarrow 2\ ,\ 2 \rightarrow 1$$

Then you end up with the following in bottle 1:

$$\left(\frac{683}{512}, \frac{43677}{32768}, \frac{43683}{32768}\right) = (1.333984375, 1.33291625976563, 1.33309936523438)$$

For comparison, I'll divide by $4$ litres to get the composition fractions.

$$\left(\frac{683}{2048}, \frac{43677}{131072}, \frac{43683}{131072}\right) = (0.33349609375, 0.33322906494140625, 0.33327484130859375)$$
The difference between the largest and smallest is $0.00026702880859375 = \frac{35}{131072}$.

Jaap Scherphuis
  • 53,019
  • 7
  • 120
  • 208
  • 2
    This is the closest I could get too using a computer, code for reference – Manish Kundu Mar 15 '23 at 16:35
  • Great answer! My current suspicion is that it is possible to get arbitrarily close but might be difficult to prove. – hexomino Mar 15 '23 at 16:48
  • 1
    @hexomino I'm not so sure about that. There isn't the same amount of each liquid, so it's not like you can just keep mixing at will to get closer. – Jaap Scherphuis Mar 15 '23 at 16:54
  • @JaapScherphuis I don't think I understand that last comment in terms of intuition (given that you did just mix at will to get very very close). You think there is some hard limit here? – hexomino Mar 15 '23 at 17:03
  • 3
    The intuition is that, after the three bottles are close enough to 2-3-4 proportions, the results of further mixes will be bounded away from equality. You could conceivably use this to prune search branches and exhaust the search space. – AxiomaticSystem Mar 15 '23 at 17:11
  • @AxiomaticSystem Oh, I think I understand now, thanks. – hexomino Mar 15 '23 at 17:20
  • @AxiomaticSystem Thanks, my intuition hadn't quite coalesced to the point were I could explain it properly. – Jaap Scherphuis Mar 15 '23 at 17:26
  • Very nice! This is better than the solution I found. Let's see if anyone can do better. – Dmitry Kamenetsky Mar 15 '23 at 23:10
  • 1
    rot13(N zbqrengryl-ceharq frnepu gb qrcgu 28 qvqa'g svaq nalguvat. Vs lbh cybg gur guerr obggyrf va (N,O,P)-fcnpr, gura zvkvat nal gjb obggyrf fuevaxf gur "pbar" bs cbfvgvir pbzovangvbaf bs gur obggyrf, ohg gur snpg gung zvkgherf pna nccebnpu 1:1:1 rira vs gung yvar yvrf bhgfvqr gur pbar znxrf n qrsvavgvir grfg qvssvphyg.) – AxiomaticSystem Mar 15 '23 at 23:18
  • 3
    I managed to reproduce this solution, but I couldn't improve it. So I am giving you the tick. – Dmitry Kamenetsky Mar 16 '23 at 01:14
2

Nearest Attempt so far

If we do the following steps

$$3 \rightarrow 2\,\,,\,\, 2 \rightarrow 3\,\,,\,\, 2 \rightarrow 1\,\,,\,\, 3 \rightarrow 2\,\,,\,\, 1 \rightarrow 3\,\,,\,\, 3 \rightarrow 1,$$ $$2 \rightarrow 3\,\,,\,\, 1 \rightarrow 2\,\,,\,\, 2 \rightarrow 1\,\,,\,\, 3 \rightarrow 2\,\,,\,\, 1 \rightarrow 3$$

Then you end up with the following in bottle 1

$$\left(\frac{169}{512}, \frac{1383}{4096}, \frac{1361}{4096}\right) = (0.330078125, 0.337646484375, 0.332275390625)$$ which has a difference of 0.007568359375 between the largest and smallest portions in the bottle

Of course, if we remove the last two steps from the procedure then bottle 1 contains the following

$$\left(\frac{169}{128}, \frac{1383}{1024}, \frac{1361}{1024}\right) = (1.3203125, 1.3505859375, 1.3291015625)$$ which has the same percentage difference between the largest and smallest proportions in the bottle (0.7568359375%).

As a fraction, this difference represents $\frac{31}{4096}$ of the volume of liquid in the bottle.

hexomino
  • 135,910
  • 10
  • 384
  • 563