We call a glass that is not empty "non-empty" and a glass that has been emptied "empty". Each glass holds one liter of water, and all the water is in n containers (glasses), each of which can be either non-empty or empty.
Suppose in the initial state we have f1 non-empty glasses, and we want to reach a state with f2 non-empty glasses.
Algorithm 1: Reaching the balanced state from any state
We consider a container that is initially empty. Then, in each step, we pour a one-liter glass into an empty container. Thus, with each step, 2 liters are transferred from one container to another.
Consequently, at most 2(n−f1) steps are needed to reach the balanced state.
Algorithm 2: Reaching the target state from the balanced state
In each step, we can pour a non-empty glass into an empty container. Consequently, at most n−f2 steps are required to reach the target state.
Algorithm 3: Reaching the objective from the balanced state using containers with the highest capacity
Initially, we consider the non-empty containers with the highest capacity. If there is a container with n−i liters of water, we pour it into a container with a capacity of i to fill it up. We continue this process until we reach the target state. This can be done in n−f2+1 steps.
Algorithm 4: Reaching the balanced state from any state using glasses with more water
Starting from an arbitrary state, we select the container with the least volume of water. We empty this container and transfer its water to the container that has the most water. We continue this method until we reach the balanced state, which requires at most n−f1 steps.
Algorithm 5: Reaching the goal state from any state
Suppose the final state consists of containers with liters a1,a2,…,af2, and we sort them into b1,b2,…,bf2. If we have a glass with capacity n, we can eventually reach the target state through steps in which we transfer glasses with different liters to the ai glasses. At most, 2f2 steps are needed.
Part (a):
We assume by contradiction that:
2(n−f1)>34n⇒f1<3n
and also:
f1+(n−1)>34n⇒f1>3n+1
which are contradictory, so the assumption is false.
Part (b):
Again, we assume by contradiction:
By running algorithms 1 and 4, we have:
2(n−f1)+(n−f2)>35n⇒2f1+f2<34n(1)
By running algorithms 2 and 3, we have:
f1+(n−1)+(n−f2)>35n⇒f1+3n−1>f2(2)
By running algorithms 2 and 5, we have:
f1+2f2>35n(3)
From relations (1) and (3):
35n+f1<2(f1+f2)<34n+f2⇒f1+3n<f2(4)
which shows that (2) and (4) are in contradiction. Thus, the proposition is proven. ■