CTK Exchange
Front Page
Movie shortcuts
Personal info
Awards
Reciprocal links
Terms of use
Privacy Policy

Interactive Activities

Cut The Knot!
MSET99 Talk
Games & Puzzles
Arithmetic/Algebra
Geometry
Probability
Eye Opener
Analog Gadgets
Inventor's Paradox
Did you know?...
Proofs
Math as Language
Things Impossible
My Logo
Math Poll
Other Math sit's
Guest book
News sit's

Recommend this site

Manifesto: what CTK is about |Store| Search CTK Buying a book is a commitment to learning Table of content Things you can find on CTK Chronology of updates Email to Cut The Knot Recommend this page

CTK Exchange

Subject: "Men and Pennies"     Previous Topic | Next Topic
Printer-friendly copy     Email this topic to a friend    
Conferences The CTK Exchange High school Topic #255
Reading Topic #255
Bractals
Member since Jun-9-03
Jul-25-03, 02:40 PM (EST)
Click to EMail Bractals Click to send private message to Bractals Click to view user profileClick to add this user to your buddy list  
"Men and Pennies"
 
   Hi,

Below is a generalization of a problem you have probably seen before as the Monkey and Coconuts problem with five men and each giving the monkey one coconut.

M men ( M > 1 ) were stranded on a desert island. While exploring the island they found a cave containing a beautiful urn. When they touched the urn a genie appeared. The genie gave them a large pile of pennies for freeing her - she was a poor genie. Since it was late, they decided to wait till the next morning before dividing the pennies amongst themselves. That night one of the men decides to take his share himself. He divides the pile of pennies into M equal piles, with N pennies left over ( 0 < N < M ). He drops the N pennies into the urn, hides one of the piles in the cave, and puts the remaining piles back into a single pile. During the night each of the remaining men does the same thing - dropping N pennies into the urn to make the pile divide equally. When morning comes the men go to the cave to divide the pennies - no one mentions how the pile has shrunk. The pile divides equally into M piles and each man gets one. If Q(M,N) represents the smallest possible number of pennies that the genie gave the men, then give a formula in terms of M and N for Q(M,N).

Bractals


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote | Top
Vladimir
Member since Jun-22-03
Jul-26-03, 06:42 AM (EST)
Click to EMail Vladimir Click to send private message to Vladimir Click to view user profileClick to add this user to your buddy list  
1. "RE: Men and Pennies"
In response to message #0
 
   As far as I remember the monkey and the coconuts, the monkey got 1 coconut in the morning as well. There was this funny solution with negative coconuts: Start with a pile of 4 negative coconuts. The first guy divides the pile into 5 - 5 negative coconuts plus 1 positive for the monkey. He pockets 1 negative coconut and leaves the remaining 4 negative coconuts for the next guy. The next guy is obviously in the same position as the first one, etc. In the morning, there is still a pile of 4 negative coconuts. This is equally divided between the 5 men, each getting 1 more negative coconut, and the monkey gets the remaining positive 1.

Anyway the formula between the initial number of coconuts Q and the number of coconuts n each guy gets in the morning is

56(n + 1) = 45(Q + 4)

The solution requires summing a finite geometric sequence in the process. As we are looking for an integer solution, the funny solution is the trivial one: Q = -4, n = -1. The first positive solution is

Q = 56 - 4 = 15621
n = 45 - 1 = 1023

Assuming that your men return N pennies into the urn after dividing the remaining pile in the morning (you say that there was nothing left), the solution process is exactly the same as for the monkey and the coconuts:

MM+1(n + N) = (M - 1)M{Q + (M - 1)N}

(each men gets n pennies in the morning). The funny solution is

Q = -(M - 1)N
n = -N

and the first positive one

Q = MM+1 - (M - 1)N
n = (M - 1)M - N


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote | Top
sfwc
Member since Jun-19-03
Jul-26-03, 06:42 AM (EST)
Click to EMail sfwc Click to send private message to sfwc Click to view user profileClick to add this user to your buddy list  
2. "RE: Men and Pennies"
In response to message #0
 
   It makes me feel awful to post such an ugly formula, but here it is:

