Berlekamp switching game

From HandWiki
Revision as of 19:07, 6 March 2023 by MainAI6 (talk | contribs) (simplify)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Berlekamp switching game is a mathematical game proposed by American mathematician Elwyn Berlekamp.[1] It has also been called the Gale–Berlekamp switching game, after David Gale, who discovered the same game independently,[2] or the unbalancing lights game.[3] It involves a system of lightbulbs controlled by two banks of switches, with one game player trying to turn many lightbulbs on and the other trying to keep as many as possible off. It can be used to demonstrate the concept of covering radius in coding theory.

Rules

The equipment for playing the game consists of a room containing rectangular array of lightbulbs, of dimensions [math]\displaystyle{ a\times b }[/math] for some numbers [math]\displaystyle{ a }[/math] and [math]\displaystyle{ b }[/math]. A bank of [math]\displaystyle{ ab }[/math] switches on one side of the room controls each lightbulb individually. Flipping one of these switches changes its lightbulb from off to on or from on to off, depending on its previous state. On the other side of the room is another bank of [math]\displaystyle{ a+b }[/math] switches, one for each row or column of lightbulbs. Whenever any of these switches is flipped, every lightbulb in the row or column that it controls changes from off to on or from on to off, depending on its previous state. When flipping more than one switch, the order in which the switches are flipped does not make a difference to the outcome: the same lightbulbs will be lit at the end of the sequence of flips no matter what order they are flipped.

The game is played in two rounds. In the first round, the first player uses the switches that control individual lights, to set the lights on or off arbitrarily. In the second round, the second player uses the switches that control rows or columns of lights, changing the pattern of lights set by the first player into another pattern (or, possibly, leaving it unchanged). The goal of the first player is to have as many lights remaining lit at the end of the game as possible, and the goal of the second player is to have as few lights remaining lit as possible. Therefore, the first player should choose a pattern of lights for which the second player cannot turn off many lights.

History

Berlekamp worked at Bell Labs in Murray Hill, New Jersey from 1966 to 1971.[4] While there, he constructed a physical instance of this game for the case [math]\displaystyle{ 10 \times 10 }[/math] in the Mathematics Department commons room.[1][2] David Gale also invented the game independently, some time prior to 1971.[5]

Early research on related problems included publications by Andrew M. Gleason (1960), whose computer experiments can be interpreted as asking, for the [math]\displaystyle{ 15\times 15 }[/math] game, how well the second player can do against a first player who plays randomly,[6] and by J. W. Moon and Leo Moser (1966), who address Gleason's question theoretically, showing that for almost all choices of the first player, in the limit of large game board sizes, the optimal game value is close to [math]\displaystyle{ \tfrac{1}{2}n^2 }[/math].[7]

Analysis

Mathematically, one can describe the lights turned on by the first player's move as a set [math]\displaystyle{ S }[/math], and the smallest number of lights that can be achieved by the best play for the second player as a number [math]\displaystyle{ f(S) }[/math]. The best play for the first player is to choose a set [math]\displaystyle{ S }[/math] that maximizes [math]\displaystyle{ f(S) }[/math]. Therefore, one can describe the largest number of lights that can be achieved by the best play for the first player as a number [math]\displaystyle{ R_{a,b} = \max_S f(S) }[/math]. Beyond the question of how to play well in an individual game, a broader question that has been the object of mathematical research is to characterize the value of [math]\displaystyle{ R_{a,b} }[/math] in general, as a function of [math]\displaystyle{ a }[/math] and [math]\displaystyle{ b }[/math], to determine its behavior as a function, or to calculate its value for as many combinations of [math]\displaystyle{ a }[/math] and [math]\displaystyle{ b }[/math] as possible.

The case of a square [math]\displaystyle{ n \times n }[/math] array has been solved for [math]\displaystyle{ n \leq 12 }[/math]. Additionally, lower bounds for [math]\displaystyle{ R_{n,n} }[/math] have been found for [math]\displaystyle{ n \leq 20 }[/math].[8][9][10][11] These numbers are:

