Jump to content
 

Please use M,M&M only for topics that do not fit within other forum areas. All topics posted here await admin team approval to ensure they don't belong elsewhere.

Inglenook options calculations


Recommended Posts

  • RMweb Gold
Posted (edited)

Tradionally, for a 5-3-3 inglenook, there are said to be 40,320 possible different positions.

 

This is calculated from 8 Factorial, or 8! (1×2×3×4×5×6×7×8).

 

If we have 8 wagons, A,B,C,D,E,F,G & H, then

these can be shunted into those 40,320 different ways.

 

But...

We are only concerned with 5 of the wagons, A-E, the order of the other 3 has no bearing on the solution.

 

So, there are only 120 options (5!).

 

However, we can replace any of the those 5 with one of the other 3, so our 120 is multiplied by 5 (=600).

Then we replace one of the original 5 with a 2nd spare ( x5, =3,000), and a 3rd spare (x5, =15,000).

 

Now, we can replace 2 of the original 5, for which there are 20 possibilities ( x20, =300,000), and do that twice more (x20,= 6m, x20, =120m)

And we can replace 3 of the original 5, for which there are 60 possibilities, so our final number of placement options is (x60, =7.2 billion).

 

7,200,000,000.

 

Or have I made a complete pig's ear of that?

 

5 choices = 120

Replace 1st spare= x5 = 600

Replace 2nd spare = x5 = 3,000

Replace 3rd spare x5 = 15,000

Replace 1&2 = x20 = 300,000

Replace 1&3 = x20 = 6,000,000

Replace 2&3 = x20 = 120,000,000

Replace 1,2&3 = x60 = 7,200,000,000

 

Edited by Stubby47
Maths
  • Interesting/Thought-provoking 3
Link to post
Share on other sites

  • RMweb Gold
Just now, BoD said:

I think you need to actually do it to verify your theory.

Er, maybe.

I started using my fingers, but soon ran out of those.

  • Funny 5
Link to post
Share on other sites

3 hours ago, Stubby47 said:

Traditionally, for a 5-3-3 inglenook, there are said to be 40,320 possible different positions

What assumption(s) have you made about how many of the wagons are identical apart from their number and degree of weathering? 

  • Funny 5
Link to post
Share on other sites

2 hours ago, Stubby47 said:

Or have I made a complete pig's ear of that?

 

If you are only concerned with 5 wagons you have 6720 options. Being really simplistic, in selecting the first wagon you have 8 to choice from, in selecting the second wagon you have 7 to choice from, in selecting the third wagon you have 6 to choice from, in selecting the fourth wagon you have 5 to choice from, and in selecting the fifth wagon you have 4 to choice from. Or if you prefer 8! / 3!.

  • Like 1
  • Agree 5
  • Interesting/Thought-provoking 1
Link to post
Share on other sites

  • RMweb Gold
7 minutes ago, goldfish said:

 

If you are only concerned with 5 wagons you have 6720 options. Being really simplistic, in selecting the first wagon you have 8 to choice from, in selecting the second wagon you have 7 to choice from, in selecting the third wagon you have 6 to choice from, in selecting the fourth wagon you have 5 to choice from, and in selecting the fifth wagon you have 4 to choice from. Or if you prefer 8! / 3!.

What if you pick all 5 at the same time........?

Link to post
Share on other sites

  • RMweb Gold
12 minutes ago, goldfish said:

 

If you are only concerned with 5 wagons you have 6720 options. Being really simplistic, in selecting the first wagon you have 8 to choice from, in selecting the second wagon you have 7 to choice from, in selecting the third wagon you have 6 to choice from, in selecting the fourth wagon you have 5 to choice from, and in selecting the fifth wagon you have 4 to choice from. Or if you prefer 8! / 3!.

 

Yes, but...

 

Actually that makes much more sense.

 

  • Like 1
Link to post
Share on other sites

  • RMweb Gold

… or if you just want to select any 5 from 8 and order doesn’t matter there are only 56 combinations.

  • Agree 1
Link to post
Share on other sites

  • RMweb Premium
22 hours ago, BoD said:

