Light bulbs in a rectangular grid Suppose we have a grid of 5 &#x00D7;<!-- × --> 5 ligh

Craig Mendoza

Craig Mendoza

Answered question

2022-06-23

Light bulbs in a rectangular grid
Suppose we have a grid of 5 × 5 light bulbs with a switch to each bulb. If we press a switch it toggles all the lights in its row and column. Given any initial configuration, is it possible to make all the lights on or all the lights off by a particular sequence of switches?
I do not remember whether I have read about this problem somewhere or it just came up in my mind by some similar problems. Any hints/suggestions/links are highly appreciated.

Answer & Explanation

Jaylee Dodson

Jaylee Dodson

Beginner2022-06-24Added 22 answers

Step 1
The answer is no, not for all initial configurations it is possible to switch all lights off. As for many similar light-switching puzzles, the trick is to interpret the setting in a vector space over the finite field F 2 .
Identify the state of the lights with 5 × 5 matrices over F 2 . (An entry 1 means light on, an entry 0 means light off.) Given such a matrix A, the effect of pressing the switch in the ith row and the jth column is the same as doing the transition A A + S i j , where S i j is the 5 × 5 matrix having entries 1 in the ith row and in the jth column and having entries 0 otherwise.
Step 2
Now we compute B := S 12 + S 13 + S 14 + S 15 + S 21 + S 31 + S 41 + S 51 .
All 8 involved S-matrices have an entry 1 at the position (1,1), so B 11 = 0. Moreover, for all j { 2 , 3 , 4 , 5 } there are exactly 4 involved S-matrices (namely S 12 , S 13 , S 14 and S 15 ) with an entry 1 at the position (1, j). The same is true for position (j, 1), so B 1 j = B j 1 = 0 for all j { 2 , 3 , 4 , 5 }. Finally, for i , j { 2 , 3 , 4 , 5 }, there are exactly two involved S-matrices having an entry 1 at the position (i, j) (namely S i 1 and S 1 j ), so B i j = 0 for all i , j { 2 , 3 , 4 , 5 }. Together, we get B = 0.
Therefore, the set of the 25 matrices S i j is linearly dependent, implying that their linear hull does not equal the vector space of all 5 × 5 matrices over F 2 (which has dimension 25).
Hence, there are initial light configurations which can never be switched off.

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Discrete math

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?