Q(M,N) = (M - N)*M^M - N*(M - 1) when M is even
Q(M,N) = N*M^M - N*(M - 1) when M is odd
If piles of 0 pennies are not allowed, there is 1 exception to this:
Q(2,1) = 27, not 3.

Thankyou

sfwc
<><


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote | Top
Bractals
Member since Jun-9-03
Jul-26-03, 09:59 AM (EST)
Click to EMail Bractals Click to send private message to Bractals Click to view user profileClick to add this user to your buddy list  
3. "RE: Men and Pennies"
In response to message #2
 
   Hi sfwc,

I got the same ugly formula; except for Q(2,1) I got 11, not 27.

27 = 2*13 + 1
13 = 2*6 + 1
6 = 2*3

11 = 2*5 + 1
5 = 2*2 + 1
2 = 2*1

Thanks

Bractals


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote | Top
sfwc
Member since Jun-19-03
Jul-26-03, 01:06 PM (EST)
Click to EMail sfwc Click to send private message to sfwc Click to view user profileClick to add this user to your buddy list  
4. "RE: Men and Pennies"
In response to message #3
 
   Sorry, my silly mistake (4*3 = 28?)

Thankyou for sorting it out

sfwc
<><


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote | Top
Vladimir
Member since Jun-22-03
Jul-26-03, 01:28 AM (EST)
Click to EMail Vladimir Click to send private message to Vladimir Click to view user profileClick to add this user to your buddy list  
5. "RE: Men and Pennies"
In response to message #2
 
   LAST EDITED ON Aug-10-03 AT 02:51 AM (EST)
 
Hi Bractals and Nathan,

"When posting a problem, make sure to show your work". Please. It is written at the top of this window in red. Since you did not (for this problem), I will. I hope that other visitors will appreciate that.

First, back to the monkey and the coconuts. Apparently, there are 2 versions of the puzzle. In the first version, each guy divides the pile, pockets his share, and gives the remaining 1 coconut to the monkey. In the second version, each guy divides the pile (without any remainder), pockets his share, and after that the monkey steals 1 coconut. In both versions, the monkey gets 1 coconut in the morning. Let Q be the initial pile of coconuts and n the number of coconuts each guy gets in the morning. The pile is depleted like this:

1. version (monkey is given 1 coconut before dividing):

Q
(Q - 1)·4/5
((Q - 1)·4/5 - 1))·4/5
(((Q - 1)·4/5 - 1))·4/5 - 1)·4/5
((((Q - 1)·4/5 - 1))·4/5 - 1)·4/5 -1)·4/5
(((((Q - 1)·4/5 - 1))·4/5 - 1)·4/5 -1)·4/5 - 1)·4/5 = 5n + 1

(5 lines not counting the first)

Q·(4/5)5 - (4/5)5 - (4/5)4 - (4/5)3 - (4/5)2 - 4/5 = Q·(4/5)5 - G = 5n + 1

The sum of the finite geometric sequence G is

G = 4/5·(1 - (4/5)5)/(1 - 4/5) = 4 - 4·(4/5)5

Q·(4/5)5 - 4 + 4·(4/5)5 = 5n + 1

Multiplying the equation by 55 we get

45(Q + 4) = 56(n + 1)

The trivial solution is n = -1 and q = -4 and the smallest positive solution is n = 45 - 1 = 1023, Q = 56 - 4 = 15621.

2. version (monkey steals 1 coconut after dividing):

Q
Q·4/5 - 1
(Q·4/5 - 1)·4/5 - 1
((Q·4/5 - 1)·4/5 - 1)·4/5 - 1
(((Q·4/5 - 1)·4/5 - 1)·4/5 -1)·4/5 - 1
((((Q·4/5 - 1)·4/5 - 1)·4/5 -1)·4/5 - 1)·4/5 - 1 = 5n + 1

(5 lines not counting the first)

Q·(4/5)5 - (4/5)4 - (4/5)3 - (4/5)2 - 4/5 - 1 = Q·(4/5)5 - G = 5n + 1

