Mathematical Marginalia
Classical and Quaint Topics in Mathematics

Arnold's Fly

The following problem is number 17 from the paper Problems for children from 5 to 15  ([Arnold 2004]) by Wladimir Igorewitsch Arnold. We paraphrase it here, using symbolic values instead of the fixed numerical ones.

The distance between cities A and B is $d.$ Two cyclists leave respectively from $A$ and $B$ simultaneously towards one another, one with speed $v_a$ from $A$ to $B$ and the other with speed $v_b$ from $B$ to $A.$ A fly flies out with the first cyclist from $A$ with the speed of $v_f,$ reaches the second, touches his forehead and flies back (without retardation) to the first, touches his forehead, returnes to the second, and so on until the cyclists’ foreheads collide and squash the fly. How many kilometers altogether has the fly flown?

Obviously, Mr. Arnold prefers bloody-minded stories. The faint-hearted may replace the cyclists by radio controlled model cars and the fly by a radio controlled quadcopter, which returns without retardation, when the front of the corresponding model car is exactly below its camera. So, there will be no damage to animate beings.

Simple Solution

The two cyclists collide after the time $t.$ Up to this moment, one cyclist has covered the distance $s_a = v_a t,$ the other one $s_b = v_b t.$ In the moment of collision the equation \[s_a + s_b = d\] holds, so one can calculate $t$: $$ \begin{align*} v_a t + v_b t = d\\ (v_a+v_b)t = d\\ t = \frac{d}{v_a+v_b}\\ \end{align*} $$ The fly, enforcedly, stops at time $t$ as well. Up to that moment it covered the distance of \[s_f = v_f t = v_f\frac{d}{v_a+v_b}\]

If we insert the numeric values from Arnold's original problem, $d = 40\textrm{km},\quad v_a=10\textrm{km/h},\quad v_b=15\textrm{km/h},\quad v_f=100\textrm{km/h},$ we have: \[s_f = 100\frac{40}{10+15} = 160\textrm{km};\quad t = 1.6\textrm{h}\]

Series Expansion

However, there is a well known saying: Why take the easy way, if there is a hard one?  The distance, the fly has flown, should also be computable by summing up all the distances the fly flew in alternating directions between the foreheads of the two cyclists. Obviously, we will get an infinite series, and perhaps, because we know its value in advance, we will get a nice summation formula too.

At first, one can calculate the moment $t_1,$ when the fly touches the second cyclist, who rides from $B$ to $A$ in exactly the same manner as we did it for the two cyclists. You have only to replace $v_a$ by $v_f$: \[t_1 = \frac{d}{v_f+v_b}\] The fly has flown a distance of $v_f t_1$ at this moment, but we will do all our computations with the time values $t_1, t_2,\dots,$ the distances will come out at the very end by multiplication with $v_f.$

The second leg, the fly is now humming towards $A,$ can also be computed in that way, but now the cyclists don't start with the initial distance $d,$ but have already covered the distances $v_a t_1$ or $v_b t_1$ respectively. Hence the new distance is \[d_1 = d - (v_a + v_b)t_1 \] With this new distance the time $t_2,$ at which the fly touches the first cyclist, measured from the fly's reversal point $t_1$, can be computed: \[t_2 = \frac{d_1}{v_f+v_a}\] Now, below the fraction line there is $v_a$ instead of $v_b,$ because the fly is moving towards the first cyclist. The total flying time up to this moment is $t_1+t_2,$ but for the time being we will deal only with the times needed for the individual parts of the way between the reversal points.

These calculations repeat for all times $t_3, t_4,\dots$ between two reversal points. You get, separately for odd and even indices ($n=1,2,3,\dots$): \[t_{2n-1} = \frac{d_{2n-2}}{v_f+v_b}\] \[t_{2n} = \frac{d_{2n-1}}{v_f+v_a}\] and for the $d_n$ one has for all $n=1,2,\dots$: \[d_n = d_{n-1} - (v_a+v_b)t_n\] defining the initial values $d_0 = d$ and $t_0 = 0.$