… or if you just want to select any 5 from 8 and order doesn’t matter there are only 56 combinations.

Instead of selecting 5 from 8, why not select 3 from 8 and take those away = win, win. As there is less handling of the stock!

Link to post
Share on other sites

  • RMweb Gold
18 minutes ago, kevinlms said:

Instead of selecting 5 from 8, why not select 3 from 8 and take those away = win, win. As there is less handling of the stock!


Being a shunting puzzle you can choose how complex you make it.  Surely the ‘handling’ of the stock comes with the territory and is part of the challenge.

 

It is interesting calculating the total number of permutations and combinations* but isn’t the important thing how many you go through to achieve your required cut of wagons.  Or ideally the minimum you need to go through. Can the necessary sequence of moves can be calculated mathematically? If it can it’s certainly above my pay grade.

 

*permutations and combinations are two different things mathematically.

  • Agree 1
Link to post
Share on other sites

  • RMweb Premium

Hi Stubby,

 

I showed showed this to two retired maths teachers/lecturers ... both went a rather worrying shade of pale ...

 

Regards,

 

Alex.

  • Round of applause 1
  • Funny 3
Link to post
Share on other sites

  • RMweb Gold
29 minutes ago, Alex TM said:

Hi Stubby,

 

I showed showed this to two retired maths teachers/lecturers ... both went a rather worrying shade of pale ...

 

Regards,

 

Alex.

But did they confirm, or refute, my hypothesis?

Link to post
Share on other sites

Dr Beeching rang, he said that as your wagon(s) can only end up in one of three sidings, of which one might be the same as where it came from, then he feels that the service is not really making any profit.  The cost of removing the locomotive from the inglenook to go off to works by road, the cost of manning the locomotive whilst it operates the three sidings, the cost of fueling and servicing the locomotive plus the cost of the permanent way team to visit the sidings to maintain the infrastructure make it all rather uneconomic.  He also asks where the locomotive is shedded of a weekend as he's heard of joyriders coming along and simply moving wagons randomly at all hours of the day.

 

He does not care for the number of possibilities that the driver is attempting to prove by swapping wagons about, he believes it would be simply cheaper to build a small warehouse to house the goods contained on or within each of the wagons and to 'stop playing' trains for no financial benefit.

  • Craftsmanship/clever 1
  • Round of applause 1
  • Funny 10
Link to post
Share on other sites

  • RMweb Gold

If Dr Beeching wants to stand next to a layout for two days at an exhibition and shunt trucks aimlessly then he's more than welcome.

Having a task to move wagons into a specific order maintains a certain level of sanity.

 

 

This is my latest inglenook layout.

track_plan.png.ba74c4dcb480dc760551fbba41e992d1.png.e6d544461aa84000392379a7e274044b.png

  • Like 5
Link to post
Share on other sites

  • RMweb Gold
On 16/07/2024 at 10:34, BoD said:

… or if you just want to select any 5 from 8 and order doesn’t matter there are only 56 combinations.

I don't understand your maths.

I thought that selecting which three to omit would be 8x7x6 =336

Link to post
Share on other sites

  • RMweb Gold
12 hours ago, woodenhead said:

Dr Beeching rang, he said that as your wagon(s) can only end up in one of three sidings, of which one might be the same as where it came from, then he feels that the service is not really making any profit. 

 

Also, Dr-Knowitall-Beeching obviously doesn't understand that this is an extremely important part of the day-to-day running of an efficient railway.

Marshaling wagons into the correct sequence in the yard means they can be delivered much more easily to the various sidings further along the line.

 

This isn't just playing trains!!

  • Like 3
Link to post
Share on other sites

  • RMweb Gold
Posted (edited)
2 hours ago, Colin_McLeod said:

I don't understand your maths.

I thought that selecting which three to omit would be 8x7x6 =336


You are confusing permutations and combinations, which are mathematically different.  In permutations the order matters.  You have given the permutations, yes there are 336 different ways of arranging 3 wagons from 8.  That assumes that, for example, wagons ABC as being different to wagons BCA or CAB etc.  Here, if it doesn’t matter the order of the three wagons you remove, there are 3x2x1 = 6 permutations which are identical combinations of three wagons. In combinations the order doesn’t matter ABC is classed as the same as BAC etc.  So the number of different combinations is one sixth (3!) of the number of permutations.  336/6 = 56

 