Solutions for [math]\displaystyle{ n \times n }[/math]
[math]\displaystyle{ n }[/math] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
[math]\displaystyle{ R_{n,n} }[/math] 0 1 2 4 7 11 16 22 27 35 43 54 ≥ 60 ≥ 71 ≥ 83 ≥ 96 ≥ 107 ≥ 122 ≥ 139 ≥ 148

Asymptotically, these numbers grow as [math]\displaystyle{ \tfrac{n^2}{2}-\Theta(n^{3/2}) }[/math].[2][5][12]

Computational complexity

Because there are exponentially many choices for which switches to flip, an exhaustive search for the optimal choice is not possible for large [math]\displaystyle{ n }[/math], setting up the question of how well computationally-limited players can play this game.

The first player can cause the expected game value to be [math]\displaystyle{ \tfrac{n^2}{2}-O(n^{3/2}) }[/math] by playing randomly. Similarly, the second player can obtain a value whose expected distance from [math]\displaystyle{ \tfrac{n^2}{2} }[/math] is [math]\displaystyle{ \Omega(n^{3/2}) }[/math] by playing randomly; this value might either be larger or smaller than [math]\displaystyle{ \tfrac{n^2}{2} }[/math], but if it is larger the second player can flip all row switches to get a value that is smaller by the same amount.[2][5][12] This random strategy for the second player can be made non-random using the method of conditional probabilities, giving a polynomial time algorithm that obtains the same solution value guarantees. A different derandomization gives a parallel algorithm in the complexity class NC.[13]

Finding the optimal choice for the second player in the game, once the first player has chosen which bulbs to light, is an NP-hard problem.[14] However, there is a polynomial-time approximation scheme for the [math]\displaystyle{ n\times n }[/math] game that can find a choice for the second player that leaves only [math]\displaystyle{ (1+\varepsilon) }[/math] times the minimum possible number of lit bulbs, for any [math]\displaystyle{ \varepsilon\gt 0 }[/math], in time [math]\displaystyle{ O(n^2)+2^{O(1/\varepsilon^2)} }[/math].[15]

Connection to coding theory

The Berlekamp switching game can be used in coding theory as a demonstration of the covering radius of a certain binary linear code. A binary linear code of length [math]\displaystyle{ n }[/math] and dimension [math]\displaystyle{ d }[/math] is defined as a [math]\displaystyle{ d }[/math]-dimensional linear subspace of the [math]\displaystyle{ n }[/math]-dimensional vector space [math]\displaystyle{ \mathbb{F}_2^n }[/math] over the finite field with two elements, [math]\displaystyle{ \mathbb{F}_2 }[/math]. The elements of the subspace are called codewords, and the covering radius is the smallest number [math]\displaystyle{ r }[/math] such that every point of [math]\displaystyle{ \mathbb{F}_2^n }[/math] is within Hamming distance [math]\displaystyle{ r }[/math] of a codeword.

Let [math]\displaystyle{ n = ab }[/math] and [math]\displaystyle{ d = a + b - 1 }[/math]. For these parameter values, the vector space [math]\displaystyle{ \mathbb{F}_2^n }[/math] describes all possible patterns of lit bulbs on the [math]\displaystyle{ a\times b }[/math] array of lightbulbs, with a vector addition operation that combines two patterns by lighting the bulbs that appear in exactly one of the two patterns (the symmetric difference operation on the sets of lit bulbs). One can define a linear subspace consisting of all patterns that the second player can turn completely off, or equivalently of all patterns that the second player could create starting with a board that is completely off. Although the second player has [math]\displaystyle{ 2^{a+b} }[/math] choices for how to set the second bank of switches, this subspace has [math]\displaystyle{ 2^{a+b-1} }[/math] elements, giving it dimension [math]\displaystyle{ a+b-1 }[/math], because flipping all of the second player's switches has no effect on the pattern of lit bulbs.

Then [math]\displaystyle{ R_{a,b} }[/math] is the covering radius of this code. The set of lit bulbs chosen by the first player, with best play, gives a point of [math]\displaystyle{ \mathbb{F}_2^n }[/math] that is as far as possible from the linear subspace. The set of bulbs whose state is changed by the second player, with best play, gives the closest point in the linear subspace. The set of bulbs that remain lit after these choices are the ones whose number defines the Hamming distance between these two points.[1]