For convenience we write $v_{ab}$ instead of $v_a+v_b,$ $v_{fa}$ instead of $v_f+v_a$ and $v_{fb}$ instead of $v_f+v_b$ and get: \[t_{2n-1} = \frac{d_{2n-2}}{v_{fb}}\] \[t_{2n} = \frac{d_{2n-1}}{v_{fa}}\] \[d_n = d_{n-1} - v_{ab}t_n\] From this you get a recursion formula for the $d_n,$ with odd and even $n$ taken separately: $$ \begin{align*} d_{2n} &= d_{2n-1}-v_{ab}t_{2n}\\ &= d_{2n-1}-v_{ab}\frac{d_{2n-1}}{v_{fa}}\\ &= d_{2n-1}(1-\frac{v_{ab}}{v_{fa}})\\ \end{align*} $$ and \[d_{2n-1} = d_{2n-2}(1-\frac{v_{ab}}{v_{fb}})\] So we have: $$ \begin{align*} d_{0} &= d\\ d_{1} &= d_0(1-\frac{v_{ab}}{v_{fb}})= d(1-\frac{v_{ab}}{v_{fb}})\\ d_{2} &= d_1(1-\frac{v_{ab}}{v_{fa}})= d(1-\frac{v_{ab}}{v_{fb}})(1-\frac{v_{ab}}{v_{fa}})\\ d_{3} &= d_2(1-\frac{v_{ab}}{v_{fb}})= d(1-\frac{v_{ab}}{v_{fb}})^2(1-\frac{v_{ab}}{v_{fa}})\\ d_{4} &= d_3(1-\frac{v_{ab}}{v_{fa}})= d(1-\frac{v_{ab}}{v_{fb}})^2(1-\frac{v_{ab}}{v_{fa}})^2\\ \end{align*} $$ or generally for $k \geq 1$: $$ \begin{align*} d_{2k-1} &= d(1-\frac{v_{ab}}{v_{fb}})^k(1-\frac{v_{ab}}{v_{fa}})^{k-1}\\ d_{2k} &= d(1-\frac{v_{ab}}{v_{fb}})^k(1-\frac{v_{ab}}{v_{fa}})^k\\ \end{align*} $$ and correspondingly for the $t_k$ with $k \geq 1$: $$ \begin{align*} t_{2k-1} &= \frac{d_{2k-2}}{v_{fb}} = \frac{d}{v_{fb}}(1-\frac{v_{ab}}{v_{fb}})^{k-1}(1-\frac{v_{ab}}{v_{fa}})^{k-1}\\ t_{2k} &= \frac{d_{2k-1}}{v_{fa}} = \frac{d}{v_{fa}}(1-\frac{v_{ab}}{v_{fb}})^k(1-\frac{v_{ab}}{v_{fa}})^{k-1}\\ \end{align*} $$ Now we can apply the formula $\sum_{k=0}^\infty{q^k}=1/(1-q)$ for the sum of the geometric series: $$ \begin{align*} \sum_{k=1}^\infty{t_{2k-1}}&=\sum_{k=1}^\infty{\frac{d}{v_{fb}}(1-\frac{v_{ab}}{v_{fb}})^{k-1}(1-\frac{v_{ab}}{v_{fa}})^{k-1}}\\ &= \frac{d}{v_{fb}}\sum_{k=0}^\infty{(1-\frac{v_{ab}}{v_{fb}})^k(1-\frac{v_{ab}}{v_{fa}})^k}\\ &= \frac{d}{v_{fb}}\frac{1}{1-(1-\frac{v_{ab}}{v_{fb}})(1-\frac{v_{ab}}{v_{fa}})}\\ \end{align*} $$ or respectively $$ \begin{align*} \sum_{k=1}^\infty{t_{2k}}&=\sum_{k=1}^\infty{\frac{d}{v_{fa}}(1-\frac{v_{ab}}{v_{fb}})^k(1-\frac{v_{ab}}{v_{fa}})^{k-1}}\\ &= \frac{d}{v_{fa}}(1-\frac{v_{ab}}{v_{fb}})\sum_{k=1}^\infty{(1-\frac{v_{ab}}{v_{fb}})^{k-1}(1-\frac{v_{ab}}{v_{fa}})^{k-1}}\\ &= \frac{d}{v_{fa}}(1-\frac{v_{ab}}{v_{fb}})\sum_{k=0}^\infty{(1-\frac{v_{ab}}{v_{fb}})^{k}(1-\frac{v_{ab}}{v_{fa}})^{k}}\\ &= \frac{d}{v_{fa}}(1-\frac{v_{ab}}{v_{fb}})\frac{1}{1-(1-\frac{v_{ab}}{v_{fb}})(1-\frac{v_{ab}}{v_{fa}})} \end{align*} $$