Edit: As Stu points out above though,  the order can be important on the real railway as opposed to just a shunting puzzle.  However, you still might not need all of the permutations.  For example if you have eight wagons to be delivered in two cuts of four to two intermediate stations does the order within those cuts of four matter?  I suppose the answer is ‘it depends’.  
 

My head hurts.

Edited by BoD
  • Like 1
  • Interesting/Thought-provoking 2
Link to post
Share on other sites

Although the maths is mostly beyond me (I scraped through 'O' level maths)  I enjoy seeing shunting puzzles at exhibitions.

 

In my view it is the starting location of the selected wagons A-E that makes the shunting interesting. In that respect then there are eleven possible starting locations for each wagon (5+3+3). The starting locations of wagons F-H may also be relevant, unless they occupy the positions next to the blocks on roads two and three, now what are the odds of that?

 

cheers

 

 

Edited by Rivercider
Tidying up.
  • Like 3
Link to post
Share on other sites

23 hours ago, Rivercider said:

In my view it is the starting location of the selected wagons A-E that makes the shunting interesting. In that respect then there are eleven possible starting locations for each wagon (5+3+3). The starting locations of wagons F-H may also be relevant, unless they occupy the positions next to the blocks on roads two and three, now what are the odds of that?

 

If I interpret your question correctly, with 11 starting locations and 8 wagons there would appear to be 6652800 different starting arrangements ( 11! / 3! ).

Link to post
Share on other sites

  • RMweb Premium
Posted (edited)

With 6,652,800 starting possibilities and 6,720 possible train combinations, there appear to be 44,706,816,000 permutations for the puzzle as a whole. However some of these are effectively equivalent. For example, to take the trivial situation of beginning with wagons 1, 2, 3, 4 and 5 in the long siding, and being asked to make up a train of wagons 1, 2, 3, 4 and 5 in the same order, there are 120 permutations for the remaining three wagons in the short sidings, none of which have any effect in solving the puzzle. Since there are 6,720 possible train combinations, this removes 799,680  permutations just for the lucky situations when you happen to draw the wagons already in the long siding in the correct order and no shunting is needed.

 

I can't think of any easy way (or even moderately difficult way) of working out how many functionally different permutations there are, but I think we can reduce the upper limit to significantly less than 44,706,816,000 (or 44,706,016,320, if we take off the 799,680      mentioned above). There will always be three wagons not chosen, and in every situation the order of these three wagons does not matter. So, for example, if you are asked to make up a train using wagons 1 to 5, it does not matter if you swap the positions of wagons 6 and 7, or wagons 7 and 8, or wagons 6 and 8, or move all three (so 6 goes to where 7 is, 7 goes to where 8 is and 8 goes to where 6 is, or vice versa). You can always come up with at least five equivalent starting positions involving the three unused wagons in addition to the one you start with, so we can divide 44,706,816,000 by 6 to give 7,451,136,000.

 

This isn't far off the OP's 7.2 billion, but that calculation appears to be for something different, the number of permutations of 5-wagon trains when you have eight wagons to choose from, for which the correct answer is 6,720.

Edited by Jeremy Cumberland
Slight clarificiation. Or perhaps not.
Link to post
Share on other sites

33 minutes ago, Jeremy Cumberland said:

With 6,652,800 starting possibilities and 6,720 possible train combinations, there appear to be 44,706,816,000 permutations for the puzzle as a whole. However some of these are effectively equivalent. For example, to take the trivial situation of beginning with wagons 1, 2, 3, 4 and 5 in the long siding, and being asked to make up a train of wagons 1, 2, 3, 4 and 5 in the same order, there are 120 permutations for the remaining three wagons in the short sidings, none of which have any effect in solving the puzzle. Since there are 6,720 possible train combinations, this removes 799,680  permutations just for the lucky situations when you happen to draw the wagons already in the long siding in the correct order and no shunting is needed.

 

