# Meeting of 8 flies [closed]

In the following diagram 8 flies are located at the corners of a cubic room, 10 feet on each side. At time 0 each fly starts to fly towards its neighbor fly as indicated in the diagram. Their speed of flight is 5 feet/sec. Each fly continues to fly towards its neighbour, and corrects its flight direction as its neighbour fly moves. Will their movement converge? Where? How long will it take for them to meet? Will they meet in the same time?

• Do you have a simple way to determine the time? The approach used for the 2D case does not work here because the angles do not remain the same.
– f''
Aug 24, 2016 at 6:15
• Yes there is a simple way to determine the time. And why you claim the angel does not remain the same? See the simulation by Alexis.
– Moti
Aug 24, 2016 at 6:16
• As soon as they start moving, angle BCD starts increasing above 90 degrees. In the 2D case,the rotation of BC and CD would cancel out and keep the angle constant, but because BC and CD are rotating in different planes here, it does not cancel.
– f''
Aug 24, 2016 at 6:22
• The original problem relies on the fact that while fly A is moving toward fly B, that B continually moves in a direction perpendicular to A-B, so that the distance that A travels does not change by B's movement. If any of the angles becomes different to 90 degrees, the distance travelled and hence the time needed will change. In this case BCD becomes larger than 90, so C is moving partially away from B, and B will need more than 2 seconds to reach C (unless that angle somehow gets smaller later to compensate). Aug 24, 2016 at 8:02
• This seems like a mathbook-type problem to me, not a math puzzle. Aug 24, 2016 at 8:18

Here's a simulated solution using Mathematica.

The flight paths will look like this:

They will

converge in a little under 4 seconds.

Here's the code for the image:

a[1] := {1, 1, 1}
b[1] := {0, 1, 1}
c[1] := {0, 0, 1}
d[1] := {1, 0, 1}
e[1] := {1, 0, 0}
f[1] := {0, 0, 0}
g[1] := {0, 1, 0}
h[1] := {1, 1, 0}

s := 0.001
n := 2/s
For[i = 1, i <= n, i++, If[Norm[b[i] - a[i]] < s, Break[]];
a[i + 1] = a[i] + s (b[i] - a[i])/Norm[b[i] - a[i]];
b[i + 1] = b[i] + s (c[i] - b[i])/Norm[c[i] - b[i]];
c[i + 1] = c[i] + s (d[i] - c[i])/Norm[d[i] - c[i]];
d[i + 1] = d[i] + s (e[i] - d[i])/Norm[e[i] - d[i]];
e[i + 1] = e[i] + s (f[i] - e[i])/Norm[f[i] - e[i]];
f[i + 1] = f[i] + s (g[i] - f[i])/Norm[g[i] - f[i]];
g[i + 1] = g[i] + s (h[i] - g[i])/Norm[h[i] - g[i]];
h[i + 1] = h[i] + s (a[i] - h[i])/Norm[a[i] - h[i]];]

ListPointPlot3D[
Flatten[Table[{a[i], b[i], c[i], d[i], e[i], f[i], g[i], h[i]}, {i,1, n}], 1],
PlotStyle -> PointSize[Small] , AspectRatio -> 1]


For the time I used a smaller s and counted the total number of steps times the length of each step

s := 0.00001
n := 2/s
For[i = 1, i <= n, i++, If[Norm[b[i] - a[i]] < s, Break[]];
a[i + 1] = a[i] + s (b[i] - a[i])/Norm[b[i] - a[i]];
b[i + 1] = b[i] + s (c[i] - b[i])/Norm[c[i] - b[i]];
c[i + 1] = c[i] + s (d[i] - c[i])/Norm[d[i] - c[i]];
d[i + 1] = d[i] + s (e[i] - d[i])/Norm[e[i] - d[i]];
e[i + 1] = e[i] + s (f[i] - e[i])/Norm[f[i] - e[i]];
f[i + 1] = f[i] + s (g[i] - f[i])/Norm[g[i] - f[i]];
g[i + 1] = g[i] + s (h[i] - g[i])/Norm[h[i] - g[i]];
h[i + 1] = h[i] + s (a[i] - h[i])/Norm[a[i] - h[i]];]
(i - 1) s


which returns 1.96457.

This is for a unit cube with unit velocity. Double the time for the case where the cubes have sides of length 10 feet and the velocity is 5 feet / second.

Front:

Side:

Rotating:

Note that the flies do not

maintain the cubic shape as they spiral inward. In fact, the angles between two adjacent fly trajectories follows one of the two paths shown in this graph where the y-axis is given in degrees.

For reference, here's a math paper on cyclic pursuits in more general cases:

Ants, Crickets and Frogs in Cyclic Pursuit

• Yeah. Certainly not a proper solution, but rather a springboard to visualize the problem and get a general idea of what is going on. You should choose whoever can actually prove it. Aug 24, 2016 at 6:17
• @Moti Why is this solution not acceptable? Isn't it right?? If you don't want the use of computers, add a no-computer tag. Aug 24, 2016 at 8:42
• @KeithN Lots of practice. I used Mathematica throughout undergrad and grad school in mathematics and I've solved over 100 Project Euler problems using it too. Aug 24, 2016 at 8:46
• @ABcDexter, I think there's a useful distinction between two ways to use a computer to solve a puzzle. One is where the computer gives you a proof, and by copying what the computer says you have a complete answer. The other is where the computer gives you an approximate answer leaving you probably knowing the answer but without actual proof that it's right. This is the second sort of case; to my mind the no-computer tag is more about the first. Aug 24, 2016 at 10:29
• What exactly distinguishes a puzzle from a math problem? I think convergence in finite time should be able to be proven using fairly basic arguments, but the exact time until convergence may be difficult. Aug 24, 2016 at 16:44