Liquid container riddle

I’ve seen and solved the fairly easy container riddle from die-hard 3 that everyone knows but have come across a new one in “Professor Layton” game for the nintendo DS.
It’s driving me nuts!

You have 3 bottles this time. A full 16 liter. An empty 9 liter, and an empty 7 liter.
Pour the 16 liters around as much as you like in order to get 8 liters in the 16 liter bottle and 8 liters in the 9 liter bottle.
(basic rules apply: pours form bottle to bottle are complete only when 1) The container you are pouring from is completely empty, or 2) The container you are pouring to is completely full.)

Have at it. I’m stumped.

here’s what I came up with…does this work? check my math!

containers: A (capacity16), B (capacity9), C (capacity7)

initial -> A (16), B (0), C (0)
fill C from A; empty C into B -> A (9), B (7), C (0)
fill C from A; empty C into B -> A (2), B (9), C (5)
empty B into A -> A (11), B (0), C (5)
empty C into B -> A (11), B (5), C (0)
fill C from A -> A (4), B (5), C (7)
fill B from C -> A (4), B (9), C (3)
empty B into A -> A (13), B (0), C (3)
empty C into B -> A (13), B (3), C (0)
fill C from A -> A (6), B (3), C (7)
fill B from C -> A (6), B (9), C (1)
empty B into A -> A (15), B (0), C (1)
empty C into B -> A (15), B (1), C (0)
fill C from A -> A (8), B (1), C (7)
fill B from C -> A (8), B (8), C (0)

I see 3acresandatruck has already posted a solution, but I’ll post the one I worked out. It’s not the shortest possible, but it works. Then again, the one that Bruce and Sam used in DH3 wasn’t the simplest solution, either.

In my case, it takes advangtage of the 2-gallon difference between the 7- and 9-gallon containers to get 2 gallons at a time into the 7-gal.

I’ll just list the volumes of water in each container at the end of each legal step. The pours to get you from step to step should be self-explanatory.



16   9   7
------------
16   0   0
 7   9   0
 7   2   7
14   2   0
14   0   2
 5   9   2
 5   4   7
12   4   0
12   0   4
 3   9   4
 3   6   7
10   6   0
10   0   6
 9   0   7
 9   7   0
 8   8   0


Looks good, 3acres.

Here’s my solution, again using A = 16 liter, B = 9, C = 7:

A(16), B(0), C(0): start
A(7), B(9), C(0): A to B
A(7), B(2), C(7): B to C
A(14), B(2), C(0): C to A

A(14), B(0), C(2): B to C
A(5), B(9), C(2): A to B
A(5), B(4), C(7): B to C
A(12), B(4), C(0): C to A

A(12), B(0), C(4): B to C
A(3), B(9), C(4): A to B
A(3), B(6), C(7): B to C
A(10), B(6), C(0): C to A

A(10), B(0), C(6): B to C
A(1), B(9), C(6): A to B
A(1), B(8), C(7): B to C
A(8), B(8), C(0): C to A, finish

What I found interesting about the above solution was the repeating pattern of movements.

Edited to add: wow, I’m a slow typer. Anyway-- yay, I’m… uhh… third.

There is a graphic method for solving these puzzles.

Something goes wrong at the end here.

I think the final steps should be:



10   0   6
 1   9   6
 1   8   7
 8   8   0


Hmmm…you are correct. For some reason, at the very last step, I forgot that the 9-gallon jug was 9-gallons, and thought it was 8. So close.

I must be missing something. Pour from the 16 into the 7 which leaves 9 in the 16. Pour from the 7 into the 9. Pour from the 16 (now 9) into the 9 which will top off the remaining 1 to make 8 in each.

What you are missing is that the 9 is missing 2 (units), not 1 unit after being filled with the 7. Therefore, topping it off with the 16 (now 9) will give you a 16 (now 7) and a full 9, not two 8s.

ahh, bad logic on my part. I knew I was overlooking something very simple, but my brain refused to tell me what. Never mind. :slight_smile:

Nifty. I drew out the graph and once I got used to the mechanics of the weird coordinate system, I produced the same answer as the aerodave/xema collaboration above in about a minute.