You have three casks holding 19, 13 and 7 units.
logic/three.casks New
New entry, edited from material collected for the archive and not yet in a released version.
Problem
You have three casks holding 19, 13 and 7 units. The 13 and 7 are full and the 19 is empty. By pouring from one cask to another, with no other measures, decant the liquid to the required amounts. [ Editor: problem statement reconstructed from the postings; the original statement was not collected. The posted solution ends with 10 units in the 13-cask, which may have been the goal. ]
Show solution
I think I got it
Contents Action
19 13 7 taken
==============================
0 13 7 Start
7 13 0 7 to 19
7 6 7 13 to 7
14 6 0 7 to 19
14 0 6 13 to 7
1 13 6 19 to 13
1 12 7 13 to 7
8 12 0 7 to 19
8 5 7 13 to 7
15 5 0 7 to 19
15 0 5 13 to 7
2 13 5 19 to 13
2 11 7 13 to 7
9 11 0 7 to 19
9 4 7 13 to 7
16 4 0 7 to 19
16 0 4 13 to 7
3 13 4 19 to 13
3 10 7 13 to 7
Is this correct?
-- tclancy@rapnet.sanders.lockheed.com
Very nice - hope it was fun.
-- Jay Rothman <jrothman@carbon.denver.colorado.edu>
[ Editor: a later restatement and table for every amount, rec.puzzles,
October 1994. ]
Jay Rothman (jrothman@carbon.denver.colorado.edu) writes:
> This certainly answers the question the way that I asked it. I need to be
> more precise. You are not allowed to use any other vessels - you must end
> up with the 10 qts in one of these 3 casks.
OK, the correct problem statement would be:
You have three casks of sizes 7, 13 and 19 quarts. Starting with the
7 and 13 quart casks full, and without throwing away any of the
liquid, finish with n quarts in one of the casks, for 1<=n<=19.
Again, number of operations are in parentheses. I think most of them
are minimal.
1 (2) 13-19,7-19
2 (7) 13-19,7-19,7-13,19-7,7-13,19-7,7-13
3 (13) 13-19,7-19,7-13,19-7,7-13,19-7,7-13,13-19,7-13,19-7,7-13,19-7,7-13
4 (12) 13-19,7-19,7-13,19-7,7-13,19-7,7-13,13-19,7-13,19-7,7-13,19-7
5 (6) 13-19,7-19,7-13,19-7,7-13,19-7
6 (3) 7-19,13-7
7 (0)
8 (5) 13-19,7-19,7-13,19-7,7-13
9 (11) 13-19,7-19,7-13,19-7,7-13,19-7,7-13,13-19,7-13,19-7,7-13
10 (15) 13-19,7-19,7-13,19-7,7-13,19-7,7-13,13-19,7-13,19-7,7-13,19-7,7-13,
13-19,19-7
11 (10) 13-19,7-19,7-13,19-7,7-13,19-7,7-13,13-19,7-13,19-7
12 (4) 13-19,7-19,7-13,19-7
13 (0)
14 (3) 7-19,13-7,7-19
15 (9) 7-19,13-7,7-19,13-7,19-13,13-7,7-19,13-7,7-19
16 (15) 7-19,13-7,7-19,13-7,19-13,13-7,7-19,13-7,7-19,13-7,19-13,13-7,
7-19,13-7,7-19
17 (14) 13-19,7-19,7-13,19-7,7-13,19-7,7-13,13-19,7-13,19-7,7-13,19-7,7-13,
13-19
18 (8) 13-19,7-19,7-13,19-7,7-13,19-7,7-13,13-19
19 (2) 13-19,7-19
-- Gareth Rees <gdr11@cl.cam.ac.uk>
I went ahead and checked the solution for decanting 10 quarts, just
because it looked interesting...and it has a small bug. The first
fourteen steps leave 3 quarts in the 7-quart cask and 17 quarts in the
19-quart cask (the solution for decanting 17 quarts). To end up with 10
quarts in the 19-quart cask, you have to empty the 3 quarts in the
7-quart cask into the 13-quart cask first, and *then* pour seven quarts
from the 19-quart cask into the 7-quart cask. So, the actual solution
has 16 steps, with the second to last step being 7-13.
Unless I made a mistake myself, I think the correction is needed. Has
anybody confirmed this?
-- Michael Wolfe <wolfe@ils.nwu.edu>
blask@gpx01.d39.lilly.com wrote:
: I recall seeing a book about 25 years ago that had an algorithm for
: solving any of these "3 casks" problems. The algorithm involved
: drawing the path of a billiard ball on a trapezoidal billiard table
: and observing where it bounced. Does any of this sound familiar to
: anyone? What's the name of the book?
You have a good memory from 25 years ago. The pool table solution was
mentioned by an earlier poster. I was able to find it in Steinhaus,
Mathematical Snapshots. It probably appears in many other places.
-- Jay Rothman <jrothman@carbon.denver.colorado.edu>