Jump to content
Banner by ~ Ice Princess Silky

Problem #3


Silly Druid

Recommended Posts

There's not much interest in the problems so far, but let's try another one... (it's from a movie btw)

You have a 3-gallon container, and a 5-gallon container. You have access to a source of water and a sink. Your goal is to have exactly 4 gallons of water in the 5-galloon container. How can you do that?

  • Brohoof 2
Link to comment
Share on other sites

  • 2 weeks later...

A cooking challenge huh? Say less:

  1. Fill the 3-gallon container up with water.
  2. Pour the water from the 3-gallon into the 5-gallon container.
  3. Fill the 3-gallon container again.
  4. Pour the 3-gallon into the 5-gallon container until full. Since the 5-gallon container already has 3 gallons, you can only pour in 2 more gallons from the 3-gallon container.
  5. This leaves 1 gallon left in the 3-gallon container.
  6. Empty the 5-gallon container, then pour the 1 gallon of water from the 3-gallon container to the 5-gallon container.
  7. Fill the 3-gallon container one more time and pour it into the 5-gallon container.

Bam, 4-gallons baby. :sneer:

  • Brohoof 1
Link to comment
Share on other sites

@arashi_ That's correct! You get a point.

Here's my solution, I think it's a bit simpler (I put the amount of water in both containers next to each step to make it easier to follow);

1. Fill the 5-gallon container. (5/0)
2. Pour the water from 5-galloon container to the 3-gallon until the latter is full. (2/3)
3. Empty the 3-gallon container. (2/0)
4. Pour the water from 5-gallon into 3-gallon. (0/2)
5. Fill the 5-gallon container again (5/2)
6. Pour the water from it into the 3-gallon until it's full. (4/3)

If I'm not mistaken, this problem comes from the movie "Die Hard" (I haven't seen the movie myself, but I've seen that information somewhere.)

Edited by Silly Druid
  • Brohoof 1
Link to comment
Share on other sites

  • 2 months later...
×
×
  • Create New...