Solution to the Problem:
The most bananas that Carrie can get to market appears to be 833.
When I first posted this problem, I believed that Carrie could get at most 750 bananas to the market.
However, several of you sent in the solution of 833, and it worked! I was afraid that when I retired,
my brain would turn to mush, and maybe that's what happened!! Anyway, here is James Alarie's excellent
explanation:
Carrying any number of bananas up to 1000 any distance forward costs 1 banana per mile.
No matter how you do it, moving 1001-2000 bananas forward costs 2 bananas per mile, and 2001-3000
bananas costs 3 bananas per mile. You lose 999 bananas in the first 333 miles, 1000 bananas in
the next 500 miles, and 167 bananas in the remainder of the trip. This leaves you with 834 bananas.
To actually carry out the above move:
1. pick up 1000 bananas from the plantation, move them 333 miles toward the market, and leave the remaining 667 bananas at that point.
2. go back to the plantation, pick up another 1000 bananas, move them 333 miles toward the market, find the 667 bananas that you left there on the previous trip, pick up 333 of them so that you now have 1000 bananas on Carrie, move forward another 500 miles, and drop the remaining 500 bananas there.
3. go back to the plantation, pick up 999 bananas, move them 333 miles toward the market, find the 334 left there on the previous trip, add them to the load of 666 bananas already on Carrie for a total of 1000, move forward 500 miles, pick up the 500 bananas left there on the previous trip so that you now have 1000 bananas on Carrie, travel the remaining 167 miles to market, deliver 833 bananas to market.
4. go back to the plantation and eat the remaining banana yourself.
James Alarie took the problem to another level. He asked, "What if you have 4000 bananas available? Or 5000, 6000, ...? Is there an equation for this?"
He then sent in the following analysis:
I based my work on the
idea that moving X bananas one more mile toward market will cost
(X/1000) bananas per mile rounded up. If I have 3000 bananas at the
beginning, then the first mile will cost me three bananas, and each
suceeding mile will cost three bananas until the load is down to 2999.
Working in that way, I wrote a Javascript function to do the work and
called it with ever-increasing numbers of bananas to see what would
happen. To my surprise, not only did the number of bananas delivered
to market go over 1/3 of what I started with, but the percentage maxed
out and then started dropping at 52000 bananas! The best delivery
ratio which I could obtain was 35.698% with the following function:
function Market(K) {
M=0;' // mile marker
while ((M+(D=Math.floor(1000/D))) < 1000) {
M=M+D;
K=K-1;
}
return M*K;