shunting puzzles

Railroad modelers, especially those with limited space available for their layouts, often enjoy setting up track that allows interesting shunting problems to be tried out and solved. The most famous mathematical puzzle of this type, called the railroad shunting puzzle, comes in a number of variations, but basically the problem is that there are two trains (A and B in the diagram) facing each other on a single line with just one short siding, which will only hold one item of rolling stock at a time. In order to enable the two trains to pass each other and to continue their journey, a series of movements using the siding is required. First time around it's quite a brain-teaser, which probably explains why railroad companies all over the world took the more costly but easier way out and built passing sidings!