# Answer to Riddle #22: The 3 & 5 Litre Die Hard Water Puzzle

22. You have a 3 and a 5 litre water container, each container has no markings except for that which gives you it's total volume. You also have a running tap. You must use the containers and the tap in such away as to exactly measure out 4 litres of water. How is this done?

Can you generalise the form of your answer?

Can you generalise the form of your answer?

You might remember this puzzle from Die Hard with a vengeance where Bruce Willis and Samuel L. Jackson have to diffuse a bomb by placing 4 gallons of water on a set of scales...

Before reading the answer can I interest you in a clue?

There are two ways to solve this, maybe the question could be modified to say the 5 litre can doesn't fit under the tap...

Number 1: Empty the 5 litre can into the 3 litre can - leaving 2 litres in the 5 litre can. ie B - A in B

Fill the 3 litre can with the 2 litres from the 5 litre can - leaving 2 litres in the 3 litre can. As in space in A of A - (B - A) = 2A - B

Fill the remaining 1 litre space in the 3 litre can from the 5 litre can. Leaving

So the generalised form of solution 1 is 2B - 2A in B.

Number 2: Fill the 3 litre can from the tap. Empty the contents of the 3 litre can into the 5 litre can. Which gives us B - A space in B.

Fill the 3 litre can from the tap. Empty the contents of the 3 litre can into the 5 litre can. - Leaving the 5 litre can full and 1 litre in the 3 litre can. ie. removing (B - A) from A leaves A - (B - A) or 2A - B in A

Pour away the contents of the 5 litre can. Pour the 1 litre from the 3 litre can into the 5 litre can. ie 2A - B in B

Fill the 3 litre can from the tap. Empty the contents of the 3 litre can into the 5 litre can. Leaving

So the generalised form of solution 2 is 3A - B in B.

There are some restrictions, such as in solution 2 A must be less than 2A < B but other wise we can make up other puzzles like 5 Litres and 9 Litres to get 6 Litres. or 8 Litres. All exactly the same form.

There are two ways to solve this, maybe the question could be modified to say the 5 litre can doesn't fit under the tap...

__Number 1__- Fill the 5 litre can from the tap

- Empty the 5 litre can into the 3 litre can - leaving 2 litres in the 5 litre can.

- Pour away the contents of the 3 litre can.

- Fill the 3 litre can with the 2 litres from the 5 litre can - leaving 2 litres in the 3 litre can.

- Fill the 5 litre can from the tap.

- Fill the remaining 1 litre space in the 3 litre can from the 5 litre can.

Leavingin the 5 litre can.__4 litres__

__Number 2__- Fill the 3 litre can from the tap.

- Empty the contents of the 3 litre can into the 5 litre can.

- Fill the 3 litre can from the tap.

- Empty the contents of the 3 litre can into the 5 litre can. - Leaving the 5 litre can full and 1 litre in the 3 litre can.

- Pour away the contents of the 5 litre can

- Pour the 1 litre from the 3 litre can into the 5 litre can.

- Fill the 3 litre can from the tap.

- Empty the contents of the 3 litre can into the 5 litre can.

Leavingin the 5 litre can.__4 litres__

## Generalised Form

We have two solutions above which both give the same answer of 3 litres. It turns out that if you make it algebraic the answer does not have the same form and it's sort of coincidence. Lets call the smaller container A and the lager B and work it through.Number 1: Empty the 5 litre can into the 3 litre can - leaving 2 litres in the 5 litre can. ie B - A in B

Fill the 3 litre can with the 2 litres from the 5 litre can - leaving 2 litres in the 3 litre can. As in space in A of A - (B - A) = 2A - B

Fill the remaining 1 litre space in the 3 litre can from the 5 litre can. Leaving

__4 litres__in the 5 litre can. So the amount in B is B - (2A - B) or 2B - 2ASo the generalised form of solution 1 is 2B - 2A in B.

Number 2: Fill the 3 litre can from the tap. Empty the contents of the 3 litre can into the 5 litre can. Which gives us B - A space in B.

Fill the 3 litre can from the tap. Empty the contents of the 3 litre can into the 5 litre can. - Leaving the 5 litre can full and 1 litre in the 3 litre can. ie. removing (B - A) from A leaves A - (B - A) or 2A - B in A

Pour away the contents of the 5 litre can. Pour the 1 litre from the 3 litre can into the 5 litre can. ie 2A - B in B

Fill the 3 litre can from the tap. Empty the contents of the 3 litre can into the 5 litre can. Leaving

__4 litres__in the 5 litre can. ie A + (2A - B) or 3A - B in B.So the generalised form of solution 2 is 3A - B in B.

There are some restrictions, such as in solution 2 A must be less than 2A < B but other wise we can make up other puzzles like 5 Litres and 9 Litres to get 6 Litres. or 8 Litres. All exactly the same form.

© Nigel Coldwell 2004 - – The

**questions**on this site may be reproduced without further permission, I do not claim copyright over them. The

**answers**are mine and may not be reproduced without my expressed prior consent. Please enquire using the link at the top of the page.