How To Really Solve The Monkey And The Coconuts Puzzle?
Published on April 17, 2022 by Hemanth
--
I most recently encountered the ‘the monkey and the coconuts’ puzzle and it took me for a ride. I traced its modern version back to a 1926 issue of The Saturday Evening Post in the form of a short story by Ben Ames Williams titled “Coconuts”.
In this short story, a certain builder is engaged in competition with another builder for the same contract. The builder is keen to do everything he can to prevent his competition from bidding. A clever employee of the builder comes up with an ingenious plan. He is aware of the competitor’s craze for mathematical puzzles and aims to take advantage of it.
The employee sends the ‘the monkey and the coconuts’ puzzle over to the competitor. The competitor in turn ends up getting so obsessed over this puzzle that he forgets to enter his bid on time.
From my experience, I can only empathise with this competitor, for ‘the monkey and the coconuts’ puzzle is not to be taken lightly (you have been warned). Without any further ado, let us begin.
The story behind the puzzle begins with a shipwreck around noon. Luckily, all the ship’s occupants survive the catastrophe and wash up on the shore of a nearby island in the afternoon. The survivors include five sailors and a monkey.
Illustrative art created by the author
In order to ensure further sustenance, the five sailors go about collecting coconuts on the island before nightfall. As they do this, the monkey cheers them on. After a tiresome effort, they pile a handsome stack of coconuts on the beach. At the end of the intense exercise, they all decide to go to sleep.
The Ploy
As everyone sleeps, one sailor gets anxious about the thought of a quarrel about splitting the coconuts in the morning. He gets up and divides the stack into five equal piles with one extra coconut left over. By this time, the monkey is also awake and looks at him peculiarly. So, the sailor throws the left-over coconut to the monkey (perhaps as a bribe?). He takes one of the five equal piles for himself, hides his stash, reorganises the remaining piles into one big (new) pile, and goes to sleep.
Illustrative art created by the author
Shortly after, another sailor wakes up with the same worry and divides the pile of remaining coconuts into five equal piles. He too is left with one extra coconut. Like the first sailor, he also throws the extra coconut to the monkey, takes and hides one of the five piles for himself, reorganises the remaining piles into one big pile, and goes back to sleep.
Similarly, one after another, the three remaining sailors get up and go through the same procedure. And the monkey gets an extra coconut each time around.
The Monkey and the Coconuts Puzzle
Finally, the following morning, everyone wakes up to a considerably smaller pile. They all realise that there has been some mischief going on, but none of them utters a word, as each of them is guilty of mischief himself.
They decide to split the coconut stack into five equal piles for each one of the sailors. They are indeed able to do this and are yet again left with one extra coconut. They throw the extra coconut to the monkey and proceed with their day.
Now, the question posed by the puzzle is:
How many coconuts in total did the sailors originally collect?
Hint:
This puzzle has more than one solution, mathematically speaking. However, we are looking for the least number of total coconuts that would allow for the events of the story to logically occur. Also, a word of caution: This puzzle is considerably harder than it looks.
Spoiler Alert:
If you wish to try to solve the puzzle on your own, now is the time. Once you have given it a good try, you may choose to continue reading. From this point onwards, I will be explicitly discussing the puzzle’s solution.
Transforming Facts into Equations
Let us say that right at the beginning, there are a total of ’N’ coconuts in the stack. Furthermore, let ‘A’ be the number of coconuts that the first sailor chose to hide. Similarly, let ‘B’, ‘C’, ‘D’, and ‘E’ be the number that each sailor following the first sailor chose to hide respectively.
Finally, let ‘F’ be the total number of coconuts that each sailor got in the morning after the split. Then, we arrive at the following equation system:
Math illustrated by the author
The ‘1’ on the right-hand side of each equation represents each time the monkey gets a coconut. So, the monkey ends up with a total of 6 coconuts by the morning. Now that we have an equation set, we could proceed with simplifying them.
Simplifying the Equation Set
Before you proceed with reading this section, know that this is just cumbersome mathematical simplification. If you feel pressed for time or just wish to cut to the chase, you may choose to skip this section. However, if you want to get into nitty-gritty mathematics, go right ahead.
When we substitute equations 2, 3, 4, 5, and 6 into 1, we get the following result:
Math illustrated by the author
That looks like a messy equation. But worry not; it simplifies into something far less messy:
Math illustrated by the author
Solving the Monkey and Coconuts Puzzle
After a bit of mathematical acrobatics, we have arrived at a single equation with 2 unknowns: the total number of coconuts right at the beginning, and the final number of coconuts each sailor gets in the morning. What is more challenging is the fact that this is a Diophantine equation.
Diophantine Equation → 1024N – 15625F – 11529 = 0
If you are not aware of the notion of Diophantine equations, just know that it is a special class of equations where we accept only integer solutions (named after Diophantus of Alexandria, the pioneering Greek algebraist).
There are several formal procedures that we could follow (including trial and error) to solve this equation. But in this essay, I will be demonstrating a simple yet counterintuitive approach to solving the puzzle. Just as a reminder:
We are looking for the least number of total coconuts that would allow for the events of the story to logically occur.
Thinking Negatively to Solve the Monkey and the Coconuts Puzzle
The sailors, in summary, divided ’N’ coconuts into five piles a total of 6 times. This means that 5⁶ coconuts can be added or subtracted to ’N’ to achieve an infinite number of solutions. But our goal is to come up with the least positive integer solution possible.
In order to achieve this, Paul Dirac came up with an ingenious approach (he in turn attributed the credit to an unknown source). It is quite clear that the least positive integer solution will not be a small number.
But what if there is a small negative integer that satisfies the equation?
It turns out that there does indeed exist one such integer: -4. And this is how the sequence plays out:
1. The sailors first amass a total of -4 coconuts.
2. Once everyone else is asleep, the first sailor tosses a positive coconut over to the monkey. In this instance, a negative coconut is created. When summed up with the common pile, there are now a total of -5 coconuts.
3. The sailor splits the -5 coconuts into -1 coconut per sailor, takes and hides his stash (-1 coconut), reorganises the remaining -4 coconuts into the common pile, and goes to sleep.
4. Then, the next sailor wakes up and repeats the entire cycle. Therefore, at the end of each cycle, the number of coconuts goes back to -4 (the same number we started with).
Notice how there is a subtle change in the order of events in this approach to the puzzle. If the sailor had decided to split the -4 coconuts into five piles first before tossing one positive coconut to the monkey, we would have ended up in trouble.
We need to consider this order change because we are working with negative coconuts here. However, this change in order does not affect our final solution, as you are about to find out.
The Solution to the Monkey and the Coconuts Puzzle
Let me recall our main realization about the puzzle from earlier:
“The sailors, in summary, divided ’N’ coconuts into five piles a total of 6 times. This means that 5⁶ coconuts can be added or subtracted to ’N’ to achieve an infinite number of solutions.”
We just established that -4 is a valid negative solution to the puzzle. Considering our main realisation, we could just add 5⁶ to this result. This way, we will arrive at the answer we are looking for!
Therefore, the lowest positive integer solution to our puzzle is:
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-advertisement
1 year
Set by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Advertisement" category .
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
CookieLawInfoConsent
1 year
Records the default button state of the corresponding category & the status of CCPA. It works only in coordination with the primary cookie.
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Cookie
Duration
Description
_gat
1 minute
This cookie is installed by Google Universal Analytics to restrain request rate and thus limit the collection of data on high traffic sites.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Cookie
Duration
Description
__gads
1 year 24 days
The __gads cookie, set by Google, is stored under DoubleClick domain and tracks the number of times users see an advert, measures the success of the campaign and calculates its revenue. This cookie can only be read from the domain they are set on and will not track any data while browsing through other sites.
_ga
2 years
The _ga cookie, installed by Google Analytics, calculates visitor, session and campaign data and also keeps track of site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognize unique visitors.
_ga_R5WSNS3HKS
2 years
This cookie is installed by Google Analytics.
_gat_gtag_UA_131795354_1
1 minute
Set by Google to distinguish users.
_gid
1 day
Installed by Google Analytics, _gid cookie stores information on how visitors use a website, while also creating an analytics report of the website's performance. Some of the data that are collected include the number of visitors, their source, and the pages they visit anonymously.
CONSENT
2 years
YouTube sets this cookie via embedded youtube-videos and registers anonymous statistical data.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Cookie
Duration
Description
IDE
1 year 24 days
Google DoubleClick IDE cookies are used to store information about how the user uses the website to present them with relevant ads and according to the user profile.
test_cookie
15 minutes
The test_cookie is set by doubleclick.net and is used to determine if the user's browser supports cookies.
VISITOR_INFO1_LIVE
5 months 27 days
A cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.
YSC
session
YSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.
yt-remote-connected-devices
never
YouTube sets this cookie to store the video preferences of the user using embedded YouTube video.
yt-remote-device-id
never
YouTube sets this cookie to store the video preferences of the user using embedded YouTube video.
Comments