rec.puzzles Archive

How can you time cooking a sauce for exactly 9 minutes using only a 4-minute sand timer and a 7-minute sand...

logic/sand.timers New

New entry, edited from material collected for the archive and not yet in a released version.

Problem

How can you time cooking a sauce for exactly 9 minutes using only a
4-minute sand timer and a 7-minute sand timer?

-- joseph mccann <jomac@globalnet.co.uk>
Show solution
Start both timers at the same time.  When the 4 min. timer is empty,
turn it over & start it again.  When the 7 min timer is empty, turn it
over and start again.  When the 4 min timer is empty again (8 mins have
elapsed now) turn the 7 min. timer over (since it has been going for 1
min) to time out the remaining minute.

-- Craig Jones <CMJones@Microsoft.com>

you.know.him@you.love.him (Mike Naylor) writes:
>If you start them together, then there will be three minutes left on
>the 7-minute timer when the 4-minute timer runs out.  Then immediately
>flip and restart the 4-minute timer.  When the 7-minute timer runs out,
>there will be one minute left on the 4-minute timer.  Time to start
>cooking!  Now you can ditch the seven minute timer, as you won't need
>it any more.
>
>(Ob. puzzle - Is there another way?)

Yes, but yours is the fastest.  For instance, when there is 1 minute
left on the [4], you can start the [7].  It will have 6 minutes
left when the [4] runs out, and starting the [4] again, the [7] will
have 2 minutes left.  Now you can throw away the [4], start cooking,
and just turn over the [7] as needed.

An interesting visual solution:

4 +--+--+--C--+--+--G--A
  |  |  |  |  |  |  |  |
3 +--+--+--+--+--+--+--+
  |  |  |  |  |  |  |  |
2 +--+--+--+--+--+--+--+
  |  |  |  |  |  |  |  |
1 D--+--+--+--+--+--+--E
  |  |  |  |  |  |  |  |
0 S--+--H--B--+--+--F--+
  0  1  2  3  4  5  6  7

The current state is represented by a lattice point on the rectangle,
the x-value represents the time left in the [7], and the y-value
represents the time left in the [4].  Now, from any lattice point,
we have the following moves available:

(1) Flip the [4].  This reflects the point across the y=2 line.
(2) Flip the [7].  This reflects the point across the x=3.5 line.
(3) Let the timers run until one runs out.  This goes to the
  points farthest away down and to the left on a line with slope 1.

To measure 9, we just have to get either 1 or 2 on either timer.
The quickest solution is to go S-A-B-C-D, at which point there is 1
on the [4].

-- Wei-Hwa Huang <whuang@ugcs.caltech.edu>