Sub topic 6
Trains: poles, platforms and other trains
This chapter assumes you know distance = speed × time, the km/h to m/s conversion (multiply by 5/18), and how to solve a linear equation in one variable. It also assumes you can read relative speed for same and opposite directions. Train questions apply those tools to objects that have length.
The one idea: add the lengths that must pass
A point object, such as a car on a long road, covers distance equal to the gap between two points. A train is different. To "cross" something, the train must move far enough that its whole body has passed that thing. So every train question reduces to two steps:
- Work out the distance to be covered. It is the train's own length plus the length of whatever it crosses.
- Divide by the speed, which is the relative speed if the other object also moves.
| The train crosses | Distance covered |
|---|---|
| A pole, signal, or standing person | Its own length L |
| A platform, bridge, or tunnel of length P | L + P |
| A walking person or cyclist | L (at relative speed) |
| Another train of length M | L + M (at relative speed) |
Poles and platforms
When a train crosses a pole, the pole is a point. The engine reaches it, and the train is "across" once the last coach has passed it. The train has therefore moved exactly one train length.
Example 1. A 180 m train crosses a pole in 12 s. How long does it take to cross a 270 m platform?
The speed is 180 / 12 = 15 m/s, which is 54 km/h. For the platform, the distance is 180 + 270 = 450 m, so the time is 450 / 15 = 30 s.
Notice that the pole time gives you the speed directly. This is why many questions give a pole time and leave the length unknown.
Example 2 (two unknowns). A train crosses a 300 m platform in 30 s and a pole in 18 s. Find the train's length and speed.
The speed is the same in both events, so let the length be L:
L / 18 = (L + 300) / 30
30L = 18L + 5400, so L = 450 m. The speed is 450 / 18 = 25 m/s = 90 km/h.
Check against the other event: (450 + 300) / 30 = 25 m/s. Both agree.
A quicker route uses proportionality. The platform adds 300 m, and that extra 300 m accounts for the extra 12 s (30 − 18). So the speed is 300 / 12 = 25 m/s, with no equation needed. Then L = 25 × 18 = 450 m.
Bridges and tunnels: two different questions
The phrase "crosses a bridge" means from the moment the engine touches the bridge to the moment the last coach leaves it. The distance is L + B.
Some questions instead ask how long the train is completely on the bridge. That runs from the moment the last coach enters to the moment the engine exits. The distance is B − L, which only makes sense if the bridge is longer than the train.
Example 3. A 100 m train moves at 20 m/s over a 500 m bridge.
- Time to cross: (500 + 100) / 20 = 30 s.
- Time completely on the bridge: (500 − 100) / 20 = 20 s.
A related variant is a tunnel question where the train is entirely hidden for some time. Treat it exactly like the "completely on" case.
A walking person or cyclist
A person is a point, but if the person moves, the relative speed changes.
Example 4. A 110 m train passes a man walking at 6 km/h towards it in 6 s. Find the train's speed.
The relative speed is 110 / 6 m/s. Converting to km/h gives (110 / 6) × 18/5 = 66 km/h. The man walks towards the train, so the speeds add: train speed = 66 − 6 = 60 km/h.
If the man had been walking in the same direction as the train, the relative speed would be train − man, and the train would be at 72 km/h.
Two trains crossing each other
Two trains of lengths L₁ and L₂ cross when the gap between their fronts closes and then their rears clear each other. The total distance is L₁ + L₂, and the speed is the relative speed.
- Opposite directions: relative speed = v₁ + v₂.
- Same direction (overtaking): relative speed = v₁ − v₂, with the faster train behind.
Example 5 (opposite). Trains of 150 m and 100 m run at 36 km/h and 54 km/h towards each other. The relative speed is 90 km/h = 25 m/s. The time is 250 / 25 = 10 s.
Example 6 (same direction). A 200 m train at 72 km/h overtakes a 150 m train at 36 km/h. The relative speed is 36 km/h = 10 m/s. The time is 350 / 10 = 35 s.
def crossing_time(l1, v1, l2, v2, same_direction=False):
"""Seconds for two trains to cross. Lengths in metres, speeds in km/h."""
relative_kmph = abs(v1 - v2) if same_direction else v1 + v2
relative_ms = relative_kmph * 5 / 18
return (l1 + l2) / relative_ms
print(round(crossing_time(120, 60, 130, 40), 2)) # 9.0
print(round(crossing_time(200, 72, 150, 36, same_direction=True), 2)) # 35.0The function converts only once, at the end of the speed calculation, so lengths in metres and speeds in m/s stay consistent.
Using pole times for two trains
Often you are told how long each train takes to pass a pole, not the speeds. A train of length L that passes a pole in t seconds has speed L / t. So for lengths L₁, L₂ and pole times t₁, t₂:
- Opposite directions: time = (L₁ + L₂) / (L₁/t₁ + L₂/t₂).
- Same direction: time = (L₁ + L₂) / |L₁/t₁ − L₂/t₂|.
Example 7. Trains of 120 m and 180 m pass a pole in 12 s and 9 s. Their speeds are 10 m/s and 20 m/s. Moving towards each other they cross in 300 / 30 = 10 s. Moving in the same direction they cross in 300 / 10 = 30 s.
There is a handy special case when the two trains have equal length. If they take t₁ and t₂ to pass a pole, the crossing time is:
- Opposite: 2t₁t₂ / (t₁ + t₂)
- Same direction: 2t₁t₂ / (t₂ − t₁), where t₂ > t₁
For t₁ = 12 and t₂ = 6, the opposite crossing is 2 × 72 / 18 = 8 s, and the same-direction crossing is 2 × 72 / 6 = 24 s. You can check this by letting L = 1 unit: speeds are 1/12 and 1/6 per second, so opposite relative speed is 1/4 and time is 2 / (1/4) = 8.
def equal_length_times(t1, t2):
"""Crossing times for two equal-length trains with pole times t1 < t2."""
fast, slow = min(t1, t2), max(t1, t2)
opposite = 2 * fast * slow / (fast + slow)
same = 2 * fast * slow / (slow - fast)
return opposite, same
print(equal_length_times(12, 6)) # (8.0, 24.0)Passing two points, and the "no length" trap
If a train passes two poles that stand D metres apart, the time between the engine reaching the first pole and the engine reaching the second is D / v. The train's length does not enter. It only enters when the question asks for the time for the whole train to pass a single point.
Be careful with wording. "A train passes a station in 20 s" usually means a point crossing, so use L only. "A train passes a platform in 20 s" uses L + P. Read what the object is.
Common errors
| Error | Why it fails | Fix |
|---|---|---|
| Using speed in km/h with lengths in metres | Units mismatch gives answers off by a factor of 3.6 | Convert km/h to m/s with × 5/18 first |
| Forgetting the train's own length for a platform | Gives the time for a point to cross | Add L + P |
| Adding speeds when trains move in the same direction | Overtaking is a closing gap, so use the difference | Same direction means subtract |
| Using L + P for "completely on the bridge" | That is the crossing distance, not the covered distance | Use B − L |
| Ignoring a moving person's speed | Treats a walking person as stationary | Use relative speed for moving objects |
Edge cases to check
- Equal speeds, same direction. The relative speed is zero, so the trains never finish crossing. A question that asks for a crossing time with equal speeds has no valid answer.
- Trains much shorter than the distance. If the stations are hundreds of kilometres apart, the train lengths are negligible and you treat the trains as points. This is a meeting problem, covered in a later chapter.
- Opposite crossing time shown as a ratio. If two trains take t₁ and t₂ to cross a pole and the speeds are in the ratio v₁ : v₂, then the lengths are in the ratio v₁t₁ : v₂t₂. Use this when the problem gives ratios instead of actual values.
- Sanity check. A crossing time should always be longer than the time to cross a pole at the same speed, because a platform adds distance. If your platform time comes out smaller than your pole time, you have missed a term.
Exercise
A train 240 m long crosses a pole in 16 s. How long does it take to cross a 360 m platform, and what is its speed in km/h?
Show answer
The speed is 240 / 16 = 15 m/s, which is 15 × 18/5 = 54 km/h. For the platform the distance is 240 + 360 = 600 m, so the time is 600 / 15 = 40 s.
Exercise
Two trains of lengths 140 m and 160 m run in opposite directions at 48 km/h and 72 km/h. In how many seconds do they cross each other? If the same trains run in the same direction, how long does the faster one take to overtake the slower one?
Show answer
Opposite: the relative speed is 120 km/h = 120 × 5/18 = 100/3 m/s. The distance is 300 m, so the time is 300 / (100/3) = 9 s. Same direction: the relative speed is 24 km/h = 20/3 m/s, so the time is 300 / (20/3) = 45 s.
Exercise
A train crosses a 400 m bridge in 40 s and a pole in 25 s. Find the train's length and speed, and the time for which the train is completely on the bridge.
Show answer
The extra 400 m of bridge accounts for the extra 15 s (40 − 25), so the speed is 400 / 15 = 80/3 m/s (96 km/h). The length is (80/3) × 25 = 2000/3 ≈ 666.7 m. This is longer than the bridge, so the train is never completely on the bridge. A train longer than the bridge cannot be fully on it, and B − L would be negative.