# Seven light bulbs in a circle, switch three adjacent ones at a time [duplicate]

This question already has an answer here:

You have seven light bulbs in a circle. All the lights are off and you want to turn them all on. You are allowed to switch the state of any three adjacent light bulbs at time. What is the minimum number of steps you will need to turn them all on?

Just to illustrate, this is an example of what you can do. 0 means that the light is off. 1 means that the light is on.

Step - State

0th - 0 0 0 0 0 0 0

1st - 1 1 1 0 0 0 0

2nd - 1 1 0 1 1 0 0

3rd - 0 0 0 1 1 0 1 ...

If you are feeling brave enough, try to generalize it to N light bulbs in a circle, switching M at a time.

## marked as duplicate by Mike Earnest, Community♦Dec 17 '17 at 22:56

• @MikeEarnest not an exact duplicate of that question, M is a variable here. – Jasen Dec 19 '17 at 1:59

N = M