This is just testing the mod % (remainder) operations.
For example:
Given containers which hold 3 units and 5 units, measure 4 units:
1. Fill up 3 and pour all of it into the 5.
2. Fill up 3 again then pour as much possilbe into the 5.
3. Empty the container of 5.
4. Pour all of the contents of 3 into the empty 5. (Now you have 1 unit in the 5 container).
5 Fill up the 3 container and pour into the 5 unit container to get 4 units.
Given containers which hold 4 units and 9 units, measure 6 units:
1. Fill up the 9 container, then pour as much possible into the 4 unit container.
2. Dump out the contents of the 4 containers, and fill it up again with what's left in the 9 unit container.
3. Now there is only one unit in the 9 unit container.
4. Empty the 4 unit container and then fill it with the one unit form the 9.
5. Fill up the 9 unit container to the top. Then dump it into the 4 unit container (which currently contains 1 unit) until it is full.
6. There will only be 6 units left in the 9 unit container when the 4 unit container becomes full.