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.

SNAPSHOTS

  • [Snapshot]
  • [Snapshot]
  • [Snapshot]
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.