• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to measure 16 minutes using 2 hourglasses

 
Rakesh Joshi
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John has a small and a large hourglasses. The small one can measure 5 minutes and the large one can measure 7 minutes. How can he measure 16 minutes with 2 hourglasses running together?

The rule is when any one of the hourglasses finishes leaking, that hourglass must be flipped over immediately to keep it running.
 
Brett Fitzgerald
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start off by starting both the 7 and the five minute timers. Flip each one as it runs out. End up by flipping the 7 minute timer 1 once, and the 5 minute twice. This generates 14 minutes total on the 7 minute timer, and 15 minutes on the five minute timer.

Once the second run of the 7 minute timer has elapsed (14 minutes into the process), start your stopwatch. The 3rd run of the 5 minute timer has 1 minute remaining at this point. Once this minute runs through, simply run the 5 minute timer three more times.

Brett
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Flip the small and the big.
After 5 min. the small is empty, and 2 mins left in the big.

Start measuring with this left 2 mins, and make two more complete turns of the big (2 + 2 * 7 = 2 + 14 = 16).
 
George Harris
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start the timing by turning over both hourglasses. Once the 5 minute glass empties, turn it over again. Once the 7 minute glass empties, turn over the 5 minute glass (It will now run for 2 minutes). Once it empties, turn over the 7 minute glass. You have now run for 16 minutes.

7 + 2 + 7.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12186
34
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
George, you missed the rule. as soon as a glass empties, you must flip it. You can't hold the 7-min glass for the two minutes it takes the 5 to run down.
 
Ryan McGuire
Ranch Hand
Posts: 1073
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brett Fitzgerald:
Start off by starting both the 7 and the five minute timers. Flip each one as it runs out. End up by flipping the 7 minute timer 1 once, and the 5 minute twice. This generates 14 minutes total on the 7 minute timer, and 15 minutes on the five minute timer.

Once the second run of the 7 minute timer has elapsed (14 minutes into the process), start your stopwatch. The 3rd run of the 5 minute timer has 1 minute remaining at this point. Once this minute runs through, simply run the 5 minute timer three more times.

Brett


While I think George has a better solution (only five moves total, including starting both timers at t=0), Brett's can be modified so that it doesn't need fifteen minutes of prep work:

Start off by starting both the 7 and the 5 minute timers. Flip each one as it runs out. End up by flipping the 7 minute timer twice, and the 5 minute twice. When the five minute timer runs out the third time (after fifteen minutes), there is one minute's worth of sand in the bottom of the seven minute timer. Just turn it over. When it runs out, the 16 minutes are up. (Seven moves)

3*5 + (3*5 - 2*7) = 16

Assumption: The rate of sand falling through the glasses is constant. i.e. If you run the seven minute timer for one minute and then flip it over, it will take one minute to run out.
[ March 28, 2006: Message edited by: Ryan McGuire ]
 
Ryan McGuire
Ranch Hand
Posts: 1073
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by fred rosenberger:
George, you missed the rule. as soon as a glass empties, you must flip it. You can't hold the 7-min glass for the two minutes it takes the 5 to run down.


Ok, between t=7 and t=9, just keep flipping the seven mitute timer over and over really fast so that the sand stays in one end.
[ March 28, 2006: Message edited by: Ryan McGuire ]
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course if you do that, the solution is no longer "best" in terms of minimizing the number of flips, is it?

That rule seemed pretty silly and arbitrary to me anyway. There would be no real-world reason you couldn't just set the timer on its side. Regardless though, to me it seems more useful to minimize startup time than to minimize the number of flips. For that reason, I like Ryan's last version best.
 
Karthikeyan Rajendraprasad
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The rule is when any one of the hourglasses finishes leaking, that hourglass must be flipped over immediately to keep it running.

i think the above thing needs to be taken care off...

so here is a solution

start with both the glasses

after the small hour glass finishes turn it. Time at that point will be 5 min.

after the big hour glass finishes turn it. Time at that point will be 7 min.

after small hour glass finishes turn both Big glass will have 3 min remaining and small 5 min and the time will be 10 min.

after the big hour glass finishes turn both. in turn both big will have 7 min and small will have 3 min and the time will be 13 min.

when the small gets emptied it will be 16 min.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Karthikeyan]: i think the above thing needs to be taken care off...

No, I think it's already covered in all solutions except George's. Though for example Stefan didn't actually say that you continue flipping the small container as necessary, even after you're no longer paying attention to it. But this is an easy modification to his solution.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't see a rule to minimize something, but in real world I would prefer to minimize total elapsed time.

And in reality I would have missed flipping the small glass around (and if not, I would refuse that and break it at the wall - silly rule - and get disqualified - that's the sad truth).

I like Karthikeyans most, because his solution solves the problem in 16 min, while my first has a 5 minutes startup-phase (like a jit-compiler).
I guess my solution would be less error-prone, because you can forget about the small glass soon (just turn it when empty) and after an initial not-empty-turn, you only have two empty-turns on the big glass.
K's solution needs more concentration - so in vital environments I would prefer mine
 
Branko Santo
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well this is easy

Turn both the 5min and 7min and take out a stopwatch from you pocket
play with these for 16 mins and there you go!
 
Henry Wong
author
Marshal
Pie
Posts: 21423
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start both hourglasses running.

At the 5 minute point, the small hourglass will run out. Flip it. There should be 2 minutes left on the large hourglass.

At the 7 minute point, the large hourglass will run out. Flip it. There should be 3 minutes left on the small hourglass.

At the 10 minute point, the small hourglass will run out. Flip it. There should be 4 minutes left on the large hourglass.

At the 14 minute point, the large hourglass will run out. Flip it. There should be 1 minute left on the small hourglass.

At the 15 minute point, the small hourglass will run out. Flip *both* hourglasses. Since the large hourglass has ran for 1 minute from its last flip, there should be 1 minute left on the large hourglass.

At the 16 minute point, the large hourglass will run out.

Henry
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry's solution appears identical to the soltution suggested by Ryan in his first post this thread. Which also appears to have been overlooked by several subsequent posters. So I suppose it's good to explicitly state all the steps in hopes that people will actually see the darn thing. It's pretty straightforward, and does not waste any time in setup steps. It measures out sixteen seconds, and it takes sixteen seconds to do so. What else do we need?
 
Ryan McGuire
Ranch Hand
Posts: 1073
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jim Yingst:
What else do we need?


Some way to get around the assumption in my original post, which, I've found out through experimentation, is NOT true in real life. If you start an hour glass and let it run for one minute and then flip it back over, it takes more than one minute to run out.
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

it takes more than one minute to run out.


Does that include the time to flip the hourglass.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic