I’d like to welcome you with a little logic puzzle

by Tyler on July 1, 2007

So I’m trying to finally get around to starting and maintaining a blog. We’ll see how it works out this time. As a little welcome for ALL my many valued readers, I’ll present a logic puzzle that has supposedly been used by Microsoft for programming interviews.

You have a 3-quart bucket, a 5-quart bucket, and an infinite
“supply of water. How can you measure out exactly 4 quarts?

My solution is as follows:

First, place the 3-quart bucket upside-down inside the 5-quart bucket. Fill up the 5-quart bucket, then remove the 3-quart bucket. This will leave 2 quarts inside the 5-quart bucket. Pour this into the 3-quart bucket. So there are now 2 quarts in the 3 quart bucket, and none in the 5-quart bucket. Place the 5-quart bucket over the 3-quart bucket so the bottom of the 5-quart bucket is covering the rim of the 3-quart bucket, then turn them over, so the 5-quart bucket is facing upwards. Fill the outside of the 5-quart bucket, then remove the 3-quart bucket. The 2-quarts that were contained in the 3-quart bucket will mix with the 2-quarts surrounding the outside of the 3-quart bucket, and you’ll be left with 4 quarts in the 5-quart bucket.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • HackerNews
  • Reddit
  • StumbleUpon

{ 2 comments… read them below or add one }

Thoams quick April 10, 2008 at 5:23 am

1) Fill the 5 quart bucket
2) pour out 3 quarts into the 3 quart bucket from the 5 quart bucket.
3) empty the 3 quart bucket
4) pour the remaining 2 quarts into the 3 quart bucket.
5) fill the five quart bucket.
6) pour out enough to fill the 3 quart bucket.

You now have 4 quarts in the 5 quart bucket.

admin April 10, 2008 at 8:09 am

Very nice Thoams. That certainly does the trick, and is much easier to follow than my solution.

Leave a Comment

Next post: Postfix to expression-tree in scheme