TOPICS
Search

Monkey and Coconut Problem


A Diophantine problem (i.e., one whose solution must be given in terms of integers) which seeks a solution to the following problem. Given n men and a pile of coconuts, each man in sequence takes (1/n)th of the coconuts left after the previous man removed his (i.e., a_1 for the first man, a_2, for the second, ..., a_n for the last) and gives m coconuts (specified in the problem to be the same number for each man) which do not divide equally to a monkey. When all n men have so divided, they divide the remaining coconuts n ways (i.e., taking an additional a coconuts each), and give the m coconuts which are left over to the monkey. If m is the same at each division, then how many coconuts N were there originally? The solution is equivalent to solving the n+1 Diophantine equations

N=na_1+m
(1)
N-a_1-m=na_2+m
(2)
N-a_1-a_2-2m=na_3+m
(3)
|
(4)
N-a_1-a_2-a_3-...-a_n-nm=na+m,
(5)

which can be rewritten as

N=na_1+m
(6)
(n-1)a_1=na_2+m
(7)
(n-1)a_2=na_3+m
(8)
|
(9)
(n-1)a_(n-1)=na_n+m
(10)
(n-1)a_n=na+m.
(11)

Since there are n+1 equations in the n+2 unknowns a_1, a_2, ..., a_n, a, and N, the solutions span a one-dimensional space (i.e., there is an infinite family of solution parameterized by a single value). The solution to these equations can be given by

 N=kn^(n+1)-m(n-1),
(12)

where k is an arbitrary integer (Gardner 1961).

For the particular case of n=5 men and m=1 left over coconuts, the 6 equations can be combined into the single Diophantine equation

 1024N=15625a+11529,
(13)

where a is the number given to each man in the last division. The smallest positive solution in this case is N=15621 coconuts, corresponding to k=1 and a=1023; Gardner 1961). The following table shows how this rather large number of coconuts is divided under the scheme described above.

removedgiven to monkeyleft
15621
3124112496
249919996
199917996
159916396
127915116
5×102310

If no coconuts are left for the monkey after the final n-way division (Williams 1926), then the original number of coconuts is

 {(1+nk)n^n-(n-1)   n odd; (n-1+nk)n^n-(n-1)   n even.
(14)

The smallest positive solution for case n=5 and m=1 is N=3121 coconuts, corresponding to k=0 and 1020 coconuts in the final division (Gardner 1961). The following table shows how these coconuts are divided.

removedgiven to monkeyleft
3121
62412496
49911996
39911596
31911276
25511020
5×20400

A different version of the problem having a solution of 79 coconuts is considered by Pappas (1989).


See also

Diophantine Equation, Pell Equation

Explore with Wolfram|Alpha

References

Anning, N. "Monkeys and Coconuts." Math. Teacher 54, 560-562, 1951.Bowden, J. "The Problem of the Dishonest Men, the Monkeys, and the Coconuts." In Special Topics in Theoretical Arithmetic. Lancaster, PA: Lancaster Press, pp. 203-212, 1936.Gardner, M. "The Monkey and the Coconuts." Ch. 9 in The Second Scientific American Book of Puzzles & Diversions: A New Selection. New York: Simon and Schuster, pp. 104-111, 1961.Kirchner, R. B. "The Generalized Coconut Problem." Amer. Math. Monthly 67, 516-519, 1960.Moritz, R. E. "Solution to Problem 3242." Amer. Math. Monthly 35, 47-48, 1928.Ogilvy, C. S. and Anderson, J. T. Excursions in Number Theory. New York: Dover, pp. 52-54, 1988.Olds, C. D. Continued Fractions. New York: Random House, pp. 48-50, 1963.Pappas, T. "The Monkey and the Coconuts." The Joy of Mathematics. San Carlos, CA: Wide World Publ./Tetra, pp. 226-227 and 234, 1989.Williams, B. A. "Coconuts." The Saturday Evening Post, Oct. 9, 1926.

Referenced on Wolfram|Alpha

Monkey and Coconut Problem

Cite this as:

Weisstein, Eric W. "Monkey and Coconut Problem." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/MonkeyandCoconutProblem.html

Subject classifications