2014 Bulbs Logical Puzzle || How to get all 2014 light bulbs on? || Interview Puzzle


Puzzle Details :

On a circle there are 2014 light bulbs, 2 are ON, and the remaining 2012 are in an OFF state. You can choose any bulb and change the neighbor’s state from ON to OFF or from OFF to ON. remember if you select any bulb, you can change the state of the neighboring bulbs only. Doing so, can we get all 2014 light bulbs on? If yes, How?

Solution



This puzzle is a perfect example, which requires out of box thinking. If you think that it is not possible to get all 2014 light bulbs on, then you are wrong. Yes, it is possible to get all 2014 light bulbs on. I will explain the most logical way of solving this puzzle.

for convenience, label 2014 bulbs from b1 to b2014.

First and foremost the most important point is the position of the light bulb, which is in on state is not given, so we assume that they are adjacent and make sure that you are naming the bulbs from the first on bulb…

example looks like this 

b1(on) b2(on) b3(off) b4(off) b5(off)………b2014(off) (assume it is in circular path)

Here b1 and b2 bulbs are on and the remaining bulbs are in off state remember all bulbs are placed in a circular path.

now since two bulbs are in on state and the remaining 2012 bulbs are in off state clearly all 2012 bulbs which is in off state are adjacent, now we will operate on these 2012 bulbs as….
create a group of 4 off bulbs, we can choose any off bulb apart from the one next to the on bulb and able to make two bulbs adjacent to it in on state. now choose any one of two bulbs to which we just turn in on state and made two more bulbs in on state.

so clearly we can make four adjacent bulbs in on state.

let's understand with an example, first create a group of 4 bulbs with b3, b4, b5, and b6, remember b1 and b2 are already in on state.

at starting all four bulbs are in the off state 
b3(0ff) b4(0ff) b5(0ff) b6(0ff) 
first choose 2nd bulb in the group and turn neighboring bulbs 1 and 3 in on state…this looks like this. 
b3(0n) b4(0ff) b5(0n) b6(0ff)
now choose 3rd bulb and turn neighboring bulbs 2 and 4 in on state…by doing this all 4 bulbs are in on state
b3(0n) b4(0n) b5(0n) b6(0n)

once this is done consider another group adjacent to group1 and call it the group2 with b7, b8, b9, and b10 bulbs.

at starting all four bulbs are the off state 
b7(0ff) b8(0ff) b9(0ff) b10(0ff) 
first, choose 2nd bulb in the group and turn neighboring bulbs 1 and 3 in on state…this looks like this. 
b7(0n) b8(0ff) b9(0n) b10(0ff)
now choose 3rd bulb and turn neighboring bulbs 2 and 4 in on state…by doing this all 4 bulbs are in on the state
b7(0n) b8(0n) b9(0n) b10(0n)

by repeating these steps we can turn all 2012 bulbs into on state (4*503=2012)
since there are 2012 bulbs, we have to create 503 groups, 503 is because 4*503=2012,  and by repeating the above steps we can turn all 2012 bulbs in on state.

Now all 2014 bulbs are in on state.

Another Approach - Simplified Solution

When we Keep two lighted bulbs adjacent.
Let’s assume initial state of circuit as {0,0,0,1,1,0,0,0,0…..,0,0}                                                    
where 1 = Switched ON & 0 = Switched OFF

Choose the second last bulb from bulb which has state =1, then 2 bulb will be lighted on either side
next state becomes {1,0,1,1,1,1,0,1,0,0,0…..0,0}

So, at each step we are lighting 4 bulbs, since 2012 is a multiple of 4, there will come a stage where all bulbs will be ON. I think it depends on the number of lightbulbs and the order the two lighted bulbs are in.

4 cases
1. If the two lighted bulbs are next to each other and the total number of lightbulbs is an odd multiple of 2 (odd # * 2), then we can turn on all bulbs.
2. If the two lighted bulbs are next to each other and the total number of lightbulbs is an even multiple of 2 (even # * 2), then we can turn on all but 2, **unless the total number of bulbs is 2, which doesn’t make sense here as a scenario anyways.
3. If the two lighted bulbs have a one bulb gap between them, and the total number of lightbulbs is an odd multiple of 2 (odd # *2), then we can turn on all but 2.
4. If the two lighted bulbs have a one bulb gap between them, and the total number of lightbulbs is an even multiple of 2 (even # * 2), then we can turn on all bulbs.
The two cases relevant here are case #2 and case #4. Try this for the simplest cases: 4 light bulbs and 6 light bulbs, and you’ll quickly see that these conclusions should hold true for larger sets.




You may like these posts:

No comments:

Post a Comment