Wednesday, June 29, 2005

 

Problem# 12

Look at this 2D layout of a construction having eight compartments, with green blocks representing the doors connecting the respective compartments.



(Well, I agree that's a poor design! A person in the lawn can enter in only through the JunkYard(JY) or through the RestRoom(RR)! Now it's too late; the construction ready to be released. We gotta live with it! But I strongly recommend the designer of the layout to study Design-Patterns. Visit http://patternosophy.blogspot.com/ and participate in design-discussions)


You're the unfortunate person asked for surveying the compartments. You must pass through each door exactly once (assume, the door locks when you pass though it!) and you must visit each and every compartment (well, more than once, if you wish to).

You can choose to start from any compartment. Don't worry about 'how will you reach there' in the first place (assume, you will be teleported there. After that, you'll use the green doors to move around!). Remember, you are done, when all the compartments are visited at least once and all the doors are locked (You'll be teleported back, out of the house!).

Draw out a plan of your visit. Bonus, if you could count all such plans possible!

Comments:
Start from playyard.
playyard->kitchen->room3->restroom->junkyard->lawn->restroom->room2->room1->hall->playyard->room3->hall.
 
That's correct!

Can you find if there exists another sequence (other than reversing the above sequence)?
 
Start from hall.
hall->room3->restroom->lawn->junk yard->restroom->room2->room1->hall->playyard->kitchen->room3->playyard.
 
There are two rooms with three doors each. So one has to start from one of these and end at the other. All other doors have even no of doors and so u can move through them once or twice if required and u wont have to worry about any unclosed doors. [:D]
 
There are two rooms with three doors each. So one has to start from one of these and end at the other. All other doors have even no of doors and so u can move through them once or twice if required and u wont have to worry about any unclosed doors. [:D]
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?