Water-Pouring Problem

A classic puzzle starts with two unmarked bottles that can hold 3 liters and 5 liters respectively, and a bathtub with unlimited water. How can 1 liter be measured?
One method: Start with the 3L bottle empty and the 5L bottle full. This state could be represented as (0, 5). Next, pour from the 5L bottle into the 3L bottle until the 3L bottle is full, to get the state (3, 2). Empty the 3L bottle, changing the state to (0, 2). Pour the 2 liters of water in the 5L bottle into the 3L bottle, to get the state (2, 0). Fill the 5L bottle again; the state is now (2, 5). Pour from the 5L bottle into the 3L bottle until it is full, resulting in the state (3, 4). Empty the 3L bottle; now the state is (0, 4). Pour from the 5L bottle into the 3L bottle until it is full, finishing with the state (3, 1). There is now 1 liter in the 5L bottle.
The various possible states can be shown on the edge of a parallelogram on a triangular grid. The various solution steps trace out a path similar to that of a ball bouncing around a rhombus-shaped pool table.

(402 lines omitted)
comments
 
Powered by Wolfram Mathematica
Give us your feedback
Give us your feedback

Source page:




 often  occasionally  never

Note: Please do not include anything you consider confidential or proprietary. Your message and contact information may be shared with the author of any specific Demonstration for which you give feedback, but will not otherwise be published or distributed.
Privacy Policy »

Note: To run this Demonstration you need the free
Mathematica Player
or Mathematica 7+
Download or upgrade to Mathematica Player 7
I already have Mathematica Player or Mathematica 7+