Re: Apples delivery puzzle

Suppose the driver sets up 2,000 checkpoints. Hence, every checkpoint is half a mile apart. He takes 1,000 apples, drops them at the next checkpoint, then returns with an empty car (at the time he hits the 1 mile point where he would eat an apple, his car is empty). In this way, can he transfer all 3,000 apples, or in general, any arbitrary amount of apples?

If the driver actually eats half an apple over the course of half of a mile, then we need a different algorithm. Since 3,000 apples can be transported in a minimum of three car loads, he is guaranteed to be eating 3 apples per mile for some distance. To make this distance minimal, we want him to travel this distance at the exact moment that he has eaten through 1,000 apples. So, if he travels 1,000/3 miles, he will eat 1,000/3 apples each trip. This leaves 2,000/3 apples per trip times 3 trips equals 2,000 apples, just as we wanted. Now, he will make a minimum of 2 trips to some checkpoint to move the remaining 2,000 apples. If he travels a distance so that when he finishes moving all 2,000 apples, he has 1,000 apples remaining, then he will only make one more trip with the remaining apples and eat only 1 apple per mile. This will minimize the number of miles he will travel eating 2 apples per mile. So, if he drives 1,000/2 miles, he will eat 1,000/2 apples each trip, leaving 1,000 apples after his two trips. So, he now travelled 1,000/3 miles, then 1,000/2 miles, so he only has 1,000/6 miles left to go. Assuming we round up the number of apples he eats, this leaves 833 apples when he arrives at his destination. Since we minimized the distances where he ate more than one apple per mile, this should yield the maximum number of apples he can arrive with.

To generalize this for an arbitrary amount of apples: suppose he has more than n thousand, but fewer than n+1 thousand apples to start (where n is an integer). He will want to choose a checkpoint where after he transports all of his apples, he will only have n thousand apples left. So, if he has k apples, he will travel (k - n thousand)/(n+1) miles (transporting a maximum number of apples each time). Now, he has n thousand apples remaining (and so will eat n apples per mile for some distance). Now, he wants to arrive at his next checkpoint with n-1 thousand apples. So his next checkpoint will be 1,000/n miles away. If at any point, his destination is closer than his checkpoint, he should just take maximum loads of apples from his previous checkpoint to his destination.

Re: Apples delivery puzzle

That's a well-known problem, usually using a camel and 3000 bananas:

https://www.google.ca/?gws_rd=cr&ei=...mel+1000+miles