This paper by P. C. Fishburn and N. J. A. Sloane seems quite related: > "The Solution to Berlekamp’s Switching Game." ([PDF download][1]) > <b>Abstract</b>. Berlekamp’s game consists of a $10 \times 10$ array of light-bulbs, with $100$ switches at the back, one for each bulb, and $20$ switches at the front that can complement any row or column of bulbs. For any initial set $S$ of bulbs turned on using the back switches, let $f(S)$ be the minimal number of lights that can be achieved by throwing any combination of row and column switches. The problem is to find the maximum of $f(S)$ over all choices of $S$. We show that the answer is $34$. We also determine the solution for $n \times n$ arrays with $1 \le n \le 9$. <br /> <img src="http://cs.smith.edu/~orourke/MathOverflow/Berlekamps_Switch_game.jpg" alt="Berlekamps" /> <br /> <sub>(Image from [this link][2].)</sub> [1]: http://www2.research.att.com/~njas/doc/Lightbulb.pdf [2]: http://shortfatboychalkboard.wordpress.com/2010/09/12/unbalancing-lights/