Alice, Bob, and Carey start together and each walk home at a different constant speed. Once all three get home, they can have pancakes! Alice can walk home in 10 minutes, Bob can do it in 20, and Carey in 30. Fortunately, any of them can carry any of the others on their back without reducing their own walking speed. Assume that they can pick someone up, set someone down, and change direction instantaneously. What is the fastest they can get to eat pancakes?
Extra Credit
There is now a fourth: Dee. Dee is the slowest, needing 60 minutes to walk home. As before, anyone can carry anyone else, and they won’t get pancakes until everyone gets home. What is the fastest this can happen?
This seems like a logic puzzle at first glance, but it carries a nice geometric intuition. Specifically, imagine time on the $x$-axis and distance from home on the $y$-axis. If Alice, Bob, and Carey (I’ll just call them A, B, C from now on) walk at a constant speed, their paths show up as straight lines.
For the first problem, the optimal thing to do is as follows:
- A+C ride together, and B rides alone.
- At some point, A drops off C and returns to meet with B.
- C continues home alone.
- A meets up with B, picks them up, and A+B ride home together.
The optimal thing to have happen is for A,B,C to all arrive home at the same time, as illustrated in the diagram below. If C arrived home before A+B, then A should have dropped them off earlier and hence arrived home earlier with B. Likewise, if C arrived home after A+B, then A should have dropped them off later so they could arrive home sooner.
In the diagram, blue lines have “A slope” $\pm 1$, green lines have “B slope” $\pm\frac{1}{2}$, and red lines have “C slope” $\pm\frac{1}{3}$. The points of interest are F, G, H, as shown. I wrote in their coordinates in terms of unknowns $p,q,r$ in units of 10 minutes. We now have three equations:
- FG has slope $1$, therefore $p-\tfrac{1}{2}q = q-p$
- GH has slope $-1$, therefore $1-\tfrac{1}{2}q = r-q$
- FH has slope $-\frac{1}{3}$, therefore $1-p=\tfrac{1}{3}(r-p)$
Solving these equations, we obtain
\[
p=\frac{3}{4},\quad q=1,\quad r=\frac{3}{2}.
\]Since I used units of 10 minutes, the arrival time is $10r = 10 \cdot \frac{3}{2}$ minutes, or exactly 15 minutes.
Note: I’d like to thank commenter TLK for pointing out an error in a previous version of my solution. I was a bit hasty in my first write-up and presumed that A would carry C all the way home before returning to fetch B!
Extra credit
For the extra credit, the solution is quite a bit more complicated:
- A+D ride together, and B+C ride together
- At some point, A drops off D and returns to meet with B.
- D continues toward home.
- A meets up with B, returns home with B, and C continues alone.
- A+B meet up with D, B carries D home and A turns back.
- A meets up with C and carries C home.
Once again, the optimal thing to have happen is for A,B,C,D to all arrive home at the same time. Here is the corresponding diagram.
This time, we have more equations and more variables.
- FG has slope $1$, therefore $p-\tfrac{1}{2}q = q-p$.
- FH has slope $-\tfrac{1}{6}$, therefore $H = (p+s,1-p-\tfrac{1}{6}s)$ for some $s$.
- GJ has slope $-\tfrac{1}{3}$, therefore $J = (q+r,1-\tfrac{1}{2}q-\tfrac{1}{3}r$.
- GH has slope $-1$, therefore $p+s-q=p+\tfrac{1}{6}s-\tfrac{1}{2}q$
- HJ has slope $1$, therefore $q+r-p-s=p+\tfrac{1}{6}s-\tfrac{1}{2}q-\tfrac{1}{3}r$.
- HK has slope $-\tfrac{1}{2}$, therefore $1-p-\tfrac{1}{6}s = \tfrac{1}{2}(t-p-s)$.
- JK has slope $-1$, therefore $1-\tfrac{1}{2}q-\tfrac{1}{3}r=t-q-r$.
Solving these equations, we obtain:
\[
p= \frac{5}{8},\quad
q= \frac{5}{6},\quad
r= \frac{7}{16},\quad
s= \frac{1}{2},\quad
t= \frac{41}{24}.
\]The arrival time is $10t=\frac{205}{12}$ minutes, or 17.0833 minutes, or exactly 17 minutes and 5 seconds.
Note: I’d like to thank commenter Sanandan Swaminathan for pointing out an error in a previous version of my solution. Once again, I was a bit hasty in my first write-up and presumed that A would pick up C on their first return trip, when in fact it’s better for A to pick up B! Here is a diagram of the previous (sub-optimal) solution I found, which only achieves 17.8125 minutes, or 17 minutes and 48.75 seconds.
There’s a better strategy for the first part, and by analogy probably for the extra credit too.
Instead of dropping C at home, A drops him earlier at point X. Then returns to fetch B, while C continues independently.
X is selected in such a way that all three arrive together.
I got 15 minutes with this approach.
The intuition here is that you don’t want any of them waiting at the destination when they could be walking.
You’re absolutely right! I had a feeling I was missing something… I’ll update my solution once I figure it out!
Done! I updated my solution. Thanks again for pointing out the error in my previous version!
Nice visualization. The 4-person problem can be optimized further, down to 17 minutes 5 seconds. Let the start point be at 0 and destination at 1. Let A carry C, and B carry D. Let A drop C off at some point x, and then A walks back. Since A moves twice as fast as B, A will walk back a length x/3 to meet B/D. Then A carries B, and walks forward (towards destination) a length of x/3 + y, where y is the length moved by C after being dropped off earlier by A. Since A moves thrice as fast as C, we have x/3 + x/3 + y = 3y, so x = 3y. When A/B meet C, B carries C to destination (a length of 1-x-y). A walks back to meet D. If D moved a length z between hopping off B earlier and meeting A again, then A walked 2(x/3 + y) -z = 4y -z during that time. Since A is 6 times as fast as D, we get 6z = 4y -z, so z = 4y/7. Then, A carries D, and they reach the destination at the same time as B/C (no point in anyone reaching early). During the time that B/C walked a length of 1-x-y to reach the destination, A walked 2(x/3 + y – z) + (1-x-y). Since A walks twice as fast as B, we get 2(x/3 + y – z) + (1-x-y) = 2(1-x-y), so 2(2y – 4y/7) = 1-4y, so y = 7/48. Hence x = 3y = 21/48. Since all 4 reach the destination simultaneously, time taken by them = time taken by C = x*10 + y*30 + (1-x-y)*20 = 30y + 30y + 20 – 80y = 20 -20y = 20 – 20*(7/48) = 205/12 = 17.0833… minutes, so 17 minutes 5 seconds. The same can be achieved with: A first carries and drops D at some point x. A walks back and picks up B, A carries B to D, and B carries D to the destination. A walks back to C, and carries C to the destination. All 4 reach the destination in the same 205/12 minutes.
Oh wow… Solving this puzzle has been humbling to say the least. Looks like I need to update my solution once again! Thanks!
I’ve been thinking about how I could model this as an optimization problem but I haven’t been able to come up with a good way to do it. It would be nice to have some assurance that this is indeed the optimal solution and there isn’t yet another even more clever way to solve the problem…
I updated my solution. Thanks again!
A more comprehensive approach
https://bogdanlata.github.io/projects/fiddler_pancakes/
Thanks