Fill up the 3gallon bucket with water. Empty it into the 5 gallon bucket.
You now have exactly 3 gallons in the 5 gallon bucket. Fill up the 3 gallon
bucket again. Empty it into the 5 gallon bucket until you have exactly 5
gallons. This means you have removed 2 gallons from the 3 gallon bucket and
now have exactly 1 gallon left in the 3 gallon bucket. Dump out the 5 gallon
bucket. Pour the 1 gallon of water out of the 3 gallon bucket, into the 5
gallon bucket. You now have an empty 3 gallon bucket and exactly 1 gallon in
the 5 gallon bucket. Fill up the 3 gallon bucket and pour it into the 5
gallon bucket. The 3 gallons you just poured into the bucket, plus the 1
gallon that was already there, gives you exactly, 4 gallons.
As for creating an algorithm for it... maybe someone else can work it out.
I'm pooped. :-)
Rick Friedman
Salant Corp. - MIS
800-472-8013 x75105
mailto: [EMAIL PROTECTED]
On November 19, 1999 David wrote:
>Hello All.......
>Ok maybe this is not a "Factoid" per se....but just a little quiz
to burn some
>brain cells, ( then again for some maybe not even that :) )
>U have 1, 3 gallon bucket
>" " " 1, 5 gallon bucket
>u absolutely need "exactly" 4 gallon's of water
>How to do?
>Rule: the only measuring device allowed r the buckets
>unlimited water supply
>"best to do while sober"
>as far as i know there r 2 answer's......
>it does help to straighten out your thoughts though
>actually what i am looking for is if anyone would be able to
translate that into
>a wee app for X,...... Written in C, as the song goes
>enjoy..
>David