View Full Version : A perplexing problem to solve

Bob Rufener

02-28-2013, 6:51 PM

I have a challenge that I haven't been able to figure out. There are three jars and from left to right the left jar holds 8 units of liquid and has 8 units of liquid in it. The middle jar is empty and holds 3 units. The right jar holds 5 units and is empty. In 7 moves or less, how can you end up with 4 units in the left jar, 0 units in the middle jar and 4 units in the right jar? It probably can be solved with algebra but I had algebra about 55 years ago and my teacher was the varsity football coach so my algebraic skills are non-existant. Can someone solve this problem? You can not just pour 4 units into the right jar and end the problem. If you pour 8 units from left jar and move to right jar, it will fill right jar up to 5 units. I hope this makes sense.

Doug Wolf

02-28-2013, 7:10 PM

(1). Pour from left jar and fill right jar, having 3 units left in left jar. (2). Pour right jar to fill middle jar which leaves 2 units in right jar. (3). Pour middle jar into left jar which leaves: left jar=6 units, middle jar=0 units and right jar=2 units. (4). Pour right jar into middle jar equaling 2 units. (5). Pour left jar to fill right jar leaving: left jar=1, middle still has 2, and right has 5 units. (6). Pour right to fill middle leaving left=1, middle=3 and right=4. (7). Pour middle into left and you end up in 7 moves having 4 units in the left, 0 units in the middle and 4 units in the right.

Charles Wiggins

02-28-2013, 7:55 PM

They did this problem in Die Hard with a Vengeance.

John Coloccia

02-28-2013, 8:02 PM

Drink the beer. Tell your jerk friend that if he wants to share your beer, show up with some normal glasses and stop playing games.

Bob Rufener

02-28-2013, 8:29 PM

Thank you Doug for supplying the correct answer. I think I will now have 12 ounces in one bottle and when I am finished there will be 0 ounces left....

John Coloccia

02-28-2013, 8:45 PM

Funny enough, this got me thinking and I can't think of a straightforward way to solve this. I can think of some "mathematical" constructions to help organize the various possibilities. The only thing that really stands out to me is that 8, 3 and 5 are relative primes, and relative primes have lots of interesting properties, most of which allude me at the moment. Maybe somewhere in there is an answer, but I just can't figure any general way to do this.

Surely someone out there can talk to this.

Steve Wurster

03-01-2013, 7:24 AM

They did this problem in Die Hard with a Vengeance.

Although in that one I think it was one jar that could hold 3 gallons and a second jar that could hold 5 gallons, and from that you need to get exactly 4 gallons. You do that with the following steps:

Fill the 3 and then pour it into the 5.

Fill the 3 again and pour what you can into the 5. You'll have 5 gallons in the 5 and 1 gallon left in the 3.

Dump the 5, and then pour that 1 gallon from the 3 into the 5.

Fill the 3 and pour it into the 5. You'll now have 4 gallons in the 5.

Jim Matthews

03-01-2013, 7:49 AM

Surely someone out there can talk to this.

SOrry... I was dringin eight gallons of beir.

Whazza kweshun?

Larry Browning

03-01-2013, 9:08 AM

Here is the most important question of all. Why do you want to do this in the first place? I would just pour 4 units from the right jar into the left jar and be done with it. What purpose does this serve other than a brain teaser? First I would divide the height of the first jar in half, and mark the half way point. (This can be done with a string) Then just pour it off until it is down to the mark. 1 move.

I reject the rule about not pouring 4 units into the right jar and ending the problem. I am simply solving the problem.

Doug Wolf

03-01-2013, 9:49 AM

Larry, You are making the assumption the jars are straight sided. What if they are flasks? Your string theory won't work.

Larry Browning

03-01-2013, 10:03 AM

Larry, You are making the assumption the jars are straight sided. What if they are flasks? Your string theory won't work.

All my jars are straight sided. It's policy in my shop!:D

Plus I'm not smart enough to discuss string theory with anyone!

BTW: Is this an actual problem he is trying to solve or is this just for fun?

Pat Barry

03-01-2013, 1:02 PM

Doug has the correct and only solution to this problem.

Joe Angrisani

03-01-2013, 3:34 PM

Two moves.....

Pour 3 units from left jar to right jar. Pour 1 unit from left jar to right jar.

In keeping with the rules, notice I never poured 4 units. It's a word riddle, not a math riddle. :cool:

Greg Portland

03-04-2013, 5:13 PM

Funny enough, this got me thinking and I can't think of a straightforward way to solve this. I can think of some "mathematical" constructions to help organize the various possibilities. The only thing that really stands out to me is that 8, 3 and 5 are relative primes, and relative primes have lots of interesting properties, most of which allude me at the moment. Maybe somewhere in there is an answer, but I just can't figure any general way to do this.

Surely someone out there can talk to this.

John, 3x + 5y = 1. (8 has nothing to do with the problem. In Die Hard they used a continuously running fountain for the water source).

here's the math --> http://www.math.tamu.edu/~dallen/hollywood/diehard/diehard.htm

This Youtube video talks you through the Euclidian Algorithm (start ~3min for the math). http://www.youtube.com/watch?v=uv9Mgs-cUA0

John Coloccia

03-04-2013, 6:09 PM

John, 3x + 5y = 1. (8 has nothing to do with the problem. In Die Hard they used a continuously running fountain for the water source).

here's the math --> http://www.math.tamu.edu/~dallen/hollywood/diehard/diehard.htm

This Youtube video talks you through the Euclidian Algorithm (start ~3min for the math). http://www.youtube.com/watch?v=uv9Mgs-cUA0

Yes, that's one of the interesting properties of relative primes that somewhat eluded me the other day, but something was tickling the back of my mind made me think it was important they were relative primes. I think in this case the 8 is important though because you're trying to get 4 and 4 gallons, not just 4 gallons in one. If it were just 4 gallons in one jar, then 3 and 5 being relative prime would be the only important part, but to guarantee you can get 4 and 4 (or whatever mix you'd like) you need all 3 jars to be relative primes.

Thanks for that link, Greg. I went looking for a more rigorous treatment and couldn't find anything.

Greg Portland

03-05-2013, 12:52 PM

NP, it was driving me crazy as well :).

John Coloccia

03-05-2013, 4:27 PM

So for people wondering what we're yacking about, that property of relative primes (i.e. for relative primes X and Y, there exists integers a,b such that ax + by = 1) means that as long as you don't run out of water, you can always fill and empty jars a certain number of times to makes 1, and you can make as many 1s as you need to make whatever number you wish to make. So with 3 and 5, 2*3 + (-1)*5 = 1, so to make 1, you need to fill the 3 jar twice, and fill the 5 jar once.

So fill the 3 jar....dump it into the 5 jar. Fill the 3 jar again, dump it into the 5 jar until it's full. Now you have 1 left in the 3 jar (technically, you need to dump out the 5 jar). Doing it naively like this won't always get you the best answer, but it always means an answer will always exist given a large enough supply of water.

Powered by vBulletin® Version 4.2.5 Copyright © 2020 vBulletin Solutions Inc. All rights reserved.