There are lamps in a square, initially all turned off, as is shown in the figure below.
The way the switches of the lamps are designed to work is as follows:
If we change the status of any lamp (if it is turned on, then we turn it off; if it is turned off, then we turn it on), then the statuses of all the other lamps in the same row or column change at the same time.
If we call this one step, what is the minimum number of steps we need to switch on all of the lamps?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
@Marta Reece has already provided the mathematics behind this problem, give her solution an upvote.
I just have a penchant for imagery.