I can't think of any easy way (or even moderately difficult way) of working out how many functionally different permutations there are, but I think we can reduce the upper limit to significantly less than 44,706,816,000 (or 44,706,016,320, if we take off the 799,680      mentioned above). There will always be three wagons not chosen, and in every situation the order of these three wagons does not matter. So, for example, if you are asked to make up a train using wagons 1 to 5, it does not matter if you swap the positions of wagons 6 and 7, or wagons 7 and 8, or wagons 6 and 8, or move all three (so 6 goes to where 7 is, 7 goes to where 8 is and 8 goes to where 6 is, or vice versa). You can always come up with at least five equivalent starting positions involving the three unused wagons, so we can divide 44,706,816,000 by 6 to give 7,451,136,000.

 

This isn't far off the OP's 7.2 billion, but that calculation appears to be for something different, the number of permutations of 5-wagon trains when you have eight wagons to choose from, for which the correct answer is 6,720.

 

If the order of the 5 selected wagons is not important there are only 56 ways of selecting 5 wagons ( 8! / ( 3! * 5!) ). So there would be 372,556,800 permutaions.

  • Agree 1
Link to post
Share on other sites

  • RMweb Premium
Posted (edited)

Refering to Adrian Wynann’s excellent Shunting Puzzles website, the following has been posted for some time now …

 

<quote begins>
 

Measuring complexity

 

A question which is often asked once the concept behind a shunting puzzle layout has been explained is as to the degree of complexity or, in other words: just how many possible configurations are there?

The mathematical approach to finding out how many permutations [emphasis added] a specific shunting puzzle allows for is fairly easy. If "n" is the total number of cars on the shunting puzzle layout, and "k" is the amount of cars which are selected from this, then the formula to be used is meaning that n factorial is divided through the factorial of n minus k (the “factorial” of three, for example, is 1 x 2 x 3 = 6, and written as "3!"). Applied to the original Inglenook formula (where 5 cars are selected from a total of 8), the calculation is as follows:


                                  n!

                              ______

                               (n-k)!

 

That is to say: the 8 cars can be arranged in 40,320 different ways on the Inglenook layout, and the number of possible trains with five cars which can be made up from these is 6,720 (note that this calculation only takes into account the rolling stock present on the layout and disregards the distribution of the three "empty slots" in the sidings, as these are not part of the object of the puzzle itself and only serve as manoeuvering space; if you were to factor them in then the number of combinations rises significantly).

 

In other words: if you were to systematically work your way through these combinations, solving four shunting tasks in one hour, and doing that for three hours every evening, you would be at it for 560 operating sessions totalling 28 hours.

 

The true beauty of a shunting puzzle is the simplicity within the complexity: both Inglenook Sidings and the Timesaver have simple rules, are easy to understand, straightforward to build, and great fun to operate and solve.

 

Further reading

 

Blackburn Simon R. (2019) "Inglenook shunting puzzles", Electronic Journal of Combinatorics, Volume 26, Issue 2

 

Simon Blackburn is Professor of Pure Mathematics at the Department of Mathematics, Royal Holloway University of London. This article looks at the Inglenook Sidings from a mathematical perspective and answers the question when you can be sure this can always be done, while also addressing the problem of finding a solution in a minimum number of moves.

 

<quote ends>
 

I previously read the article by Prof Blackburn - if your head hurts now, prepare to saw it off once you have read that!

 

Something I was/am interested in was/is what numbers of wagons work as an Inglenook puzzle. For example, if I have 9 wagons to select from, how does that change the lengths of sidings I need to make an Inglenook work?

 

Here’s my previous thinking on the matter…

 

As Adrian explains on his (brilliant) website, the late Carl Arendt worked out a minimum size as being 3-2-2 opposed to the 5-3-3 of the original Inglenook Sidings. He doesn't attempt scaling up, but to retain the Inglenook formula the sidings wagon capacity needs to equal the head shunt capacity including the loco...

 

I decided to try to figure out a method of calculating these from looking at the classic Inglenook and trying to apply the same method to the reduced Inglenook. I need to examine the train length (TL), the wagon capacity of a single shorter siding (SSC) and the total siding capacity (TSC) and the total number of wagons involved (TW), and see if there was a relationship.

 

