
Monkeys and Coconuts - Numberphile
video description
My first thought was that the ending number of coconuts (let's call that n for now) has to be a multiple of five.
Pretty obvious I think.
Then I thought that this multiple of 5 had to be an even 4/5 of something, since after each sailor took their portion, 4/5 of the pile was left.
The first multiple of five that satisfies this condition is 20 (4/5 of 25.
Then, I added 1 to 25 (26.
I then realized that after finding 5/4 of n (which is how to find what a number is 4/5 of) and adding one, this new number had to be an even 4/5 of something as well.
26 was not.
I then moved on to the next multiple of 20. That didn't work either.
I kept using this guess and check method for a while before realizing several things:
-The size of the pile before the last sailor reduced the size of the pile to n either would end in 1 or 6 (this includes the extra 1 that would be given to the monkey; let's call this n1.
-If n1 ended in 1, it would definitely not work the next time I multiplied it by 5/4 and added 1 to get n2.
-If n1 ended in 6, it may work for n2.
(This is because if I multiply 1 by 5, I get 5, multiples of which will never be evenly divisible by 4. If I multiply 6 by 5, I get 30, multiples of which may be evenly divisible by 4)
I then began using only every other multiple of 20 for n.
I kept using this guess-and-check method, slowly getting more and more efficient.
I finally got an n of 1020, which got me the final answer of 3121.
QED
Date: 2022-04-08
Related videos
Comments and reviews: 9
Matt
uhm. Here're the equations in the video:
(C0) = 1 + 5(S1) where (C0) is the number of coconuts when the 1st person wakes up, and (S1) is the amount the 1st person takes
(C1) = 4(S1) = 1 + 5(S2) where (C1) is the number of coconuts when the 2nd person wakes up, and (S2) is the amount the 2nd person takes
(C2) = 4(S2) = 1 + 5(S3) where (C2) is the number of coconuts when the 3rd person wakes up, and (S3) is the amount the 3rd person takes
(C3) = 4(S3) = 1 + 5(S4) where (C3) is the number of coconuts when the 4th person wakes up, and (S4) is the amount the 4th person takes
(C4) = 4(S4) = 1 + 5(S5) where (C4) is the number of coconuts when the 5th person wakes up, and (S5) is the amount the 5th person takes
(C5) = 4(S5) = 1 + 5(S6) where (C5) is the number of coconuts when the group all wakes up in the morning, and (S6) is the amount left over for each person
But it was also said that when the group wakes up at the end the pile is split 5 ways and the monkey doesn't get one, so shouldn't the last equation be: (C5) = 4(S5) = 5(S6)?
reply
uhm. Here're the equations in the video:
(C0) = 1 + 5(S1) where (C0) is the number of coconuts when the 1st person wakes up, and (S1) is the amount the 1st person takes
(C1) = 4(S1) = 1 + 5(S2) where (C1) is the number of coconuts when the 2nd person wakes up, and (S2) is the amount the 2nd person takes
(C2) = 4(S2) = 1 + 5(S3) where (C2) is the number of coconuts when the 3rd person wakes up, and (S3) is the amount the 3rd person takes
(C3) = 4(S3) = 1 + 5(S4) where (C3) is the number of coconuts when the 4th person wakes up, and (S4) is the amount the 4th person takes
(C4) = 4(S4) = 1 + 5(S5) where (C4) is the number of coconuts when the 5th person wakes up, and (S5) is the amount the 5th person takes
(C5) = 4(S5) = 1 + 5(S6) where (C5) is the number of coconuts when the group all wakes up in the morning, and (S6) is the amount left over for each person
But it was also said that when the group wakes up at the end the pile is split 5 ways and the monkey doesn't get one, so shouldn't the last equation be: (C5) = 4(S5) = 5(S6)?
reply
KatanaBart
Wait, what was the problem again? First guy subtracts one from the pile, divides the pile into 5, removes one fifth, and?
Did the second guy not notice that one large pile had magically become four piles? Or did the first guy mash all four piles back together after swiping his share? And if the pile originally started at three thousand plus coconuts, and all this happened in one night, then the night must be extremely long, therefore they are at the north pole where a day is 6 months, and. what the heck is a monkey doing at the north pole? Or coconuts for that matter?
If all these guys are keeping their stash a secret, does the first guy get way more than everyone else?
Here's how to solve the problem: count up. First assume everyone gets a single coconut on the last count. Then you're just looking for times where you can divide by five, with one left over.
reply
Wait, what was the problem again? First guy subtracts one from the pile, divides the pile into 5, removes one fifth, and?
Did the second guy not notice that one large pile had magically become four piles? Or did the first guy mash all four piles back together after swiping his share? And if the pile originally started at three thousand plus coconuts, and all this happened in one night, then the night must be extremely long, therefore they are at the north pole where a day is 6 months, and. what the heck is a monkey doing at the north pole? Or coconuts for that matter?
If all these guys are keeping their stash a secret, does the first guy get way more than everyone else?
Here's how to solve the problem: count up. First assume everyone gets a single coconut on the last count. Then you're just looking for times where you can divide by five, with one left over.
reply
Dai
Or you could solve it by first solving the following difference equation:
C_t= C_t-1 - ( (C_t-1 - 1)/5 + 1, which gives
C_t= -4 + (C_0 + 4(4/5)-t,
and since each of the 5 sailors commited the same act, after the fifth sailor's turn, we're left with
C_5= -4 + (C_0 + 4(4/5)-5.
Now considering this current pile is divisible by 5, we have
-4 + (C_0 + 4(4/5)-5 = n,
where n is an integer that is divisible by 5. Rearranging the terms leads to
(4-5(C_0 + 4) = (5-5(n + 4,
now seeing how (4-5) is not divisible by 5 (let alone 5-5) and so for both sides of the equation to be balanced, we must have
(C_0 + 4)/(5-5) = (some constant natural number. This implies an infinite number of solutions with the simpliest being:
(C_0 + 4)/(5-5)= 1 which, finally, implies C_0 = 5-5 - 4 = 3125 - 4 = 3121. Hope this helps.
reply
Or you could solve it by first solving the following difference equation:
C_t= C_t-1 - ( (C_t-1 - 1)/5 + 1, which gives
C_t= -4 + (C_0 + 4(4/5)-t,
and since each of the 5 sailors commited the same act, after the fifth sailor's turn, we're left with
C_5= -4 + (C_0 + 4(4/5)-5.
Now considering this current pile is divisible by 5, we have
-4 + (C_0 + 4(4/5)-5 = n,
where n is an integer that is divisible by 5. Rearranging the terms leads to
(4-5(C_0 + 4) = (5-5(n + 4,
now seeing how (4-5) is not divisible by 5 (let alone 5-5) and so for both sides of the equation to be balanced, we must have
(C_0 + 4)/(5-5) = (some constant natural number. This implies an infinite number of solutions with the simpliest being:
(C_0 + 4)/(5-5)= 1 which, finally, implies C_0 = 5-5 - 4 = 3125 - 4 = 3121. Hope this helps.
reply
truthsmiles
So, I paused and solved this using brute force by testing every number in a spreadsheet up to about 25, 000.
3, 121 was the smallest working number I found, and the next smallest I found was 18, 746.
Further, I can't explain why this is true, but I noticed that 18, 746 is simply 3, 121 multiplied by 6, plus 20.
So, I tested my accidental 'formula' for finding additional solutions, all of which work.
(3, 121 x 6) + 20 = 18, 746
(18, 746 x 6) + 20 = 112, 496
(112, 496 x 6) + 20 = 674, 996
(674, 996 x 6) + 20 = 4, 049, 996
(4, 049, 996 x 6) + 20 = 24, 299, 996
(24, 299, 996 x 6) + 20 = 145, 799, 996
. and so on.
Interestingly, every solution I calculated beyond these ends in xxx, x99, 996 - I'm sure that's somehow meaningful as well - but again, I'm not smart enough to explain it: )
reply
So, I paused and solved this using brute force by testing every number in a spreadsheet up to about 25, 000.
3, 121 was the smallest working number I found, and the next smallest I found was 18, 746.
Further, I can't explain why this is true, but I noticed that 18, 746 is simply 3, 121 multiplied by 6, plus 20.
So, I tested my accidental 'formula' for finding additional solutions, all of which work.
(3, 121 x 6) + 20 = 18, 746
(18, 746 x 6) + 20 = 112, 496
(112, 496 x 6) + 20 = 674, 996
(674, 996 x 6) + 20 = 4, 049, 996
(4, 049, 996 x 6) + 20 = 24, 299, 996
(24, 299, 996 x 6) + 20 = 145, 799, 996
. and so on.
Interestingly, every solution I calculated beyond these ends in xxx, x99, 996 - I'm sure that's somehow meaningful as well - but again, I'm not smart enough to explain it: )
reply
Andy
Actually, I worked it out that any number 3121+15625a, where a is an integer will work. For example 18746 and 34371. The simplified version of the calculation of the original number from the remaining pile (after being divided equally among the sailors) is (15625a+8404)/1024=b (where a is the number left in the pile and b is the original number (in the case where b=3121, a=204. If you want, you can re-write this as (15625a+212)/1024=b, where 212 is the remainder when 8404 is divided by 1024. Using Excel, I found whole number values for b (original pile size) for a=204 and every a=204+1024x, where x is an integer (1228, 2252, 3276, 4300, etc. The original pile size would increase by 15625 each time (which makes sense since for each increase of 1024 for a, the increase for b is 15625-1024/1024.
reply
Actually, I worked it out that any number 3121+15625a, where a is an integer will work. For example 18746 and 34371. The simplified version of the calculation of the original number from the remaining pile (after being divided equally among the sailors) is (15625a+8404)/1024=b (where a is the number left in the pile and b is the original number (in the case where b=3121, a=204. If you want, you can re-write this as (15625a+212)/1024=b, where 212 is the remainder when 8404 is divided by 1024. Using Excel, I found whole number values for b (original pile size) for a=204 and every a=204+1024x, where x is an integer (1228, 2252, 3276, 4300, etc. The original pile size would increase by 15625 each time (which makes sense since for each increase of 1024 for a, the increase for b is 15625-1024/1024.
reply
erin
Here is a simpler solution(I think):
N = 5n1+1
4n1 = 5n2+1
.
4n5 = 5p0
From n5 is an integer it follows that p0 = 4p1, so n5 = 4p1
So n4 = (25p1+1)/4.
From n4 is an integer it follows that p1 = 4p2+3, so n4 = 25p2+19
(one could try 4p2, 4p2+1, 4p2+2, 4p2+3 to see that only the latter is correct)
So n3 = (125p2+96)/4.
From n3 is an integer it follows that p2 = 4p3, so n3 = 125p3+24
So n2 = (625p3+121)/4.
From n2 is an integer it follows that p3 = 4p4+3, so n2 = 625p4+499
So n1 = (3125p4+2496)/4.
From n1 is an integer it follows that p4 = 4p5, so n1 = 3125p5+624
Therefore
N = 5-5-p5+3121
The first solution is obtained for p5 = 0, which gives N = 3121.
reply
Here is a simpler solution(I think):
N = 5n1+1
4n1 = 5n2+1
.
4n5 = 5p0
From n5 is an integer it follows that p0 = 4p1, so n5 = 4p1
So n4 = (25p1+1)/4.
From n4 is an integer it follows that p1 = 4p2+3, so n4 = 25p2+19
(one could try 4p2, 4p2+1, 4p2+2, 4p2+3 to see that only the latter is correct)
So n3 = (125p2+96)/4.
From n3 is an integer it follows that p2 = 4p3, so n3 = 125p3+24
So n2 = (625p3+121)/4.
From n2 is an integer it follows that p3 = 4p4+3, so n2 = 625p4+499
So n1 = (3125p4+2496)/4.
From n1 is an integer it follows that p4 = 4p5, so n1 = 3125p5+624
Therefore
N = 5-5-p5+3121
The first solution is obtained for p5 = 0, which gives N = 3121.
reply
Joseph
For n sailors, the minimum positive number of coconuts is n-n-n+1.
+Consider all the numbers that will satisfy only the first sailor. -4, 1, 6, 11, 16, 21, 26.
+These occur every 5. (5-1)
+Consider of those the numbers that will satisfy the second sailor. -4, 21, 46, 71, 96.
+These occur every 25. (5-2)
+The numbers that satisfy the nth sailor occur on multiples of 5-n minus 4.
+The minimum number of coconuts for 5 sailors is 3121. Add 5-5 (3125) to that to get another number that works. And so on.
+So the minimum number of coconuts for 6 sailors doing the same thing is 46651 (6-6-6+1)
Cheers
reply
For n sailors, the minimum positive number of coconuts is n-n-n+1.
+Consider all the numbers that will satisfy only the first sailor. -4, 1, 6, 11, 16, 21, 26.
+These occur every 5. (5-1)
+Consider of those the numbers that will satisfy the second sailor. -4, 21, 46, 71, 96.
+These occur every 25. (5-2)
+The numbers that satisfy the nth sailor occur on multiples of 5-n minus 4.
+The minimum number of coconuts for 5 sailors is 3121. Add 5-5 (3125) to that to get another number that works. And so on.
+So the minimum number of coconuts for 6 sailors doing the same thing is 46651 (6-6-6+1)
Cheers
reply
DRIP-
I attempted solving it before watching the solution, following a similar iteration method, and I ended with the equation m = (1024T -8404)/3125 where m is a natural integer of the form (5k, and T represents the total amount of coconuts. if you plug in 3121 for T it gives you an integer m (1020) that happens to be a multiple of five like I defined it to be. That said, I don't know how to make the equation any shorter/prettier, nor how to look for any integer solutions other than have a program search for it. still, I'm pretty glad I (seemingly) at least got to come up with a solution.
reply
I attempted solving it before watching the solution, following a similar iteration method, and I ended with the equation m = (1024T -8404)/3125 where m is a natural integer of the form (5k, and T represents the total amount of coconuts. if you plug in 3121 for T it gives you an integer m (1020) that happens to be a multiple of five like I defined it to be. That said, I don't know how to make the equation any shorter/prettier, nor how to look for any integer solutions other than have a program search for it. still, I'm pretty glad I (seemingly) at least got to come up with a solution.
reply
Patrick
Start with C5 and, using trial and error, work your way to C0 by applying (1. 25(Cx)+1, moving on when you don't get a whole number. You'll quickly see that C5 must be divisible by 20, then that C5 minus 60 must be divisible by 80. Each time C5 increases by 80, C4 increases by 100 (ie 176, 276, 376 etc. Then you'll see that C3, when divisible by 4, goes up by 500 (ie 96, 596, 1096 etc. Once you've figured that out, you can just apply the formula to 1596 and it works out to 3121. Took me 10 or 20 minutes.
reply
Start with C5 and, using trial and error, work your way to C0 by applying (1. 25(Cx)+1, moving on when you don't get a whole number. You'll quickly see that C5 must be divisible by 20, then that C5 minus 60 must be divisible by 80. Each time C5 increases by 80, C4 increases by 100 (ie 176, 276, 376 etc. Then you'll see that C3, when divisible by 4, goes up by 500 (ie 96, 596, 1096 etc. Once you've figured that out, you can just apply the formula to 1596 and it works out to 3121. Took me 10 or 20 minutes.
reply
Add a review, comment
Other channel videos















