Skip to content
Tutorials Center
My learning

Topics

Lesson 25 of 86 ยท Time, Speed, Distance and Work

Problems on Trains

Solve train problems with poles, platforms, bridges, men walking and trains crossing in the same or opposite direction, with a runnable solver.

In Speed, Distance and Time the moving object was a point: a car, a walker. A train is different, because it has a length, and that length changes how far it must travel to "cross" something. A train that is 150 m long has only finished passing a pole when its last carriage reaches the pole. Almost every train question comes down to one idea: work out the total distance that must be covered, then divide by the speed.

This lesson sorts train problems into a handful of patterns: crossing a pole or a person, crossing a platform or a bridge, trains going in opposite directions and trains going in the same direction. It ends with a runnable solver that returns the crossing time for any combination.

The core idea: distance to cover

For two objects to cross each other completely, the front of one meets the front of the other, and the process ends when the back of one passes the back of the other. The distance covered relative to each other is the sum of their lengths.

Situation Distance to cover Speed to use
Train crosses a pole or signal Length of train Speed of train
Train crosses a standing person Length of train Speed of train
Train crosses a platform or bridge Train length + platform length Speed of train
Train crosses a walking person Length of train Relative speed
Two trains cross, opposite directions Sum of lengths Sum of speeds
Faster train overtakes slower train Sum of lengths Difference of speeds
flowchart TB
    Q["Train problem"] --> A{"What does it cross?"}
    A -->|"Pole or person standing"| B["Distance = train length"]
    A -->|"Platform or bridge"| C["Distance = train + platform"]
    A -->|"Another moving object"| D{"Directions"}
    D -->|"Opposite"| E["Add speeds, add lengths"]
    D -->|"Same"| F["Subtract speeds, add lengths"]

Decide what is crossed, then choose the distance and the speed.

Always convert speeds into m/s (multiply km/h by 5/18) when lengths are in metres.

Crossing a pole and a platform

Example 1. A train 150 m long runs at 54 km/h. How long does it take to pass a pole? Speed = 54 ร— 5/18 = 15 m/s. Time = 150 รท 15 = 10 seconds.

Example 2. The same train crosses a platform 300 m long. Distance = 150 + 300 = 450 m, so time = 450 รท 15 = 30 seconds.

Notice something useful: the train takes 10 seconds to pass the pole and 30 seconds to pass the platform. The extra 20 seconds is the time to cover the platform's own length (300 m รท 15 m/s). So if you are told the time at a pole and the time at a platform, the platform length divided by the difference of times gives the speed.

Example 3. A train crosses a pole in 10 s and a platform 300 m long in 30 s. Speed = 300 รท (30 โˆ’ 10) = 15 m/s = 54 km/h, and length = 10 ร— 15 = 150 m.

Example 4. A train 240 m long crosses a bridge 360 m long at 60 km/h. 60 km/h is 50/3 m/s. Distance 600 m, so time = 600 รท (50/3) = 36 seconds.

Trains and moving people

When a train passes a person who is also moving, the train's length must be covered at the relative speed.

Example 5. A train 200 m long passes a man walking in the same direction in 12 seconds. The relative speed is 200 รท 12 = 16.67 m/s = 60 km/h. If the man walks at 6 km/h, the train's speed is 60 + 6 = 66 km/h. If the man had been walking towards the train, relative speed would have been the sum, and the train's speed would be 60 โˆ’ 6 = 54 km/h.

Two trains crossing

Opposite directions. The trains approach each other, so the speeds add:

time = (Lโ‚ + Lโ‚‚) รท (vโ‚ + vโ‚‚)

Example 6. Trains of 120 m and 180 m run towards each other at 60 km/h and 48 km/h. The relative speed is 108 km/h = 30 m/s. The distance is 300 m. Time = 10 seconds.

Same direction. The faster train must gain the whole combined length on the slower one:

time = (Lโ‚ + Lโ‚‚) รท (vโ‚ โˆ’ vโ‚‚)

Example 7. Trains of 110 m and 140 m run in the same direction at 72 km/h and 54 km/h. The relative speed is 18 km/h = 5 m/s. The faster train takes 250 รท 5 = 50 seconds to pass the slower one completely.

Equal-length trains

Two trains of equal length L take 10 seconds and 15 seconds to cross a pole. Their speeds are L/10 and L/15 m/s. To compare the times they take to cross each other:

  • Opposite directions: 2L รท (L/10 + L/15) = 2L รท (L/6) = 12 seconds.
  • Same direction: 2L รท (L/10 โˆ’ L/15) = 2L รท (L/30) = 60 seconds.

The length cancels out. You never need to know L, only the ratio of the crossing times.

Trains that meet and part

Two trains start at the same time from two stations towards each other. After they meet, train A takes 9 hours to reach its destination and train B takes 16 hours. The ratio of their speeds is โˆš16 : โˆš9 = 4 : 3. In general, if after meeting A takes a hours and B takes b hours, then speed of A : speed of B = โˆšb : โˆša. The reason is that each train covers, after meeting, the distance the other covered before meeting.

Try it: a train problem solver

This solver handles all the cases in the table. Lengths are in metres and speeds in km/h.

JS Train crossing solver

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Try it: finding speed and length from two crossing times

Given the time to pass a pole and the time to pass a platform of known length, this script recovers the train's speed and length. The second part checks the equal-length trains result.

JS Speed and length from times

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Common mistakes

  • Forgetting to add the platform or bridge length to the train's own length.
  • Using km/h with metres and seconds; convert to m/s first.
  • Adding lengths but also adding speeds for trains moving in the same direction. Use the difference.
  • Using the train's own speed instead of the relative speed when it passes a moving person.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. A 180 m long train runs at 72 km/h. How long does it take to cross a pole?

    72 km/h = 20 m/s, and 180 / 20 = 9 seconds.
  2. 2. A train 250 m long crosses a platform 350 m long in 30 seconds. What is its speed?

    Distance is 600 m, so speed is 600 / 30 = 20 m/s = 72 km/h.
  3. 3. Two trains of lengths 100 m and 140 m run in opposite directions at 40 km/h and 50 km/h. How long do they take to cross each other?

    Relative speed is 90 km/h = 25 m/s. Distance 240 m. Time = 240 / 25 = 9.6 seconds.
  4. 4. A train 300 m long overtakes a cyclist riding in the same direction at 18 km/h in 20 seconds. What is the train's speed?

    Relative speed is 300 / 20 = 15 m/s = 54 km/h. The train's speed is 54 + 18 = 72 km/h.
  5. 5. Two trains of the same length take 20 s and 30 s to pass a pole. How long do they take to cross each other when moving in opposite directions?

    Time = 2L / (L/20 + L/30) = 2L / (L/12) = 24 seconds.

Summary

  • First decide the distance: the train's length for a pole or standing person, train plus platform for a platform or bridge, sum of lengths for two trains.
  • Use m/s when lengths are in metres; multiply km/h by 5/18.
  • Opposite directions add speeds, same direction subtracts them.
  • For a moving person, use the relative speed with the train's length.
  • With equal-length trains, the length cancels and the crossing times give the answer.

Next: Boats and Streams, where a current helps or hinders the motion.