First and foremost, both shorter sidings had to have the same capacity. On first examination, the classic Inglenook had a train length of SSC + 2, but as soon as you examined the reduced Inglenook ... well, that didn't work! However, a relationship did seem to present itself so bore some further playing around with examination...

 

Classic Inglenook

Total Siding Capacity (TSC) = 3 + 3 = 6 wagons

Train Length (TL) = TSC - 1 = 6 - 1 =  5 wagons

Total Wagons (TW) = TL + Single Siding Capacity (SSC) = 5 + 3 = 8 wagons

 

So far, so good!

 

Reduced Inglenook

TSC = 2 + 2 = 4 wagons

TL = TSC - 1 = 4 - 1 = 3 wagons

TW = TL + SSC = 3 + 2 = 5 wagons

 

My calculations appear to have worked* so I'll try applying them to larger siding capacities, increasing them by 1 wagon length in the shorter sidings each time...

 

Expanded Inglenook (+ 1 wagon)

TSC = 4 + 4 = 8 wagons

TL = TSC - 1 =  8 - 1 = 7 wagons

TW = TL - SSC = 7 + 4 = 11 wagons

 

So, it appears that selecting 7 wagons out of 10 doesn't follow the Inglenook puzzle formula after all - selecting from 11 wagons keeps the puzzle difficulty proportional to the original! Amazingly, adding just three extra wagons has added a lot more complication ie 11! / (11-7)! = 39,916,800 / 24 = 1,663,200 combinations!!

 

Reduced Inglenook = TW = 5

Classic Inglenook = TW = 8

Expanded Inglenook + 1 = TW = 11


This seems to show a pattern of adding 3 wagons to the total number of wagons. If (a big if!) this same pattern of adding three wagons to the Total Wagon Capacity holds true, Expanded Inglenook + 2 should have a TWC of 14 wagons...

 

Expanded Inglenook (+ 2 wagons)

TSC = 5 + 5 = 10 wagons

TL = TSC - 1 = 10 - 1 = 9 wagons

TW = TL + SSC = 9 + 5 = 14 wagons

 

How many combinations now?  
14! / (14 - 9)! = 
726,485,760

 

Well, that should provide a bit of variety!

 

I think my calculations hold true, both to siding lengths etc and to the relationship of total number of wagons (adding three each time).

 

Bear in mind that the total length will be TL + PL (point length) + HL (headshunt length*) and must include some extra for clearances past stock around points. The last example would be 9 wagons for the train length + point length + 5 wagons plus loco. Even using short wheelbase stock and a small loco, the total length quickly grows to a point where a more interesting track layout can be fitted into the same space; after all, the Inglenook is a simple back and forth shunting puzzle in the same direction, whereas a loop gives opportunity for sidings to be shunted in opposite directions.

 

Expanded Inglenook (+3 wagons)

TSC = 6 + 6 = 12 wagons

TL = TWC - 1 = 12 - 1 = 11

TW = TL + SSC = 11 + 6 = 17 wagons

 

How many combinations now?  
17! / (17 - 11)! = 
494,010,316,800

 

Okay, now my head hurts!

 

An Inglenook that size would keep a shunter occupied for a long time making up just one train of 11 wagons!

 

Double ended Inglenook?

Now, I’ve been trying to figure this out (on paper) for a while…

 

I’m think of a marshalling yard type of formation, with the “long siding” in the middle and the two “short” sidings on either side. The middle siding holds 10 wagons (2 x 5 wagons) and the short sidings 6 (2 x 3 wagons), with headshunts either side both holding 3 wagons plus loco. Two locos work at the same time (from either end) to assemble their respective 5 wagon train to form a 10 wagon train on the central siding.

 

Working against each other, the two locos race to compete their portion of the train. Working with each other requires operators to work out the quickest way to assemble the ten wagon train working from both sides in the minimum number of moves. This could be done DC with a controller for each side of the sidings and locos electrically isolated onto each side, or on DCC where locos could freely roam either side!

 

Maybe this has been done before? 
 

Steve S

 

Edited by SteveyDee68
  • Interesting/Thought-provoking 2
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...