The series converge, if $v_{fb} > v_{ab}$ and $v_{fa} > v_{ab},$ in other words, if the speed of the fly $v_f$ is greater than both the speed $v_a$ of the first cyclist and that of the second cyclist $v_b.$ That's no surprise, because otherwise the fly would lag behind one of the cyclists, and these would collide without the fly being between their foreheads. The fly will survive in this case!

The sum of the two sums is: $$ \begin{align*} \sum_{k=1}^\infty{t_k} &= \frac{d}{v_{fb}}\frac{1}{1-(1-\frac{v_{ab}}{v_{fb}})(1-\frac{v_{ab}}{v_{fa}})} + \frac{d}{v_{fa}}(1-\frac{v_{ab}}{v_{fb}})\frac{1}{1-(1-\frac{v_{ab}}{v_{fb}})(1-\frac{v_{ab}}{v_{fa}})} \\ &= (\frac{d}{v_{fb}}+\frac{d}{v_{fa}}(1-\frac{v_{ab}}{v_{fb}}))\frac{1}{1-(1-\frac{v_{ab}}{v_{fb}})(1-\frac{v_{ab}}{v_{fa}})} \end{align*} $$ At this moment it seems to be a good idea, to insert the original numeric values of Arnold, in order to verify, that we did not run havoc.

It is $d = 40,\; v_a = 10,\; v_b = 15,\; v_f = 100$

and thus $v_{ab} = v_a + v_b = 25,$ $v_{fa} = v_a + v_f = 110,$ $v_{fb} = v_b + v_f = 115.$

One computes: $$ \begin{align*} 1-\frac{v_{ab}}{v_{fb}} &= 1-25/115 = 0.7826087\\ 1-\frac{v_{ab}}{v_{fa}} &= 1- 25/110 = 0.77272727 \end{align*} $$ and \[ \frac{1}{1-(1-\frac{v_{ab}}{v_{fb}})(1-\frac{v_{ab}}{v_{fa}})} = \frac{1}{1-0.7826087 \cdot 0.77272727} = 2.53 \] Hence $$ \begin{align*} \sum_{k=1}^\infty{t_k} &= (40/115+40/110\cdot0.7826087)\cdot 2.53 \\ &= (0.34783 + 0.284585)\cdot 2.53 \\ & = 1.600009904 \end{align*} $$ The sum is (round-off errors neglected) identical with the value of $t,$ we have computed by the simple method.

Of course, it should be possible to get this result by symbolic calculation, too. So let's start to simplify the first factor: $$ \begin{align*} (\frac{d}{v_{fb}}+\frac{d}{v_{fa}}(1-\frac{v_{ab}}{v_{fb}})) &= d(\frac{v_{fa}}{v_{fa}v_{fb}}+(\frac{v_{fb}}{v_{fb}v_{fa}}-\frac{v_{ab}}{v_{fb}v_{fa}}))\\ &= d \cdot \frac{{v_{fa}+v_{fb}}-v_{ab}}{v_{fb}v_{fa}} \end{align*} $$ With the second factor we compute the denominator at first: $$ \begin{align*} 1-(1-\frac{v_{ab}}{v_{fb}})(1-\frac{v_{ab}}{v_{fa}}) &= 1 - \frac{(v_{fb}-v_{ab})(v_{fa}-v_{ab})}{v_{fb}v_{fa}}\\ &= 1- \frac{v_{fb}v_{fa}-v_{ab}v_{fa}-v_{fb}v_{ab}+v_{ab}^2}{v_{fb}v_{fa}}\\ &= \frac{v_{ab}v_{fa}+v_{fb}v_{ab}-v_{ab}^2}{v_{fb}v_{fa}}\\ &= \frac{v_{ab}(v_{fa}+v_{fb}-v_{ab})}{v_{fb}v_{fa}} \end{align*} $$ Hence we have $$ \begin{align*} \sum_{k=1}^\infty{t_k} &= (\frac{d}{v_{fb}}+\frac{d}{v_{fa}}(1-\frac{v_{ab}}{v_{fb}}))\frac{1}{1-(1-\frac{v_{ab}}{v_{fb}})(1-\frac{v_{ab}}{v_{fa}})}\\ &= d\cdot\frac{{v_{fa}+v_{fb}}-v_{ab}}{v_{fb}v_{fa}}\cdot\frac{v_{fb}v_{fa}}{v_{ab}(v_{fa}+v_{fb}-v_{ab})}\\ &= \frac{d}{v_{ab}}\\ &= \frac{d}{v_a+v_b}\\ &= t \end{align*} $$ and so finally arrived at the same value of $t$ as we did taking the easy way.