The sum of the finite geometric sequence G is

G = (1 - (4/5)5)/(1 - 4/5) = 5 - 5·(4/5)5

Q·(4/5)5 - 5 + 5·(4/5)5 = 5n + 1

Multiplying the equation by 55 we get

45(Q + 5) = 55(5n + 5 + 1)

There is no trivial integer solution. The smallest positive solution will be for

5n + 5 + 1 = 45·k
n = (45·k - 1)/5 - 1

where k > 0 is an integer. Since 45 = 1024 and we need the lowest multiple ending by 6, obviously k = 4 and 45·k = 4096.

n = (4096 - 1)/5 - 1 = 818
Q = 55·k - 5 = 3125·4 - 5 = 12495

Personally, I think that the absence of the trivial solutuion with negative coconuts takes away all fun from the 2nd version.

Finally, I am getting to the genie problem: Q pennies to start with, M > 1 men, each drops 0 < N < M pennies back to the urn (the remainder of dividing), and the last division in the morning has no remainder. Let n be the number of pennies each guy gets in the morning. The pile of penies is depleted in the same manner as in the 1st version of the monkey and the coconuts problem - the only difference is that the last line does not equal to Mn + N but to Mn:

Q
(Q - N)·(M-1)/M
((Q - N)·(M-1/M - N))·(M-1)/M
(((Q - N)·(M-1)/M - N))·(M-1)/M - N)·(M-1)/M
...
(...(((Q - N)·(M-1)/M - N))·(M-1)/M - N)·(M-1)/M - ... - N)·(M-1)/M = Mn

(M lines not counting the first)

Q·((M-1)/M)M - N·((M-1)/M)M - N·((M-1)/M)M-1 - ... - N·(M-1)/M = Q·((M-1)/M)M - G = Mn

The sum of the finite geometric sequence G is

G = N·(M-1)/M·(1 - ((M-1)/M)M)/(1 - (M-1)/M) = N(M - 1)(1 - ((M-1)/M)M)

Q·((M-1)/M)M - N(M - 1) + N(M - 1)·((M-1)/M)M = Mn

Multiplying the equation by MM we get

(M - 1)M·(Q + N(M - 1)) = MM·(Mn + N(M - 1))

Trying

Mn + N(M - 1) = 0
n = N - 1/M

we see that n would not be an integer and therefore there is no trivial solution. The smallest positive solution will be for

Mn + N(M - 1) = (M - 1)M·k

where k > 0 is an integer:

n = ((M - 1)M·k - NM + N)/M

We can imagine (M - 1)M·k as a binomial sum in which every member but the last one is divisible by M. If M is even, the last member is +k, and if M is odd, the last member is -k. Since n must be an integer

N + k must be divisible by M if M is even
N - k must be divisible by M if M is odd

As we are looking for the smallest k > 0 possible, we can use

k = M - N if M is even
k = N if M is odd

If M = 2, the only possibility for N is N = 1. For k = M - N = 2 - 1 = 1 we get n = ((2 - 1)2·(2 - 1) - 1·2 + 1)/2 = 0, which is not acceptable. Therefore, for M = 2 we have to use k = M - N + M = 2M - N = 4 - 1 = 3. For M > 2, n is always positive.

In conclusion:

n = ((2 - 1)2·3 - 1·(2 - 1))/2 = 1 if M = 2
n = ((M - 1)M(M - N) - N(M - 1))/M if M > 2 is even
n = ((M - 1)MN - N(M - 1))/M if M > 1 is odd

Since

Q + N(M - 1) = MM·k

Q = 22·3 - 1·(2 - 1) = 11 if M = 2
Q = MM(M - N) - N(M - 1) if M > 2 is even
Q = MMN - N(M - 1) if M > 1 is odd


  Alert | IP Printer-friendly page | Edit | Reply | Reply With Quote | Top

Conferences | Forums | Topics | Previous Topic | Next Topic

You may be curious to have a look at the old CTK Exchange archive.
Please do not post there.

|Front page| |Contents|

Copyright © 1996-2018 Alexander Bogomolny

73177483