[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

1850.0. "Plant the Flag" by RTL::GILBERT () Fri Mar 11 1994 11:05

    A man sends a servant to plant a flag 4 miles into the desert.
    The servant consumes one quart of water for every mile travelled,
    and can carry at most 5 quarts of water.  How is is to do this,
    to minimize the amount of water consumed?
    
    This problem, or one like it, dates from about 800 AD.
T.RTitleUserPersonal
Name
DateLines
1850.1Easy.CADSYS::COOPERTopher CooperFri Mar 11 1994 12:156
    He takes along and consumes 4 quarts (depending on exactly what
    "consumes one quart for every mile" means he might get away with 3).

    Or were you assuming he would survive the task?  :-)

					Topher
1850.2AFSRTL::GILBERTFri Mar 11 1994 18:451
    My fault.  I neglected to mention that the servant must _return_.  Alive.
1850.312 QuartsSTEVEN::HOBBSFri Mar 11 1994 19:5129
Here is a 14 quart solution.

Start with 5 quarts, go 1 mile, drop 3 quarts, return;
(3 quarts stored 1 mile out).

Start with 5 quarts, go 1 mile, pick up 1 quart, go 1 more mile,
drop 3 quarts, return 1 mile, pick up 1 quart return;
(3 quarts stored 2 miles out, 1 quart stored 1 mile out).

Start with 4 quarts, go 2 miles, pick up 2 quarts (leaving 1),
go 2 more miles, plant flag, return 2 miles, pick up the 1 stored
quart, return 1 more mile, pick up 1 stored quart, return.

There are other 14 quart solutions.


If fractions are allowed then here is a 12 quart solution:

Start with 5 quarts go 1.5 miles drop 2 quarts, return;
(2 quarts stored 1.5 miles out).

Start with 2 quarts, go 0.5 mile, drop 1 quart, return;
(2 quarts stored 1.5 miles out, 1 quart stored 0.5 mile out)

Start with 5 quarts, go 0.5 mile, pick up 0.5 quart, go 1 mile,
pick up 1 quart, go 2.5 miles, plant flag, return 2.5 miles,
pick up 1 quart, return 1 mile, pick up 0.5 quart, return 0.5 mile.

I believe that 12 quarts the minimum solution.
1850.410 quartsNOVA::FINNERTYSell high, buy lowMon Mar 14 1994 14:4518
    
    there's a 10 quart solution if the poor wretch doesn't need to drink
    until he finishes the mile, assuming that there's plenty of water
    to drink at the start point.
    
    
    
    	go to mile 1, drink a quart & drop a quart; (hold 3 quarts)
    	go to mile 2, drink a quart & drop a quart; (hold 1 quart)
    	return to mile 1, drink a quart
    	return to home, drink up, and gather 5 more quarts.
    
    	go 4 miles to the flag, drink 4 quarts
    	return to mile 3, drink a quart
    	return to mile 2, drink the quart that's on the ground
    	return to mile 1, drink the quart that's on the ground
    	return home, drink up.
    	
1850.5You're getting thereRTL::GILBERTMon Mar 14 1994 22:476
    Re: .4
    	Sorry, that's a 12-quart solution, since the 'poor wretch' travels
    	12 miles thru the desert.
    
    Re: .3
    	Steve's 12-quart solution is very good.  But not quite optimal.
1850.610NOVA::FINNERTYSell high, buy lowTue Mar 15 1994 08:4015
    
    re: -.1  that's 12, not 10
    
    	no it's not.  Under the assumption that he gets to drink the quart
    	at the *end* of each mile.  Since he ends two of the 12 miles back
    	at 'home base', he can drink from a well rather than from the water
        in a carried bottle.
    
    	for example, how much water does the poor wretch need to carry to
    	go one mile out and come one mile back?  just 1, assuming he can
    	drink from a well when he returns.
    
    	...now if you want to allow him to fill his bottles from the well
    	but not drink from it, that's a different story (and a different
    	problem).
1850.7ContinuousWIDGET::KLEINTue Mar 15 1994 17:404
I think he consumes water continuously, similar to the way an automobile
consumes gasoline.

-steve-
1850.8Continuous consumption ==> differential resultsVMSDEV::HALLYBFish have no concept of fireTue Mar 15 1994 20:2611
> I think he consumes water continuously, similar to the way an automobile
> consumes gasoline.
    
    A reasonable restriction but not well stated in .0.
    
    According to an old manuscript I have this disagreement over the rules,
    or one like it, has existed in various forms since about 800 A.D.
    
      John
    
    (The DEC solution: 2 guys with 6 quarts instead of 1 guy with 12 :-)
1850.10GeneralizeRTL::GILBERTMon Mar 21 1994 12:434
    Ayup, the 'correct' solution has him consume water continuously.
    
    BTW, there is a fairly elegant solution which generalizes to other
    distances, carrying capacities, and consumption rates.
1850.1111.5 quartsSTEVEN::HOBBSMon Mar 28 1994 19:0617
All right, here is the minimum solution which I found by working
backwards--computing the last trip first.  It requires 11.5 quarts.

Trip 1: Start with 1.5 quarts, go 0.25 mile, drop 1 quart, return 0.25
mile.  (1 quart stored 0.25 mile out).

Trip 2: Start with 5 quarts, go 0.25 mile, pick up 0.25 quart, go 1.25
miles, drop 2.5 quarts, return 1.25 miles, pick up 0.25 quart, return
0.25 mile.  (0.5 quarts stored 0.25 mile out and 2.5 quarts stored 1.5
mile out).

Trip 3: Start with 5 quarts, go 0.25 mile, pick up 0.25 quart, go 1.25
mile, pick up 1.25 quarts, go 2.5 miles, plant flag, return 2.5
quarts, pick up 1.25 quarts, return 1.25 miles, pick up 0.25 quart,
return 0.25 mile.

I now believe that 11.5 quarts is the minimum.
1850.12Right! (now how about the general case?)RTL::GILBERTTue Mar 29 1994 12:540