Two trains are moving towards each other on the same railroad track. From this track there's an offshoot piece of railroad − the length of which is shorter than the length of the train but longer than the length of one train car. How can the trains pass each other?

Respuesta :

Answer:

  one car at a time

Step-by-step explanation:

For each car in the shorter train* (A) ...

  • train A leaves one of its cars on the offshoot
  • both trains move until train B can move the car from the offshoot to the portion of track away from train A
  • train B moves to allow the cycle to repeat

When there are no more train A cars in front of train B, both trains can continue on their journey.

We assume cars can be decoupled at any point in the train, so that any required order of cars can be preserved. We further assume that train B can move any one of train A's cars in addition to all of its own.

_____

* The total number of car lengths that must pass the offshoot is (at least) the product of the number of cars in both trains, so it doesn't seem to matter which train makes use of the offshoot. We choose to decouple the cars of train A so that the minimum number of cycles is required--even though each cycle is longer.