wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> medium >> The shunting (switching) locomotive
(Message started by: hoferman on Aug 17th, 2005, 2:26am)

Title: The shunting (switching) locomotive
Post by hoferman on Aug 17th, 2005, 2:26am
In the picture below you'll see a railway track with a locomotive and 2 waggons (A and B). The locomotive is able to drive around and push/pull the waggons around the track (shunting).  It can for example drive backwards into the shunting yard (or switching yard) of 15 long, and continue it's way driving forwards pushing waggon B into the shunting yard of 20 long.
As you can see the three shunting yards are only of limited size. The locomotive is 10 long and the waggons are 5 long each. These sizes limit your shunting capabilities. For example the locomotiv can not drive into the shunting yard of 5 long (the one on the left). Or as another example the locomotive with the two waggons attached is not able to drive into the shunting yard of 15 long.

Your goal is to switch waggons A and B, and return the locomotive to it's orgininal place.
How will you drive and how will you push and pull?

Happy shunting!





Title: Re: The shunting (switching) locomotive
Post by Sjoerd Job Postmus on Aug 17th, 2005, 2:43am
Quick guess
[hideb]Drive A into 20
Push B into it's place.
Ride around, pull A back, and let it on B's original spot.
Just continue on riding towards the bottom end.
If the orientation of the loc needs to be right too, you can turn in the 15-slot[/hideb]

Title: Re: The shunting (switching) locomotive
Post by hoferman on Aug 17th, 2005, 2:46am
Hi Sjoerd,

The idea is that you can only drive backwards in 15 and continue your way forwards into 20 (waggon B stuck at your front). Than continue backwards to A, pushing A with your front....
Is it more clear now?


Title: Re: The shunting (switching) locomotive
Post by hoferman on Aug 17th, 2005, 2:48am
Sorry  (fault in last post). If coming from 20, you can only push A with your back.

Title: Re: The shunting (switching) locomotive
Post by TenaliRaman on Aug 17th, 2005, 4:36am
In the following answer, the push/pull and size of the yard should suggest from which end the locomotive is operating.
[hide]
1. Push B into 20
2. Go around and push A into 20. (5+5+10)=20
3. Pull A into the place where B stood earlier
4. Go around and pull B into the place where A stood earlier
5. Bring the locomotive back to its original place
[/hide]

-- AI

Title: Re: The shunting (switching) locomotive
Post by hoferman on Aug 17th, 2005, 4:52am

on 08/17/05 at 04:36:37, TenaliRaman wrote:
In the following answer, the push/pull and size of the yard should suggest from which end the locomotive is operating.
[hide]
1. Push B into 20
2. Go around and push A into 20. (5+5+10)=20
3. Pull A into the place where B stood earlier
4. Go around and pull B into the place where A stood earlier


At point 4 you 'Go around', but you are not able to go around because the bottom left shunting yard is too small for the Locomotive to pass.

Title: Re: The shunting (switching) locomotive
Post by Grimbal on Aug 17th, 2005, 4:55am
[hide]
- pull B into 15 [3]
- push B into 5 [1]
- go around and push A against B [3]
- pull A+B into 20 and push them to the right segment [2]
- pull A into 20 and push it into 5 [2]
- transfer B to the left segment [4]
- get around to A [3]
- pull A into 15 and to the right segment [2]
- get back to the bottom segment [2]

22 movements.
[/hide]
edit: corrected small mistake.

Title: Re: The shunting (switching) locomotive
Post by TenaliRaman on Aug 17th, 2005, 5:20am

on 08/17/05 at 04:55:38, Grimbal wrote:
[hide]
<snip> - pull A into 20 and to the right segment [2] <snip>
[/hide]

Is your 8th line supposed to be,
[hide]Pull A into 15[/hide] ?
Btw nice work out.

-- AI

Title: Re: The shunting (switching) locomotive
Post by Grimbal on Aug 17th, 2005, 7:25am
:-[ You are right.  Corrected.  But:  8)



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board