# Problem of the Week Problem E and Solution Passing Trains

## Problem

Two trains of equal length are on parallel tracks. One train travels at $$40$$ km/h and the other train travels at $$20$$ km/h.

One day, the two trains are travelling in the same direction, and the front end of the faster train is at the same place as the back end of the slower train. The faster train then completely passes the slower train so that the back end of the faster train is now at the same place as the front end of the slower train.

Another day, the two trains are travelling in opposite directions, and the front end of the faster train is at the same place as the front end of the slower train. The trains then completely pass each other so that the back end of the faster train is at the same place as the back end of the slower train.

If it takes $$2$$ minutes longer for the trains to completely pass one another when travelling in the same direction than it does when they are travelling in opposite directions, determine the length of each train.

## Solution

Solution 1

Let $$L$$ represent the length, in km, of each train. Let $$t_1$$ represent the time, in hours, required for the faster train to completely pass the slower train when they are travelling in the same direction. Let $$t_2$$ represent the time, in hours, required for the faster train to completely pass the slower train when they are travelling in opposite directions.

In order to completely pass one another when travelling in the same direction, the faster train must travel two lengths of the train plus whatever distance the slower train travels. Therefore, \begin{aligned} 40t_1&=20t_1+2L\\ 20t_1&=2L\\ t_1&=\frac{L}{10}\end{aligned}

In order to completely pass one another when travelling in opposite directions, the total distance travelled by the two trains must be $$2L$$. Therefore, \begin{aligned} 40t_2+20t_2&=2L\\ 60t_2&=2L\\ t_2&=\frac{L}{30}\end{aligned}

We know it takes $$2$$ minutes or $$\frac{2}{60}$$ hours longer for the trains to completely pass one another when travelling in the same direction than when travelling in opposite directions. Thus, \begin{aligned} t_1-t_2&=\frac{2}{60}\\ \frac{L}{10}-\frac{L}{30}&=\frac{1}{30}\\ 3L-L&=1\\ 2L&=1\\ L&=0.5\end{aligned} Therefore, the length of each train is $$0.5$$ km.

Solution 2

Let $$L$$ represent the length, in km, of each train. When travelling in the same direction, the faster train is travelling at $$40-20=20$$ km/h relative to the slower train. In order to completely pass the slower train, the faster train must travel $$2L$$ km. Therefore, it takes $$\frac{2L}{20}=\frac{L}{10}$$ hours to completely pass the slower train.

When travelling in opposite directions, the faster train is travelling at $$40+20=60$$ km/h relative to the slower train. In order to completely pass the slower train, the faster train must travel $$2L$$ km. Therefore, it takes $$\frac{2L}{60}=\frac{L}{30}$$ hours to completely pass the slower train.

We know it takes $$2$$ minutes or $$\frac{2}{60}=\frac{1}{30}$$ hours longer for the trains to completely pass one another when travelling in the same direction than when travelling in opposite directions. Thus, \begin{aligned} \frac{L}{10}-\frac{L}{30}&=\frac{1}{30}\\ 3L-L&=1\\ 2L&=1\\ L&=0.5\end{aligned} Therefore, the length of each train is $$0.5$$ km.

Solution 3

Let $$L$$ represent the length, in km, of each train. While the trains are travelling in opposite directions, let $$y$$ km be the distance travelled by the slower train from the time the faster train begins to pass until it completely passes. The slower train travels $$y$$ km and the faster train travels $$(2L-y)$$ km. We know that the time travelled will be the same, so \begin{align*} \frac{y}{20}&=\frac{2L-y}{40}\\ 2y&=2L-y\\ 3y&=2L \tag{1}\end{align*}

While the trains are travelling in the same direction, let $$x$$ km be the distance travelled by the slower train from the time the faster train begins to pass until it completely passes. The slower train travels $$x$$ km and the faster train travels $$(x+2L)$$ km. We know that the time travelled will be the same, so \begin{align*} \frac{x}{20}&=\frac{x+2L}{40}\\ 2x&=x+2L\\ x&=2L \tag{2}\end{align*}

We know that it takes $$2$$ minutes or $$\frac{2}{60}$$ hours longer for the trains to completely pass one another when travelling in the same direction than when travelling in opposite directions. Thus, \begin{aligned} \frac{x}{20}-\frac{y}{20}&=\frac{2}{60}\\ 3x-3y&=2\end{aligned}

Substituting $$2L$$ for $$x$$ from equation $$(2)$$ and $$2L$$ for $$3y$$ from equation $$(1)$$, \begin{aligned} 3(2L)-2L&=2\\ 4L&=2\\ L&=0.5\end{aligned} Therefore, the length of each train is $$0.5$$ km.