Suppose that you are in a room with 16 light switches, which are arranged in a line on the wall. Each light switch is connected to a unique lightbulb in another room. However, some of the 16 lightbulbs are burned out, which means that the 16 light switches you see consist of functional and non-functional switches. The light switches are currently all set in the OFF positions. It is also known that the 16 switches are arranged in such a manner that within any 7 consecutive light switches, there are an odd number of functional switches. Assume that setting a functional switch to the ON position will turn on the corresponding lightbulbs, and similarly setting it to OFF will turn off the bulb. Turning any switch connected to a burned-out bulb to ON, of course, will have no effect on the bulb.
You are allowed to take 'turns' to deduce the position of the functional switches. During a turn, you can set the 16 light switches to any ON/OFF configuration you wish, and someone from the room with the lightbulbs will tell you how many lightbulbs are on.
Determine a strategy that is guaranteed to identify all the functional light switches using only 5 turns.
Question
bushindo
Suppose that you are in a room with 16 light switches, which are arranged in a line on the wall. Each light switch is connected to a unique lightbulb in another room. However, some of the 16 lightbulbs are burned out, which means that the 16 light switches you see consist of functional and non-functional switches. The light switches are currently all set in the OFF positions. It is also known that the 16 switches are arranged in such a manner that within any 7 consecutive light switches, there are an odd number of functional switches. Assume that setting a functional switch to the ON position will turn on the corresponding lightbulbs, and similarly setting it to OFF will turn off the bulb. Turning any switch connected to a burned-out bulb to ON, of course, will have no effect on the bulb.
You are allowed to take 'turns' to deduce the position of the functional switches. During a turn, you can set the 16 light switches to any ON/OFF configuration you wish, and someone from the room with the lightbulbs will tell you how many lightbulbs are on.
Determine a strategy that is guaranteed to identify all the functional light switches using only 5 turns.
Edited by bushindoLink to comment
Share on other sites
15 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.