This puzzle mixes math and coding. Plus you can go online to try the code yourself.
In his book The Colossal Book of Mathematics: Classic Puzzles, Paradoxes, and Problems, Martin Gardner simplified a classic question about monkeys and coconuts. His simplified version goes as follows:
“Three sailors come upon a pile of coconuts. The first sailor takes half of them plus half a coconut. The second sailor takes half of what is left, plus half a coconut. The third sailor also takes half of what remains, plus half a coconut. Left over is exactly one coconut, which they toss to the monkey. How many coconuts were in the original pile? If you arm yourself with 20 matches, you will have ample material for a trial-and-error solution.”
To get a feel for the problem, let us guess that the sailors collect 9 coconuts.
That means the first sailor takes half of 9 (4.5) plus .5 more for a total of 5 coconuts. How many coconuts are left for the second sailor?
Well, that would be the total minus what Sailor 1 took, 9 – 5 = 4.
The second sailor takes half of the 4 (2) plus ½ more, making 2.5. That means he leaves 4 – 2.5, or 1.5 coconuts for the 3rd sailor.
Finally, Sailor 3 takes half of 1.5 (.75) plus 0.5 coconuts, for a total of 1.25.
Become a subscriber and get access to the rest of this article. Plus all our magazine articles.
Stories also include numerous links to help parents, kids, and teachers learn more. Get access today at just $15 per year!
Also In The April 2017 Issue
Building and creating your tools with the Minecraft toolbox helps you survive the game.
Sensors give robots the senses humans have.
30+ ideas for all age holiday gifts, from books to apps to board games to VR and more.
There might be a reason that too-real robot and video game character creeps you out.
You computer mouse cursor finally gets a cat to chase it.
Create turtles with Python, the programming language.
This programming language uses colors instead of text and punctuation to add and perform other tasks.
Use micro:bit to water your plants!
Knowing how passwords are cracked can help you create better passwords.
Studying satellite photographs shows a lot about what happens in the world.
There are a number of strategies teachers (plus parents and students) can take to learn programming.
Pigpen ciphers uses alien-like symbols to hide secret messages.
This project uses conductive thread to create a glove to activates your phone.
The repl.it website and React are one way to create mobile apps.
Software programming does neat things with language, in this case, mixing capital letters.
This Scratch game has lots of ways you can customize the game play. No cats were harmed in the making of this article either.
Links from the bottom of all the October 2017 articles, collected in one place for you to print, share, or bookmark.
Interesting stories about computer science, software programming, and technology for October 2017.