THE MONKEY COCONUT PROBLEM USING EXTENDED EUCLIDEAN ALGORITHM (PART I)

Solving the Diophantine Equation 1024(x) = 15625(y) + 11529

Background

Martin Gardner's essay of the Monkey and the Coconuts [The Colossal Book of Mathematics, 2001, pp3-9] tells the story of five men and a monkey shipwrecked on a desert island with coconuts for food. The coconuts are split in a certain manner with the monkey getting a certain amount. The problem is solved using six equations which are ultimately reduced to one - A Diophantine equation with 2 unknowns:

1024x = 15625y + 11529

Since the equation was too difficult to solve using the use of continued fractions, Gardner obtained the answer using a simple non Euclidian method. This page will calculate the answer using the extended Euclidian algorithm which will be explained during the course of the calculation. It will also be shown that a new sequence produced from certain values of x and y can be generated in Part II.

The Use of the Extended Euclidean Algorithm

The goal of the is to find the greatest common divisor (gcd) of the two integers 1034 and 15625. x and y are first placed on the left side of the equation followed by division of x by y to produce a quotient and a remainder (r). If the remainder is not 0 continue dividing each quotient by the remaider on the next subsequent line. So by first using the Euclidean algorithm we find that the gcd(1024,15625) = 1 at r = 0.

Once we obtain the gcd we work recursively backwards using the extended Euclidean algorithm to find x and y The yellow colored boxes correspond to the values obtained above.

Go to Part II on generation of new sequence. Go back to homepage.


Copyright © 2018 by Eddie N Gutierrez. E-Mail: edguti144@outlook.com