A4. Nine lamps are arranged in a square. Each lamp can be on or off. If you press a lamp, that lamp and the lamps in the same row or column change state: from on to off or vice versa. Initially, all lamps are on.

What is the smallest number of presses needed to turn all the lamps off?

![](https://cdn.mathpix.com/cropped/2024_04_17_8b40d2c2e9518068878ag-1.jpg?height=280&width=279&top_left_y=2307&top_left_x=1531)
A) 3
B) 4
C) 5
D) 9
E) It is not possible.
A4. A) 3 The order in which the lights are pressed does not matter for the final result. By pressing the three lights in the top row, all lights change from on to off. The lights in the top row change state three times, and the other lights change state exactly once.

It is not possible to turn off all the lights by pressing two (or fewer) lights. Indeed, there will then be a light that does not lie in the same row or column as one of the pressed lights. This light will therefore remain on.