Four Switches, One Light Bulb

Brain Teaser · Medium · Free problem

There is a single light bulb in a closed room. Outside the room are four switches -- exactly one of them controls the bulb. All four switches start in the off position.

You can flip any combination of switches on or off as many times as you like before entering the room. Once you enter the room, you can look at the bulb and touch it (to feel its temperature). After entering, you cannot go back and change the switches.

What is the minimum number of times you need to enter the room to determine with certainty which switch controls the light bulb?

Hints

  1. Think about what information you can gather from the bulb beyond just whether it is on or off.
  2. An incandescent bulb that has been on for a while will be warm. That gives you a second binary signal -- can you use it to double the number of distinguishable states?
  3. Try turning two switches on, waiting, then turning one off and a third on right before you enter. Map out the four possible (on/off, warm/cool) outcomes.

Worked Solution

How to Think About It: The naive approach says you need to isolate each switch individually -- flip one, check, repeat -- which would take up to 3 entries (if the first three are wrong, the fourth is identified by elimination). But that is wasteful because each entry only extracts one bit of information: is the bulb on or off? The key insight is that a light bulb carries more than one bit of observable state. You can see whether it is on or off (visual), and you can feel whether it is warm or cool (thermal). That gives you $2 \times 2 = 4$ distinguishable states, which is exactly enough to label 4 switches.

Key Insight: A light bulb that has been on for a while is warm. By staggering when you turn switches on and off, you can encode each switch's identity into a unique (on/off, warm/cool) pair -- and read all four in a single visit.

The Method:

1. Turn on switches 1 and 2. Leave them on for several minutes so the bulb (whichever one they might control) heats up. 2. After waiting, turn switch 2 off and turn switch 3 on. Enter the room immediately. 3. Observe the bulb's state: - On and warm -- Switch 1. It has been on the entire time, so the bulb is lit and hot. - Off and warm -- Switch 2. It was on long enough to heat the filament, but you just turned it off, so the bulb is dark but still warm to the touch. - On and cool -- Switch 3. You just turned it on, so the bulb is lit but has not had time to heat up. - Off and cool -- Switch 4. It was never turned on, so the bulb is dark and at room temperature.

Each of the four switches maps to a unique combination, so one entry is sufficient.

Practical Considerations: This only works with incandescent or halogen bulbs that produce heat. With LEDs or fluorescent bulbs, the thermal channel disappears and you would need a different encoding (e.g., flipping patterns observed by a helper, or using a dimmer). In an interview, it is worth mentioning this assumption -- it shows you understand the physical mechanism behind the trick, not just the memorized answer.

Answer: You need to enter the room only once. The procedure exploits two independent observables (visual state and thermal state) to create four distinguishable outcomes from a single observation.

Intuition

This is fundamentally an information-theoretic problem disguised as a physical puzzle. You have four possibilities to distinguish, which requires $\log_2 4 = 2$ bits of information. A single yes/no observation (is the light on?) gives you only 1 bit per room entry, so naively you would need 2 entries. The clever trick is recognizing that the bulb's temperature is a second independent channel that also carries 1 bit (warm vs. cool). By encoding switch identities across both channels simultaneously, you extract 2 bits in one visit.

This pattern -- finding hidden dimensions of information in a seemingly constrained observation -- shows up constantly in quant work. In trading, the price of an option tells you the market's implied volatility, but the bid-ask spread tells you something about liquidity and adverse selection. A single data point carries multiple signals if you know where to look. The lesson from this puzzle is always to ask: what else can I observe, and how do I design my experiment to make every observable dimension count?

Open the full interactive solver →