.
.
. .

.
Subj:.....Primitive Railroading Problem (S620)
          From the book 
           "Mathematical Puzzles of Sam Loyd" 
            Edited by Martin Gardner 
            From: Dover Publications in 1959
 

Find the simplest method by which the trains
can pass.

In this specimen of primitive railroading we have an
engine and four cars meeting an engine with three cars.
The problem is to ascertain the most expeditious way of
passing the two trains by means of the side-track, which
is only large enough to hold one engine or one car at a
time.

No ropes, poles or flying switches are to be used, and
it is understood that a car cannot be connected to the
front of an engine.  How many times is it necessary to
back or reverse the directions of the engines to
accomplish the feat, each reversal of an engine being
counted as a move in the solution?

.
.
.

.   ...
.
.
..