# Turn on all five lightbulbs and escape the cave

You are running through a dark cave, and suddenly you find yourself at a dead end. But, there is hope. You encounter a row of 5 lightbulbs that are turned off. Each have a switch that toggles whether they are on or off.

The wall in front of you will open up if all 5 lightbulbs are on at once.

Unfortunately, there is a catch.

When you toggle a lightbulb, the lightbulbs to the left and right will also toggle. If the lightbulb is at the end of the row, then toggling it will turn on just its one neighbor.

Another catch: Once you press 4 switches, the switches will deactivate and stop working.

How are you going to turn on all the lightbulbs to unlock the wall and get through?

Bonus: Can you solve the puzzle in exactly four toggles? Note, you must switch at least 3 unique switches. And, you may not toggle a single switch twice in row.

• Why was I downvoted? I proposed a completely reasonable riddle. It may not have been so challenging, but I don't remember reading that the riddle must be super challenging in the guidelines in the "how to post a question/riddle" portion of Stack Exchange. Commented Nov 17, 2017 at 0:55
• Who knows? I didn't downvote, but people are entitled to their own opinions, even if it doesn't match with the guidelines. Commented Nov 17, 2017 at 1:05
• @boboquack I agree, and I was just asking why I was downvoted so I could improve my post. Commented Nov 17, 2017 at 1:22
• What I mean is that like as not it could have been a random downvote from someone having a bad day, it might not be for any particular reason. Commented Nov 17, 2017 at 2:37

in 2 toggles: 2 and 5, will make all the lights turn on

in 4 toggles:

4, 2, 5, 4. will use 4 toggles with 3 unique switches.

• I guess I should have stated that you can't switch and immideatly switch off the exact same switch. I'll update my riddle. Commented Nov 17, 2017 at 0:00
• fixed? @AssafiCohen-Arazi Commented Nov 17, 2017 at 0:02

Toggle the:

First and fourth lightbulb (or the second and fifth)

E.g.:

00000 -> 11000 -> 11111 (one of the four possibilities)

If you must do it four switches:

Toggle any other switch twice, but not in a row. E.g. one, five, four, five (00000 -> 11000 -> 11011 -> 11100 -> 11111)

• I see you've solved it in 2. Can you do it in exactly four, as shown in the edited bonus on the question? Commented Nov 16, 2017 at 23:48
• @AssafiCohen-Arazi OK, but that's not really a challenge. Commented Nov 17, 2017 at 0:49
• I believe you mean "one,five,four,five". Commented Nov 17, 2017 at 0:56
• @AssafiCohen-Arazi Yes Commented Nov 17, 2017 at 1:04