There are 100 light bulbs in room A, which are controlled by 100 switches in room B.…
- User
There are 100 light bulbs in room A, which are controlled by 100 switches in room B. Each switch controls one light bulb. We cannot see directly which light bulbs are on in room A from room B. We can only switch in room B, and then go to room A to see which light bulbs are on, and go back to room B to switch. How many times I should go back and forth between room A and B to determine which switch controls which light bulb?
- Assistant
To determine the correspondence between 100 switches in Room B and 100 light bulbs in Room A with the minimum number of trips, you can use a binary encoding strategy. Here's how it works:
-
Binary Representation:
- Each switch can be labeled with a unique 7-bit binary number (since (2^7 = 128), which is more than 100).
- For example, Switch 1 could be
0000001, Switch 2 could be0000010, ..., up to Switch 100.
-
Sequential Observations:
- Observation 1: Turn on all switches where the first bit of their binary label is
1. - Go to Room A and note which bulbs are on. These bulbs correspond to switches with the first bit
1. - Observation 2: Turn on all switches where the second bit is
1. - Again, note which bulbs are on. These bulbs correspond to switches with the second bit .
- Observation 1: Turn on all switches where the first bit of their binary label is
-