# Measuring with Two Jugs

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

This Demonstration shows a graphic solution of the problem of measuring out liters of a liquid using jugs of capacity and liters, with integers. The solution seeks the minimal number of times jugs are to be filled and emptied. So we are looking for a solution (in integers) of the Diophantine equation with minimal . Another method for solving the equation can use two rulers with lengths that are multiples of and . The problem cannot be solved if does not divide .

Contributed by: Izidor Hafner (January 2016)

Code from: Emmanuel Garces Medina

Open content licensed under CC BY-NC-SA

## Snapshots

## Details

detailSectionParagraph## Permanent Citation

"Measuring with Two Jugs"

http://demonstrations.wolfram.com/MeasuringWithTwoJugs/

Wolfram Demonstrations Project

Published: January 7 2016