## Tuesday, February 17, 2009

### Two measuring problems

A classic puzzle:
You have two unmarked, asymmetrical containers. One of them holds exactly 3 liters when full, while the other holds exactly 5 liters. You also have a sink faucet and a drain. You need to measure exactly four liters of water. How can you measure exactly 4 liters? You cannot simply fill the larger container four fifths of the way, because you have no way of knowing when it reaches that point.

And since I realize that I have at least a few readers who are just too good for the classics, here's a challenge problem, custom-made by me.

You have three timers. After you start each timer, it stays silent for a period of time, and then it dings. The first timer stays silent for exactly 10 seconds, the second timer for 40 seconds, and the third timer for 45 seconds. Until the timer dings, you have no way of knowing how much time has past. Using these timers, can you measure an unbroken time interval of exactly 20 seconds? The catch is that after each timer dings, you must rewind it before starting it again. You cannot rewind a timer instantaneously; however, you may assume it takes less than 5 seconds to rewind.

Baumann Eduard said...

(a)
fill 5
fill 3 from 5
fill rest 2 in sink
repeat a 2nd time -> 4

(b)
start 40 and 10
at end 10 start 45
at end 40 start 10
at end 10 start 40
at end 45 start 10
at end 10 start 45
20 = end 40 to end 45

miller said...

I misspoke. Rather than a sink and a drain, you have a faucet and a drain. That is, you have an unlimited water source and drain, but no extra location to store water.

There is a shorter solution to the timer problem.

Baumann Eduard said...

(a')
fill 3
3 in 5 : 0 in 3 and 3 in 5
fill 3
3 in 5 : 1 in 3 and 5 in 5
void 5 : 1 in 3 and 0 in 5
3 in 5 : 0 in 3 and 1 in 5
fill 3
3 in 5: 4 in 5

Baumann Eduard said...

(b')
start 40 and 45
at end 40 start 10
at end 45 start 40
at end 10 start 45
at end 45 start 10
20 = from end 40 to end 10

miller said...

Cool, you got it.

I think there's a shorter solution to (a), but it uses more water, so the optimal solution is moot.

Secret Squïrrel said...

Darn it, I'm too late.

I can't beat Ed's sol'n for Q2 but I have a shorter sol'n for Q1 that also wastes only 3 litres of water down the drain instead of 5.

3 : 5
-----
0 : 5
3 : 2
0 : 2
2 : 0
2 : 5
3 : 4

Now I have a question for the both of you (and anyone else interested).

You have two unmarked kitchen cooking pots/saucepans. One hold exactly 3 litres, the other 5. The 5L is full but you have no source of further water. Measure out exactly 4 litres.

Secret Squïrrel said...

Sorry, Miller. That's prob a bit rude taking over your blog like that. Not very good with people stuff.

And it was late at night for me...

miller said...

I don't really mind if people pose new problems in the comments, as long as they remain simple problems. No nerd sniping basically.

Secret Squïrrel said...

Cool. Nerd sniping would be blue on blue, basically. I prefer jock baiting :-)

Solution to my secondary puzzle:

(My specifying saucepans was meant to imply that they are cylindrical, without being too obvious about it).

Tip the 5L into the 3L until the remaining water just covers the base. The 5L will now have 2.5L. Tip the 3L out to achieve the same effect. It will now have 1.5L.
2.5 + 1.5 = 4

amit said...
This comment has been removed by the author.
amit said...

Rows = time left
TImers: 45 40 10
start 45 and 40 ---> 45 40 0
end of 40 start 10 ----> 5 buzz 10
end of 45 start 40 ---->buzz 40 5
end of 10 start 45 ---->45 35 buzz

after 40 ones buzz we have 10 secs till 45 goes off and then start 10 sec timer