Hacker News new | ask | show | jobs
by xelxebar 3178 days ago
Well, if you're familiar with sums, then the "shortcut" isn't all that much faster; it's mostly a function of how quickly you can grok the salient points:

The fly travels 3/2 times the speed of a train, so every bounce the fly travels 3/5 of the remaining track and leaves 1/2 * 2/5 = 1/5 track to travel, so we just compute the geometric sum

    3/5 * \sum 1/5^r = 3/5 * 1/(1 - 1/5)
                     = 3/5 * 1/(4/5)
                     = 3/5 * 5/4
                     = 3/4.
One nice thing about this sum is that it encodes a bit more insight about the fly's flight path than the shortcut method.