[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

1094.0. "Cocoanut and Monkey Problem." by PSYCHE::ROOS () Fri Jun 30 1989 18:44



        5 people and a monkey picked cocoanuts all day.  At the end of 
        the day they wanted to divide them up.   But, it was late and 
        they decided to do it in the morning.   So, they put the cocoanuts 
        in a pile and went to sleep.  Not trusting one another the first 
        person got up, went to the pile, divided it into five equal piles, 
        but there was one left over.  The extra one was given to the monkey.
        The person then took one pile and hid it, combined the other four 
        piles, and went back to sleep.  The 2nd, 3rd, 4th and 5th persons 
        did the same:  went to the pile, divided it into five piles with 
        one left over, gave one cocoanut to the monkey, took and hid one 
        pile, combined the remaining piles, and went back to sleep.

        The next day they all got up and divided the remaining cocoanuts
        into five equal parts.

        How many cocoanuts were originally in the pile?   Give the smallest
        answer.
T.RTitleUserPersonal
Name
DateLines
1094.1no "monkey see, monkey do" ?UTRUST::DEHARTOGFri Jun 30 1989 23:1721
/* The answer is 3121 by brute force */
main(){
int a=6,b,c,d,e,f;
	do{	b=4*(a-1)/5;
		if(b%5==1){
			c=4*(b-1)/5;
			if(c%5==1){
				d=4*(c-1)/5;
				if(d%5==1){
					e=4*(d-1)/5;
					if(e%5==1){
						f=4*(e-1)/5;
						if(f%5==0)break;
					}
				}
			}
		}
	}while(a+=5);
	printf("%d\n", a);
}

1094.2AITG::DERAMODaniel V. {AITG,ZFC}:: D'EramoTue Jul 04 1989 03:4818
     re .1 (3121)
     
     Yes.
     
     Let n be how many were in each pile after they divided the
     remaining ones up on the next day.  So after the fifth
     person had finished the night before, there had been 5n.
     Therefore before the fifth person divided them there had
     been (5/4)(5n) + 1, before the fourth person had divided
     them there had been (5/4)^2(5n) + (5/4) + 1, ..., until we
     find that originally there had been (5/4)^5(5n) + (5/4)^4 +
     (5/4)^3 + (5/4)^2 + (5/4) + 1 = (5/4)^5(5n) + 4((5/4)^5 - 1) =
     (5/4)^5(5n+4) - 4 = 3125/1024 (5n + 4) - 4.  This is an
     integer when 5n + 4 is a multiple of 1024, and is smallest
     when 5n + 4 = 1024 in which case there were originally 3125 - 4
     or 3121.
     
     Dan
1094.3Mathematical reasoning is better!PSYCHE::ROOSWed Jul 05 1989 16:265
    
    
      I like this mathematical solution better than the "brute force"
      method.
    
1094.4KOBAL::GILBERTDon't Worry, Be Bobby McFerrinWed Jul 05 1989 18:376
    If the monkey had gotten TWO cocoanuts every night, then there
    would've been exactly twice as many cocoanuts.  And there would
    have been THREE times as many cocoanuts if the monkey has received
    three cocoanuts each night.
    
    Draw your own conclusions from this.
1094.5Holes in an infinite sea of cocoanutsSUBURB::STRANGEWAYSAndy Strangeways@REO DTN 830-3216Tue Apr 04 1995 15:349
    
    Actually, there were (-4) cocoanuts. The first man gave one cocoanut
    to the monkey, leaving (-5), then took his share of (-1) and went back
    to sleep. The others simply repeated this, leaving (-4) to be shared
    out (with one for the monkey) in the morning.
    
    This solution due to Paul Dirac, I believe.
    
    Andy.
1094.6being a wet blanketAUSSIE::GARSONachtentachtig kacheltjesFri Apr 07 1995 04:577
    re .5
    
    or perhaps anti-coconuts...
    
    but it should be recognised that in either the case of holes or
    anti-coconuts this solution is not in strict accordance with the
    wording in the base note.