# Liquid container riddle

**URL:** <https://boards.straightdope.com/t/liquid-container-riddle/438118>\
**Category:** Factual Questions\
**Created:** [February 18, 2008, 4:58pm UTC](https://boards.straightdope.com/t/liquid-container-riddle/438118 "2008-02-18T16:58:20Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hampshire](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hampshire/32/4887_2.png) [@Hampshire](https://boards.straightdope.com/u/Hampshire)\
**Post date:** [February 18, 2008, 4:58pm UTC](https://boards.straightdope.com/t/liquid-container-riddle/438118/1 "2008-02-18T16:58:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![3acresandatruck](https://avatars.discourse-cdn.com/v4/letter/3/e79b87/32.png) [@3acresandatruck](https://boards.straightdope.com/u/3acresandatruck)\
**Post date:** [February 18, 2008, 5:47pm UTC](https://boards.straightdope.com/t/liquid-container-riddle/438118/2 "2008-02-18T17:47:36Z")

</div>

[QUOTE=Hampshire]  
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.  
[/QUOTE]

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)

---

<div class="post-metadata">

**Author:** ![aerodave](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@aerodave](https://boards.straightdope.com/u/aerodave)\
**Post date:** [February 18, 2008, 6:03pm UTC](https://boards.straightdope.com/t/liquid-container-riddle/438118/3 "2008-02-18T18:03:15Z")

</div>

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.

```auto

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

```

---

<div class="post-metadata">

**Author:** ![Student\_Driver](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@Student\_Driver](https://boards.straightdope.com/u/Student_Driver)\
**Post date:** [February 18, 2008, 6:15pm UTC](https://boards.straightdope.com/t/liquid-container-riddle/438118/4 "2008-02-18T18:15:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rowrrbazzle](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/rowrrbazzle/32/414_2.png) [@rowrrbazzle](https://boards.straightdope.com/u/rowrrbazzle)\
**Post date:** [February 18, 2008, 9:42pm UTC](https://boards.straightdope.com/t/liquid-container-riddle/438118/5 "2008-02-18T21:42:19Z")

</div>

There is a graphic method for solving these puzzles.

> **[Barycentric coordinates, three jugs application](http://www.cut-the-knot.org/triangle/glasses.shtml)**
>
> Barycentric coordinates, three jugs application: We are given three glasses A, B, C of respective capacities 8, 5, and 3 oz

---

<div class="post-metadata">

**Author:** ![Xema](https://avatars.discourse-cdn.com/v4/letter/x/9de053/32.png) [@Xema](https://boards.straightdope.com/u/Xema)\
**Post date:** [February 18, 2008, 10:11pm UTC](https://boards.straightdope.com/t/liquid-container-riddle/438118/6 "2008-02-18T22:11:27Z")

</div>

[QUOTE=aerodave]

```auto

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

```

[/QUOTE]

Something goes wrong at the end here.

I think the final steps should be:

```auto

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

```

---

<div class="post-metadata">

**Author:** ![aerodave](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@aerodave](https://boards.straightdope.com/u/aerodave)\
**Post date:** [February 18, 2008, 11:38pm UTC](https://boards.straightdope.com/t/liquid-container-riddle/438118/7 "2008-02-18T23:38:10Z")

</div>

[QUOTE=Xema]  
Something goes wrong at the end here.

I think the final steps should be:

```auto

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

```

[/QUOTE]

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.

---

<div class="post-metadata">

**Author:** ![Antinor01](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Antinor01](https://boards.straightdope.com/u/Antinor01)\
**Post date:** [February 18, 2008, 11:47pm UTC](https://boards.straightdope.com/t/liquid-container-riddle/438118/8 "2008-02-18T23:47:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![NunOfTheAbove](https://avatars.discourse-cdn.com/v4/letter/n/51bf81/32.png) [@NunOfTheAbove](https://boards.straightdope.com/u/NunOfTheAbove)\
**Post date:** [February 19, 2008, 12:50am UTC](https://boards.straightdope.com/t/liquid-container-riddle/438118/9 "2008-02-19T00:50:38Z")

</div>

[QUOTE=Antinor01]  
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.  
[/QUOTE]

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.

---

<div class="post-metadata">

**Author:** ![Antinor01](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@Antinor01](https://boards.straightdope.com/u/Antinor01)\
**Post date:** [February 19, 2008, 12:51am UTC](https://boards.straightdope.com/t/liquid-container-riddle/438118/10 "2008-02-19T00:51:56Z")

</div>

[QUOTE=NunOfTheAbove]  
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.  
[/QUOTE]

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

---

<div class="post-metadata">

**Author:** ![spinky](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@spinky](https://boards.straightdope.com/u/spinky)\
**Post date:** [February 19, 2008, 10:42am UTC](https://boards.straightdope.com/t/liquid-container-riddle/438118/11 "2008-02-19T10:42:59Z")

</div>

[QUOTE=rowrrbazzle]  
There is a graphic method for solving these puzzles.

> **[Barycentric coordinates, three jugs application](http://www.cut-the-knot.org/triangle/glasses.shtml)**
>
> Barycentric coordinates, three jugs application: We are given three glasses A, B, C of respective capacities 8, 5, and 3 oz

[/QUOTE]

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.
