The Fly and Trains problem
This activity belongs to the GeoGebra book The Domain of the Time.
Constant speed motion frequently appears in many pursuit or encounter problems involving two moving objects. Although textbooks often solve them as systems of two equations with two unknowns (the distance traveled and the time taken to meet), a simple reasoning based on the relativity of motion (Galileo's relativity with respect to the reference frame) is enough.
For an observer on one of the moving objects, the object they're on remains stationary, while the other moves with the difference (vectorial, that is, considering the direction of each) of the speeds of both. Using this reasoning, it’s easy to deduce the time of the encounter.
Perhaps the most famous example of this type of problem is the one involving a fly and two trains:
Two trains are on the same track, 100 km apart, moving towards each other at 50 km/h each. A fly starts from the front of one train and flies toward the other at 75 km/h. Upon reaching the other train, the fly turns around and flies back toward the first train, continuing this back-and-forth motion. How many kilometers does the fly travel before being squashed in the collision of the two trains?
- Comment: Naturally, this statement, like many others in mathematics, falls into the category of "thought experiments" and shouldn't be judged with "common sense" (since when do flies fly at a constant speed without erratic movements? At 75 km/h, more than 10 times their normal speed? What strange motive drives the fly to make those absurd back-and-forth trips? Are both train conductors blind and don’t stop upon seeing the other train? How are these data known, does the fly carry a lightweight GPS? Etc.).
- Note: In the construction, it’s evident that the locomotives are not to scale.
SCRIPT FOR SLIDER anima
# Calculate the elapsed seconds dt; add one second if t1(1) < tt
SetValue(tt, t1(1))
SetValue(t1, First(GetTime(), 3))
SetValue(dt, (t1(1) < tt) + (t1(1) − tt)/1000)
# Move the fly M (at speed v) and the trains (at speed vTrain)
SetValue(M, M + dt v)
SetValue(Train1, Train1 + dt vTrain)
SetValue(Train2, Train2 - dt vTrain)
# Set the boundaries of each movement
SetValue(v, If(x(M - Train1) < 0, (abs(v), 0), x(Train2 - M) < 0, -(abs(v), 0), v))
StartAnimation(anima, x(Train2 - Train1) > 0)
Author of the activity and GeoGebra construction: Rafael Losada.