Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: the hourglass problem
Replies: 38   Last Post: Jan 6, 2012 1:42 AM

 Messages: [ Previous | Next ]
 root Posts: 57 Registered: 8/26/09
Re: the hourglass problem
Posted: Jan 1, 2012 12:51 AM

RichD <r_delaney2001@yahoo.com> wrote:
> You're given a 7 minute, and a 4 minute, sand
> hourglass. Measure a 9 minute interval, in the first
> 9 minutes. (no 'setup' period)
>
> ok, this is trivial. But as computer nerds, we're
> interested in general solutions. So, given hourglasses
> of n and m minutes:
>
> 1) Can you devise a formula which generates a list of
> all possible intervals produced by them?
>
> 2) And an algorithm, which generates the interval,
> for any given number on the list.
>
> Of course, this is solvable via brute force, but we
> want something efficient.
>
> PS The problem stated above is a Google
> interview question! Which lowers my estimate of
> their intellectual prowess.
>
> --
> Rich

This problem is very interesting. After you realize
how to get 9 minutes, you then realize you are
able to get 4 minutes, 7 minutes, and then every
integer minute thereafter. So the numbers realizable
without delay are:
4,7,8,9,10,11,12........

Then, clearly, with a 7 minute delay you can generate
every integer minute.

Date Subject Author
12/31/11 Rich Delaney
12/31/11 William Elliot
12/31/11 Dave Dodson
1/1/12 William Elliot
1/1/12 Patricia Shanahan
1/2/12 William Elliot
1/2/12 Patricia Shanahan
1/2/12 Remysun
1/2/12 Bart
1/1/12 root
1/1/12 William Elliot
1/2/12 Duncan Booth
1/3/12 Rich Delaney
1/3/12 Daniel Pitts
1/4/12 PT
1/4/12 Daniel Pitts
1/5/12 Dave Dodson
1/5/12 Daniel Pitts
1/5/12 Mike Jones
1/5/12 Bart
1/5/12 Patricia Shanahan
1/5/12 Daniel Pitts
1/5/12 JohnF
1/5/12 Dave Dodson
1/5/12 Daniel Pitts
1/2/12 Duncan Booth
1/2/12 Frederick Williams
1/2/12 Rich Delaney