# Shunting

Model railway enthusiasts have created a whole class of mathematical problems to solve that involve manouvering locomotives and carriages around specially constructed track layouts. One of the earliest and simplest railway shunting problems is presented here.

## The puzzle

In the FA Cup Grantham have to travel to Spalding United and Boston face a trip to Ilkeston. Special trains are put on to get the fans of each team to the match. Each train consists of a locomotive and two carriages. On the day of the match both trains end up heading towards each other on a stretch of single line track. There is however a siding that can take one locomotive and one carriage. How is it possible for the two trains to pass each other by using this siding?

## The solution

The rear carriage of the Boston train is uncoupled and the front carriage and locomotive reverse into the siding. The Grantham train then goes past the siding and the Boston locomotive and carriage pull out of the siding. The two Grantham carriages are then coupled to the back of the Boston carriage and locomotive and the Grantham locomotive and Boston carriage reverse into the siding. The Grantham locomotive is then uncoupled from the Boston carriage in the siding before pulling out to be attached to the two Grantham carriages which are then uncoupled from the Boston locomotive and carriage. The Grantham train can now proceed and the Boston locomotive and carriage reverses into the siding where the remaining Boston carriage is coupled up to let the Boston train proceed.