Thursday, March 8, 2012

Puzzle of 100 Bulbs...

Just came across this puzzle in geekinterview.com,
College has two rooms, one is having 100 bulbs and other room has its switches. Switches doesn't have number/name written on it. New warden doesn't know the switches for the bulbs. How many trips he has to make to identify all the switches for the bulbs?

And my answer to this puzzle is that he can do it in 20 trips...

Here is my solution,
1. Group 100 switches in to 10groups of 10 switches each.
2. On all the switches in group 1, make a trip and note down the bulbs belong to that group
3. Repeat step 2 for all the groups . That will make 10 trips and at the end of 10 trips bulbs also grouped along with switches.
4. Now ON one switch in each group - 10 switches are on now
5. make a visit and mark down the bulbs - now each bulb can be matched with its switch
6. Repeat step 4 and 5 - for remaining 90 bulbs

so by end of this 20 trips he will be able to match all 100 switches with the bulbs.

I am not sure whether it is possible to solve this problem with less than 20 trips.

No comments: