Jump to content
BrainDen.com - Brain Teasers
  • 0

Apples and Monkeys


Guest
 Share

Question

There are 5 Monkeys and a number of apples. They want to divide the apples into equal shares, but all forget. They all go to sleep. In the middle of the night, the first monkey suddenly remembers, and goes and divides the apples into five equal groups. He finds out that there is an extra, and eats it. Then, he hides his share and goes to sleep. The second monkey remembers ten minutes later, divides the apples, and finds out there is an extra. He eats the extra, hides his share and goes to sleep. The third, fourth, and fifth all do the same process, and at the end, there are still many apples left. Assuming that the monkeys didn't cut any apples, what is the least number of apples that there could've been at the beginning?

Link to comment
Share on other sites

Recommended Posts

  • 0

One last thought: Extra kudos to whoever finds the general formula for the answer for arbitrary number of monkeys. I'm pretty sure this is possible so long as iterated functions count as a general formula - in other words, you can say "for M monkeys, you need to generate a function f and some integers i, j and k, all of which depend on M, and the answer is N apples where N = j+ f( f( f( ... f(i)...))), and f() is applied recursively M-k times" for example, and you provide the functional dependence of f, i,j,and k on M, of course.

Link to comment
Share on other sites

  • 0

Got it.

After a drive home and a few glasses of wine, here's what I have:

The general answer for M monkeys is as follows:

let h(M) = (M-1) * (M * (M-1)^(M-2) - 1)

let f(n) = M * n / (M-1) + 1

The answer for the minimum number of apples N to start with is then

N = f( f( f( ... f( h(M) ) ... ) ) )

... where f() is applied recursively, M-1 times.

I'm happy to see that this follows the form I suggested for the general answer, with i being h(M) above, j=0, and k=1. :D

If we were to restate the problem for 10 little monkeys the answer would be 9,999,999,991 apples instead of 3121.

Here are the solutions for M=3 up to M=10:

M N

=====

3 25

4 253

5 3121

6 46,651

7 823,537

8 16,777,209

9 387,420,481

10 9,999,999,991

The formula doesn't hold for M < 3. For M=2, it yields 3, when the correct answer is 7. This is because of the condition that after the final monkey is done, there must still be some apples left.

I think it holds, though, for all M >= 3. If anybody finds differently, let me know.

Edited by mrentropy
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...