# Switcheroo - Which switch turns on the light bulb?

There is a famous puzzle, asked several times on this site, regarding a light bulb hidden in a room. There are three switches outside. You can flip them however you want, but you cannot continue flipping them once you've opened the door to the bulb. How do you figure out which switch connects to the bulb? The answer, which I'll put in spoilers for those who don't know yet, is:

You flip one switch on, wait a few minutes, flip it off, and flip another switch on, then open the door. If it's on, it's the second switch. If it's off, but it's hot, it's the first switch. If it's off, but cold, it's the switch you didn't touch.

My question is as follows: Assuming you don't have a thermometer, can you increase the total number of switches beyond three and still be able to tell which switch connects to the bulb?

Once you're done with this one, check out the sequel.

• I'm afraid this is at least the fourth time this famous puzzle has Bern posted here. See, e.g., puzzling.stackexchange.com/questions/5977/shedding-some-light Jun 7, 2016 at 22:08
• Possible duplicate of Which switch goes to which bulb? Jun 7, 2016 at 22:09
• Though the corollary might be new. Jun 7, 2016 at 22:09
• @GarethMcCaughan: Absolutely right. I apologize - I did a search but couldn't find this riddle. I'll edit the question to make the focus of the question on the corollary.
– user24580
Jun 7, 2016 at 23:48
• @DonielFilreis So, just for the sake of precision, you're saying that we can only determine whether a lightbulb is hot or cold, with no granularity outside of those two states? Jun 8, 2016 at 1:52

The Pigeonhole Principle, if I'm interpreting the problem space correctly, should put an absolute upper bound of four switches on the question as it stands.

You have given a restriction that temperature is a binary state: hot or cold. Assuming the only other output is whether the light is shining, we have only four states:

1. Hot and Lit => A
2. Hot and Unlit => B
3. Cold and Lit => C
4. Cold and Unlit => D

The pigeonhole principle says every possibility has to go into one of those buckets, A-D. So if you had 5 switches, at least one of those buckets is guaranteed to have two possible entries (e.g. B = Switch 1 OR Switch 5). Now just from the nature of the outputs, we can't even get those 4 switches, but that's less theoretical and more nuanced.

Edit:

That said if you're looking for more cutesy answers, you can stretch it to four with a third output:

Whether the filament is intact (assuming a quality lightbulb). Flip switch one. Wait 100 years, then turn it off. Flip switch two for 5 minutes, then turn it off. Flip switch three. Enter the room. If the bulb's filament is destroyed, it was switch one. If it's hot but off, it was switch two. If it's on, it was switch three. Otherwise, it's switch four.

• That is indeed the correct answer. Four is the maximum. The only difference between this and the original is that "cold and lit" means that the switch was just turned on, while "hot and lit" means that it's been on for a while. Like you said; if you want to examine the filament or whether the ceiling caught on fire, you can extend it, but realistically speaking, four is the maximum.
– user24580
Jun 8, 2016 at 18:40
• @DonielFilreis: It's unclear to me how you could actually use Cold and Lit to extend this to four switches. Four is definitely an upper bound, but that doesn't in itself make it possible. Can you describe the algorithm you're thinking of that can actually make use of "Cold and Lit?" Everything I come up with breaks down. Jun 8, 2016 at 20:46
• @MarkPeters Lol +1 for "Wait 100 years." Jun 8, 2016 at 21:44
• @MarkPeters: Why is there an issue with having a bulb that's cold and lit? If you don't wait too long between flipping the switch and feeling the bulb, it should still be relatively cool.
– user24580
Jun 8, 2016 at 23:53
• @DonielFilreis: That's not the issue...the issue is what then are the steps you do before going in the room, and therefore what does it mean (i.e. which switch is connected) if the bulb is cold and lit? The best I could say is "Turn switch 1 on for 1 minute, then off. Turn switch 2 on and leave it on. After a minute, turn switch 3 on and immediately enter the room." If cold and unlit, 4. If cold and lit, 3. If hot and lit, 2. If hot and unlit, 1. Problem with that last case is, in the minute that switch 1 was off, it would've cooled down again. Jun 8, 2016 at 23:58

In the classic solution when you enter the room there are only 3 possible states the bulb can be in

HOT and OFF
COLD and OFF
ON

Because the state of the bulb leads you directly to which switch is connected, it is impossible to extend this puzzle to more switches unless you either

allow the door to be opened multiple times

or allow consideration of more than 3 states as alluded to by use of a thermometer eg. a simple extension to 4 switches would be

HOT and OFF
COLD and OFF
ON
WARM and OFF