This is an interesting puzzle that I first came across when teaching a 1st year undergraduate course in problem solving. However, there's not really any advanced maths involved in the solution. All you need is some trial-and-error, logical thinking, and a bit of inspiration!
16 lights are arranges in a 4×4 square grid, and each light has a switch. The lights are initially set on or off randomly. The aim is to turn off all 16 lights, by pressing the right combination of switches. However, the switches are not wired directly to each light. Instead, flipping a switch will toggle all the lights in the same row and column as that switch (i.e. lights in the same row and column that were on will be turned off, and lights that were off will be turned on).
The questions to be answered are:
The grid below gives you a chance to try the puzzle yourself. Click or tap on a square to flip the switch there. Try to get all the squares to be grey. The small quarter circle in the top left of each square shows the initial state of the light. The number in the bottom right of each square shows the number of times each switch has been flipped so far. You can use the buttons at the bottom to reset the current problem, or try a new one.
Lights still on: 0; Switch flips: 0.
...
Start again:
New Problem:
If you are not getting anywhere, try to see if you can solve the problem with only one light on first. Then try two lights, and see if you can generalise. (This strategy of trying a simpler problem first, is a great technique for mathematicians to use when solving problems.)
If you can solve the basic problem, then try some of these extensions: