English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Five pirates raid the ship of a wealthy bureaucrat and steal his trunk of
gold pieces. By the time they get the trunk aboard, dusk has fallen, so they
agree to split the gold the next morning.
But the pirates are all very greedy. During the night one of the pirates
decides to take some of the gold pieces for himself. He sneaks to the trunk
and divides the gold pieces into five equal piles, with one gold piece left
over. He puts the gold piece in his pile, hides it, puts the other four
piles back in the trunk, and sneaks back to bed.
One by one, the remaining pirates do the same. They sneak to the trunk,
divide the coins into five piles, with always one coin left over. Each
pirate puts the gold coin in his own pile, hides it, and puts the remaining
four piles back in the trunk.

Please show work?

2006-10-01 14:31:48 · 3 answers · asked by Jeffrey Z 1 in Science & Mathematics Mathematics

3 answers

Let us denote the final amount of coins in the pile by x. Let f(x)=5x/4+1. Then f(x) is the amount of coins left after four pirates have accessed the pile, but before the fifth. f(f(x)) is the amount left after three pirates, and by extension, f(f(f(f(f(x))))) is the initial amount of coins left in the pile. Let F(x)=f(f(f(f(f(x))))). Then it is sufficient to find the smallest positive integer x for which F(x) is an integer, and then F(x) will be the smallest number of coins there could have been in the trunk.

Now we need to find F(x):

f(x) = (5x+4)/4
f(f(x)) = (5(5x+4)/4 + 4)/4 = ((25x+20)/4 + 16/4)/4 = (25x+36)/16
f(f(f(x))) = (5(25x+36)/16 + 4)/4 = (125x+244)/64
f(f(f(f(x)))) = (5(125x+244)/64 + 4)/4 = (625x+1476)/256
F(x) = (5(625x+1476)/256 + 4)/4 = (3125x + 8404)/1024

For this to be an integer, we must have 3125x + 8404 ≡ 0 mod 1024. 8404=8*1024+212, and 3125=3*1024+53, thus we have 53x + 212 ≡ 0 mod 1024, and thus 53x ≡ 812 mod 1024. The multiplicative inverse of 53 mod 1024 is 541 (this may be found, for instance, by the extended euclidean algorithm), so multiplying both sides by 541 yields:

x ≡ 1020 mod 1024

Thus the lowest positive value of x which could possibly suffice is 1020. And F(x) is therefore 3121.

Thus the smallest number of coins that could have been in the trunk originally is 3121.

2006-10-01 15:18:14 · answer #1 · answered by Pascal 7 · 1 0

Previous answer is correct, but perhaps it's easier to understand if the initial part is done differently. Let:

J0 = initial number of coins
J1 = coins left after pirate1 = 4/5 * (J0 - 1) = 4/5 * J0 - 4/5
J2 = left after pirate2 = 4/5 * (J1 - 1) = (4/5)^2 * J0 - (4/5)^2 - 4/5
...
J5 = (4/5)^5 * J0 - (4/5)^5 - (4/5)^4 - ... - (4/5)

which simplifies to,
5^5 * J5 = 4^5 * J0 - (4^5 + 5 * 4^4 + 5^2 * 4^3 + ... + 5^4 * 4)
3125 * J5 = 1024 * J0 - 8404
3125 * J5 + 8404 = 1024 * J0
3125 * J5 ≡ -8404 mod 1024

From here I would duplicate the previous poster's steps to get,
min (J5) = 1020,
and then substitute that into the above equation,
3125 * J5 + 8404 = 1024 * J0
to get J0 = 3121

2006-10-01 23:34:30 · answer #2 · answered by Joe C 3 · 0 0

First,

What the heck is the question?

Second

when the first pirate comes over to take the gold peice,

say two different things, Id rewrite this if i were you

2006-10-01 21:35:55 · answer #3 · answered by sur2124 4 · 0 1

fedest.com, questions and answers