Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 14-09-2007, 09:41 PM   #1 (permalink)
C# Be Sharp !
 
Zeeshan Quireshi's Avatar
 
Join Date: Jun 2006
Location: Toronto
Posts: 1,805
Lightbulb Logic Question - Number of combinations of bogies of a Train under a condition.


A train with n carriages labelled 1, 2, 3, . . . n, in that order, is standing on a railway
track. The railway track has a short siding that can accommodate upto two carriages.

As you move the train past the siding from left to right, you can do one of the following
at each step.

(i) Move a carriage from the left side to the right side directly.
(ii) Move one or two carriages into the siding, only if the siding is currently empty.
(iii) Move all the carriages out of siding to the right side.

Depending on the sequence of operations you perform, the carriages in the train may
be reordered. For instance, if you start with five carriages 1, 2, 3, 4, 5, you can reorder
this as 1, 4, 2, 3, 5 by keeping 4 in the siding, sending 2 and 3 to the right, then moving
4 out of the siding and finally moving 1 to the right. Similarly, you can generate the
order 1, 3, 4, 2, 5 by keeping 3, 4 in the siding when you move 2 to the right.
Note that you cannot add a carriage to the siding if it is not empty, even if there is only
one carriage currently in the siding. Similarly, if there are two carriages in the siding,
you cannot remove only one of them and move it to the right—you must remove both.
Thus, for example, you cannot generate the order 3, 1, 4, 2, 5. Since 2 is adjacent to 5,
3, 4 must have gone into the siding together, but they have come out separated by 1,
which is not permitted.

Overall, if one tries out all possible ways of using the siding while moving a train with
five carriages, there are 24 different ways in which the carriages can be reordered.
How many different reorderings can you generate if you have a train with:
(a) 8 carriages
(b) 9 carriages
(c) 10 carriages


PS: I really need a solution to this question , i'm preparing for Computing lympiads n i can't solve this particular question n can't find any source on how to solve it .

Also if you can recomend me any books to learn/practice these type of Problem's itll be very helpful.
__________________
There are 10 types of people in the world: those who understand binary and those who do not.
Zeeshan Quireshi is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 15-09-2007, 01:51 AM   #2 (permalink)
In The Zone
 
Nav11aug's Avatar
 
Join Date: Sep 2006
Location: Kharagpur for now
Posts: 362
Default Re: Logic Question - Number of combinations of bogies of a Train under a condition.

Listen .. work out the combinatorics for yourself but the solution is ... for n carriages , the no of reorderings that can be produced is (n-1)!

So,
(a)5040
(b)40320
(c)362880

I dunno what kind of book u wnat...only for combinatorics or learning 'intelligent' math
__________________
http://www.last.fm/user/NOLFxceptMe/
http://naveendageek.blogspot.com

Back after a long time. And well, EndSems screwed up as usual :)
Nav11aug is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cpu motherboard combinations direfulsky CPU / Motherboards 2 28-07-2007 11:09 PM
How to identify Local sms number and National sms number? casual_gamer Mobiles and Tablets 2 04-12-2005 02:31 PM
MS train simulator d QnA (read only) 2 28-10-2005 12:46 AM
BVE Train simulator ferrarif50 Gamerz 2 26-09-2005 09:15 AM
RAID: Permutation & combinations??? tarun_34 QnA (read only) 6 24-02-2005 04:37 AM

 
Latest Threads
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 05:21 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2