See also

  • Lights Out (game), a different puzzle involving turning off lightbulbs using switches that control multiple bulbs

References

  1. 1.0 1.1 1.2 Sloane, N. J. A. (1987). "Unsolved problems related to the covering radius of codes". in Cover, Thomas M.; Gopinath, B.. Open Problems in Communication and Computation. New York: Springer. pp. 51–56. doi:10.1007/978-1-4612-4808-8_11. 
  2. 2.0 2.1 2.2 2.3 Spencer, Joel (1994). "Lecture 6: Chaos from order". Ten Lectures on the Probabilistic Method. CBMS-NSF Regional Conference Series in Applied Mathematics. 64 (Second ed.). Philadelphia, Pennsylvania: Society for Industrial and Applied Mathematics. pp. 45–50. doi:10.1137/1.9781611970074. ISBN 0-89871-325-0. https://books.google.com/books?id=HTxo3kP7_5gC&pg=PA45. 
  3. Araújo, Gustavo; Pellegrino, Daniel (2019). "A Gale–Berlekamp permutation-switching problem in higher dimensions". European Journal of Combinatorics 77: 17–30. doi:10.1016/j.ejc.2018.10.007. 
  4. Sanders, Robert (April 18, 2019). "Elwyn Berlekamp, game theorist and coding pioneer, dies at 78". Berkeley News. University of California, Berkeley. https://news.berkeley.edu/2019/04/18/elwyn-berlekamp-game-theorist-and-coding-pioneer-dies-at-78/. 
  5. 5.0 5.1 5.2 Brown, Thomas A.; Spencer, Joel H. (1971). "Minimization of [math]\displaystyle{ \pm 1 }[/math] matrices under line shifts". Colloquium Mathematicum 23: 165–171, 177. doi:10.4064/cm-23-1-165-171. 
  6. Gleason, Andrew M. (1960). "Combinatorial Analysis". in Bellman, Richard; Hall, Marshall Jr.. 10. Providence, Rhode Island: American Mathematical Society. pp. 175–178. 
  7. Moon, J. W.; Moser, L. (1966). "An extremal problem in matrix theory". Matematički Vesnik 3(18) (37): 209–211. https://eudml.org/doc/259432. 
  8. Carlson, Jordan; Stolarski, Daniel (October 2004). "The correct solution to Berlekamp's switching game". Discrete Mathematics 287 (1–3): 145–150. doi:10.1016/j.disc.2004.06.015. 
  9. Sloane, N. J. A., ed. "Sequence A005311 (Solution to Berlekamp's switching game (or lightbulb game) on an n X n board)". OEIS Foundation. https://oeis.org/A005311. 
  10. Pellegrino, D.; Raposo Jr, A. (2022). "Constants of the Kahane–Salem–Zygmund inequality asymptotically bounded by 1". Journal of Functional Analysis 282 (2): 109293. doi:10.1016/j.jfa.2021.109293. 
  11. Pellegrino, D.; Raposo Jr, A. (2021). "Upper bounds for the constants of Bennett's inequality and the Gale-Berlekamp switching game". arXiv:2111.00445v3 [math.CO].
  12. 12.0 12.1 Komlós, J.; Sulyok, M. (1970). "Combinatorial theory and its applications, II (Proc. Colloq., Balatonfüred, 1969)". pp. 721–728. 
  13. Berger, Bonnie (1997). "The fourth moment method". SIAM Journal on Computing 26 (4): 1188–1207. doi:10.1137/S0097539792240005. 
  14. Roth, Ron M.; Viswanathan, Krishnamurthy (2008). "On the hardness of decoding the Gale–Berlekamp code". IEEE Transactions on Information Theory 54 (3): 1050–1060. doi:10.1109/TIT.2007.915716. 
  15. Karpinski, Marek; Schudy, Warren (2009). "Proceedings of the 41st Annual ACM Symposium on Theory of Computing, STOC 2009, Bethesda, MD, USA, May 31 - June 2, 2009". in Mitzenmacher, Michael. ACM. pp. 313–322. doi:10.1145/1536414.1536458.