The search for symmetry, as an unusual yet profoundly appealing phenomenon, and the origin of regular, repeating configuration patterns have long been a central focus of complexity science and physics. To better grasp and understand symmetry of configurations in decentralized toroidal architectures, we employ group-theoretic methods, which allow us to identify and enumerate these inputs, and argue about irreversible system behaviors with undesired effects on many computational problems. The concept of so-called “configuration shift-symmetry” is applied to two-dimensional cellular automata as an ideal model of computation. Regardless of the transition function, the results show the universal insolvability of crucial distributed tasks, such as leader election, pattern recognition, hashing, and encryption. By using compact enumeration formulas and bounding the number of shift-symmetric configurations for a given lattice size, we efficiently calculate the probability of a configuration being shift-symmetric for a uniform or density-uniform distribution. Further, we devise an algorithm detecting the presence of shift-symmetry in a configuration. Given the resource constraints, the enumeration and probability formulas can directly help to lower the minimal expected error and provide recommendations for system’s size and initialization. Besides cellular automata, the shift-symmetry analysis can be used to study the nonlinear behavior in various synchronous rule-based systems that include inference engines, Boolean networks, neural networks, and systolic arrays.

Symmetry is a synonym for beauty and rarity, and generally perceived as something desired. In this paper, we investigate an opposing side of symmetry and show how it can irreversibly “corrupt” a computation, and restrict a system’s dynamics and its potentiality. We demonstrate this fundamental phenomenon, which we call “configuration shift-symmetry,” affecting many crucial distributed tasks on the simplest gridlike synchronous system of cellular automation. We show how to count these symmetric inputs depending on a lattice size and its prime factorization, how likely they are encountered, and how to detect them.

## I. INTRODUCTION

The structure of the computational rules that result in regular, repeating system configurations has been studied by many, yet the question of how the natural and engineered system organize into symmetric structures is not completely known. To understand the role of symmetry of the starting configurations (the inputs), how they are processed (the machine), and produce the final configurations with desired properties (the outputs) we use a cellular automata (CA) as a simple distributed model of computation. First introduced by John von Neumann, CAs were instrumental in the exploration of logical requirements for machine self-replication and information processing in nature.^{45} Despite having no central control and limited communication among the components, CAs are capable of universal computation and can exhibit various dynamical regimes.^{9,56,63} As one of the structurally simplest distributed systems, CAs have become a fundamental model for studying complexity in its purest form.^{20,64} Subsequently, CAs have been successfully employed in numerous research fields and applications, such as modeling artificial life,^{36} physical equations,^{24,58} and social and biological simulations.^{22,32,52,53}

The CA input configurations define a language that is processed by the machine. Exploring the structural symmetries of the input language not only translates to an efficient machine implementation but also allows us to argue about a problem insolvability and the irreversibility of computation.

In this paper, we explore the concept of shift-symmetry and revisit a well-known fact that any standard CA maintains a configuration shift-symmetry due to uniformity and synchronicity of cells. We show that once a system reaches a symmetric, i.e., spatially regular configuration, the computation will never revert from this attractor and will fail to solve all problems that require asymmetric solutions. As a result, the number of symmetries of the dynamical system is never decreasing. When a configuration slips to a symmetric, repeating pattern the configuration space of the CA irreversibly folds, causing a permanent regime “shift.” Consequently, a nonsymmetric solution cannot be reached from a shift-symmetric configuration. A more general implication is that a configuration is unreachable (even if symmetric) if a source configuration has a symmetry not contained in the target. Nonsymmetric tasks, such as leader election or pattern recognition, i.e., tasks expecting a final configuration to be nonsymmetric, are, therefore, principally insolvable, since for any lattice size there always exist input configurations that are symmetric. As a hypothesis, we also briefly discuss the eventual gradual increase of system’s symmetries at the end of this paper, however, without any strong claims or proofs attached.

Using basic results from group theory and elementary combinatorics, we develop three progressively more efficient enumeration techniques based on mutually-independent generators to answer the question of how many potential shift-symmetric configurations there are in any given two-dimensional CA lattice. As a side product, we demonstrate that the shift-symmetry is closely linked to prime factorization. We introduce and prove lower and upper bounds for the number of shift-symmetric configurations, where the lower bound (local minima) is tight and reached only for prime lattice sizes. We enumerate shift-symmetric configurations for a given lattice size and number of active cells.

Finally, we derive a formula and bounds for the probability of selecting shift-symmetric configuration randomly generated from a uniform or density-uniform distribution. We develop a shift-symmetry detection algorithm and prove its worst-case and average-case time complexities.

### A. Applications

All the formulas and proofs presented in this paper assume a two-dimensional CA with any number of states, and arbitrary uniform transition and neighborhood functions, which makes our results widely applicable.

Knowing the number of shift-symmetric configurations, we can directly determine the probability of selecting a shift-symmetric configuration by chance. This probability then equals an error lower bound or expected insolvability for any nonsymmetric task. As we show, the insolvability caused by shift-symmetry rapidly decreases asymptotically with the lattice size for a uniform distribution. For instance, the probability is $0.5$ for a $2\xd72$ lattice, but drops to around $2.7\xd710\u221215$ for a $10\xd710$ lattice. Since the number of shift-symmetric configurations heavily depends on the prime factorization of the lattice size, the probability function is nonmonotonously decreasing. To minimize the occurrence of shift-symmetries for uniform distribution, we generally recommend using prime lattices, or at least avoiding even ones. On the other hand, the probability for a density-uniform distribution is quite high, regardless of primes; it is around $10\u22123$, even for a $45\xd745$ lattice.

The distribution error-size constraints have important consequences for designing robust and efficient computational procedures for many crucial distributed problems, such as leader election,^{6,56} pattern recognition,^{49} edge detection,^{55} image translation,^{30} convex hull/minimum bounding rectangle,^{14} hashing or collision resolution for associative memory,^{16} encryption,^{60} and random number generation.^{57} For these tasks, an expected final configuration, e.g., reproduction of a certain two-dimensional image, is frequently nonshift-symmetric, and, therefore, unreachable from a symmetric configuration. Alternatively, an expected configuration can be unreachable even if it is shift-symmetric, which occurs when the vector space of its generating vectors (shifts) do not contain all the shifts of an initial configuration.

Practical implications of these properties include performance degradation of systolic Central Processing Unit (CPU) arrays and nanoscale multicore systems.^{67} Our results span to the hardware implementations of synchronous CAs with Field-Programmable Gate Array (FPGA), used, e.g., for traffic signals control,^{33} random number generation,^{54} and reaction-diffusion model;^{31} and spintronics, where computation is achieved by coupled oscillators.^{10,59} Also, current efforts to implement two or three-dimensional cellular automata using DNA tiles^{26,61} and/or gel-separated compartments in so-called “gellular automata”^{27,35} may face problems related to configuration shift-symmetry if a synchronous update is considered.

### B. Related work

In their seminal work, Packard and Wolfram^{46} identified the importance of symmetry and showed that the global properties of a CA emerge as a function of the transition function’s reflective and rotational symmetries. The fundamental algebraic properties of additive and nonadditive CAs were studied by Martin *et al.*,^{41} who demonstrated that in simple cases, there is a connection between the global behavior and the structure of the configuration transitions. Wolz and de Oliveira^{65} exploited the structure and the symmetry in the transition table to design an efficient evolutionary algorithm that found the best results for the density classification and parity problems. Marquez-Pita *et al.*^{39,40} used a brute-force approach to find similar input configurations that produce the same outputs. Their results are a compact transition function re-description schema that use wildcards to represent the many-to-one computation rules on a majority problem. Bagnoli *et al.*^{5} explored different methods of master–slave synchronization and control of totalistic cellular automata. A number of computation-theoretic results for CA were summarized by Culik *et al.*,^{21} who investigated CAs through the eyes of set theory and topology. The effect of symmetry on the complexity of Boolean functions was thoroughly researched by Babai *et al.*^{4} Pippenger^{47} studied translation functions capable of correcting CA configurations under a specific kind of symmetry: rotation (an isometry with a corner coordinate fixed).

Besides the symmetry of “transition functions” and the design of transition functions resulting in regular or synchronized patterns, a number of contributions to the theoretical CA literature have addressed the general structure and implications of shift-symmetric “configurations” also called translation invariant, or simply periodic, as we do here. This problem has been studied primarily in the context of group theory,^{13} through a general approach using stabilizers, group actions, and Bernoulli shifts. In particular, the work by Castillo-Ramirez and Gadouleau,^{12} for example, approaches the problem using Möbius inversion of the subgroup lattice. Our derivation differs from their work by leveraging the affordances of specifying in advance that our symmetries are restricted to shift-symmetries, i.e., the specific case of Cartesian powers of cyclic groups in two dimensions, and proceeding inductively, which allows us to derive stronger results for the subproblem of our interest. In particular, we provide more efficient and executable enumeration formulas in an algorithmic sense and a better lower bound for the number of aperiodic configurations. Note that Castillo-Ramirez and Gadouleau improved the bound found by Gao *et al.*^{25}

Another recent article^{23} explores similar questions regarding the number of distinct binary configurations of toroidal arrays in the presence of rotational and reflection symmetries. For our purposes, the ratio of symmetric to nonsymmetric configurations is of greater interest than a simple enumeration of the total. Accordingly, our work differs from theirs by our focus on enumerating how many of these configurations possess some nontrivial symmetry (and, additionally, we do not wish to be limited to the binary case of an alphabet of size 2).

The concept of symmetry in number theory has been applied to so-called tapestry design and periodic forests,^{3,42} which relates to CA configurations. However, the triangular topology and geometric branching differs from the discrete toroidal Cartesian topology typically used for CAs.

One of our main motivations is the pioneering work of Angluin,^{2} who noticed that a ring containing anonymous components (processors), which are all in the same state, will never break its homogeneous configuration and elect a leader. This intuitive observation is, in fact, a special case of the concept of configuration shift-symmetry for CAs. We will show that Angluin’s homogeneous state, which corresponds to a configuration of all zeros or all ones in a binary CA, is the most symmetric configuration for a given lattice size.

The concept of shift-symmetry is related to the notion of regular domains in computational mechanics.^{19,28,50,51} A shift-symmetric configuration is essentially a (global) regular domain spread to a full lattice. Although we cannot apply our results directly to regular domains at the level of subconfigurations, because we pay no attention to local symmetries and noncyclic and nonregular borders, the number of possible shift-symmetric configurations gives at least an upper bound on the number of possible regular domains.

In our previous work,^{8} we proved that configuration shift-symmetry, along with loose-coupling of active cells, prevents a leader from being elected in a one-dimensional CA.^{6} The “leader election” problem, first introduced by Smith,^{56} requires processors to reach a final configuration where exactly one processor is in a leader state (one) and all others are followers (zero). Leader election is a representative of a problem class where the solution is an asymmetric, nonhomogeneous, transitionally and rotationally invariant system configuration. A final fixed-point configuration is asymmetric, since it contains only one processor in a leader state. Clearly, leader election and symmetry are “enemies,” and, in fact, leader election is often called symmetry-breaking.

To enumerate shift-symmetric configurations for a one-dimensional case,^{8} we employed only basic combinatorics. Here, in order to span to two dimensions, we extend our enumeration machinery to include some basic concepts from group theory and we rely heavily on the notion of independent generators. We show that the insolvability caused by configuration symmetry extends beyond leader election to a whole class of nonsymmetric problems.

### C. Model

By definition, a CA^{17} consists of a lattice of $N$ components, called “cells,” and a “state set” $\Sigma $. A state of the cell with index $i$ is denoted $si\u2208\Sigma $. A “configuration” is then a sequence of cell states

Given a topology for the lattice and the number of neighbors $b$, a “neighborhood” function $\eta :N\xd7\Sigma N\u2192\Sigma b$ maps any pair $(i,s)$ to the $b$-tuple $\eta i(s)$ of cells’ states that are accessible (visible) to cell $i$ in configuration $s$. Note that each cell is usually its own neighbor.

The transition rule $\varphi :\Sigma b\u2192\Sigma $ is applied in parallel to each cell’s neighborhood, resulting in the synchronous update of all of the cells’ states $sit+1=\varphi (\eta i(s)t)$. The transition rule is represented either by a transition table, also called a look-up table, or a finite state transducer.^{29} Here we focus exclusively on “uniform” CAs, where all cells share the same transition function. The “global transition rule” $\Phi :\Sigma N\u2192\Sigma N$ is defined as the transition rule with the scope over all configurations: $st+1=\Phi (st)$.

In this paper, we analyze two-dimensional CAs, where cells are topologically organized on a two-dimensional grid with cyclic boundaries, i.e., we treat them as tori. The true power of our analysis is that it applies to two-dimensional CAs with arbitrary neighborhood and transition functions. We rely only on their uniformity: each cell has the same neighborhood and transition function; and synchronous update, the attributes typically assumed for a standard CA.

Figure 1 shows the update mechanism for a two-dimensional binary CA with a Moore neighborhood, a square neighborhood with radius $r=1$ containing $9$ cells. The dynamics of two-dimensional CAs are illustrated as a series of configuration snapshots, where an active cell is black and an inactive cell white (Fig. 2).

## II. SHIFT-SYMMETRIC CONFIGURATIONS

As stated by Angluin,^{2} the problem of reaching a “center” (i.e., leader) in homogeneous configurations is insolvable by any anonymous deterministic algorithm (including CAs). The CA uniformity can be embedded in its transition function, the deterministic update, synchronicity, topology, configuration, and cells’ anonymity. Intuitively, a fully uniform system in terms of its structure, configuration, and computational mechanisms cannot produce any reasonable or complex dynamics.

We show that Angluin’s homogeneous configurations of $0N$ and $1N$ belong to a much larger class of so-called shift-symmetric configurations. In this section, we formalize the concept of configuration shift-symmetry by employing vector translations and group theory. Figure 3 depicts a CA computation on a two-dimensional shift-symmetric configuration. Compared to the one-dimensional case,^{8} two dimensions are more symmetry-potent.

It is important to mention that we deal with “square” configurations only. Nevertheless, we suggest most of the lemmas and theorems could be extended to incorporate arbitrary rectangular shapes. Also, the formulas and methodology to enumerate two-dimensional shift-symmetric configurations could be generalized to arbitrarily many dimensions. For consistency, however, we leave the rectangular as well as $n$-dimensional extensions for future consideration. Note that in order to improve the readability of the main text, all proofs and formally defined lemmas and theorems appear in Appendix A. The equations that have nontrivial proofs in the Appendix are labeled with the “$\u2032$” symbol. See, e.g., Eq. (4′) $\u2194$ Lemma E.4.

First, we define a shift-symmetric (square) configuration by a given vector as shown in Fig. 4. Formally, for a nonzero vector (pattern shift) $v\u2208Zn\xd7Zn$ we denote by

the set of all “shift-symmetric square configurations” of size $N=n2$ relative to $v$ over the alphabet $\Sigma $, where $\u2295$ denotes coordinatewise addition on $Zn\xd7Zn$.

Note that as opposed to our previous work,^{7} we renamed “symmetric” to “shift-symmetric” configurations to avoid confusion with reflective or rotational symmetries. These two symmetry types, unlike shift-symmetry, are not generally preserved by a transition function unless we impose certain “symmetric” properties on the transitions.

Since any translation by a nonzero vector $v$ defines a configuration symmetry, we can study shift-symmetric configurations with the techniques of group theory. From now on, we will call such a nonzero vector $v\u2208Zn\xd7Zn$ that we use for state translation a “generator” formalized as

where $\u27e8v\u27e9$ is the cyclic subgroup of $Zn\xd7Zn$ generated by $v$.

Trivially, for any nonzero $v\u2208Zn\xd7Zn$

In the following text, we bridge shift-symmetry, which is associated with configurations, i.e., static “states,” with any uniform transition rule, which defines the “dynamics” of CA. We show that shift-symmetry cannot be broken, thus it fundamentally restricts the reachable states and the potentiality of a transition rule. More formally, for a vector $v$ and any uniform global transition rule $\Phi $

and so, by induction, a nonsymmetric configuration $q\u2209Sn\xd7n(v)$ is unreachable from a shift-symmetric $s\u2208Sn\xd7n(v)$

As a consequence, several tasks for CA are principally insolvable. For instance, a target configuration for leader election^{56} contains exactly one cell in the leader state $a\u2208\Sigma $. This configuration is asymmetric for $n>1$ as shown in Fig. 5 (asym-d), and, therefore, unreachable from any shift-symmetric configuration. Further, several image-processing tasks illustrated in Fig. 5 are insolvable: e.g., image translation (sym-c to asym-c)^{30} and pattern recognition or noise filtering (sym-c to asym-f and sym-a to sym-b).^{49} Also, the task of random^{57} or prime $p$ number generation is insolvable if $p\u29f8|n$ (for $p$ = 7: sym-a to asym-e). If a configuration is shift-symmetric, the associative memory^{16} has a corrupted (nonuniform) hashing function to handle collisions (e.g., sym-a to asym-a). This in general sense also applies to encryption.^{60}

## III. ENUMERATING SHIFT-SYMMETRIC CONFIGURATIONS

In this section, we will further investigate shift-symmetric two-dimensional configurations and ask how many there are in a square lattice of size $N=n2$. First, to generalize shift-symmetry and lay a solid ground for group-centric analysis, we define the symmetric configurations over several generators.

Let $L\u2286Zn\xd7Zn$. We define the set of **$L$**-symmetric configurations to be the set

where $\u27e8L\u27e9={c1v1\u2295\u2026\u2295c|L|v|L||ci\u2208Zn}$. In other words, $Sn\xd7n(L)$ denotes the set of all shift-symmetric configurations of size $N=n2$ over the alphabet $\Sigma $ with a generator set $L$.

Directly from the definition, for any subset $L\u2286Zn\xd7Zn$,

and for any $u,v\u2208Zn\xd7Zn$

The following equivalence, which may sound counterintuitive at first, adapts shift-symmetry for the theory of groups. It states that if a vector $v$ generates a cyclic “subgroup” of another vector $u$, then its set of shift-symmetric configurations is a “superset” (not a subset!) of that generated by the vector $u$ and vice versa, i.e., for any $u,v\u2208Zn\xd7Zn$

Now, in a straightforward manner, we define the set of all shift-symmetric configurations $Sn\xd7n$ over all possible combinations of vectors (shifts) for a given lattice as

Due to nontrivial intersections of the sets $Sn\xd7n(v)$, it is fairly unpractical to count the shift-symmetric configurations over all $n2\u22121$ vectors. We, instead, construct significantly fewer generators using prime factors of $n$, which equivalently produce an entire set of shift-symmetric configurations.

We start with the definition of the generators. For any natural number $n$, let $n=\u220fj=1\omega (n)pj\alpha j$ be the prime factorization, where $\omega (n)$ denotes the number of distinct prime factors. We define the generator set $Gn$ as

where for each prime divisor $pj$

The total number of these generators is then

Using some divisibility arguments, we can prove that they indeed produce all shift-symmetric configurations

Further, we show that these prime-based generators are mutually independent, thus greatly simplifying the counting problem to relatively compact closed formulas. For any distinct $u,v\u2208Gn$ ($n\u2208N$),

and for any distinct $u,v\u2208Gn(p)$, where $p$ is a prime divisor of $n$ and $n^=n/p$

In particular, $|\u27e8u,v\u27e9|=p2.$

Finally, we are ready to enumerate shift-symmetric configurations. In the following formulas, given any $v$, $w\u2208Zk$, we write $v\u22b4w$ whenever the coordinates satisfy $vi\u2264wi$ for every $i$ $(1\u2264i\u2264k)$. We write $v\u22b2w$ if $v\u22b4w$ and $v\u2260w$. We denote the sum of the coordinates by $|v|=\u2211i=1kvi$, and for any $m\u2208Z$, we write $m$ for the $k$-tuple whose coordinates all equal $m$. Let $n=\u220fi=1kpi\alpha i$ be the prime factorization of $n$, where $k=\omega (n)$, the number of distinct prime factors of $n$. Note that a one-by-one lattice offers no symmetries since there exists no nonzero shift in $Z1\xd7Z1$.

As the base, we first combine the generators $Gn$ directly by the inclusion-exclusion principle and apply the fact that these generators are mutually independent [Eq. (15′)], as well as that their joint size is at most $|\u27e8u,v\u27e9|=p2$ [Eq. (16′)]. That gives us

where $p=(p1,\u2026,pk)$ and $f(v)=n2\u220fi=1kpi\u2212min(vi,2).$

An alternative and more efficient counting is based on an idea of grouping of the exponential elements $\Sigma f(v)$ from the original formula [Eq. (17′)], which are costly to calculate. It goes as follows:

where $g(v)=n2\u220fi=1kpi\u2212vi$ and $top(v)\u2208Zk$ has the $i$th coordinate

The final formula that follows is the most efficient because, besides having the exponential elements grouped, it also reduces the inner binomial sum to a simple expression $r(i)$,

where $g(v)=n2\u220fi=1kpi\u2212vi$ and

Interestingly, for a prime lattice $n=p$ the vector $v$ is $(1)$ and $g(v)=n$, or $v=(2)$ and $g(v)=1$, which forces formula (19′) to collapse to

The gradual improvements from Eqs. (17′) and (18′), and finally to Eq. (19′) are illustrated for $n=2\alpha 13\alpha 2$ in Appendix B.

### A. Bounding the number of shift-symmetric configurations

In Sec. III, we derived closed and increasingly efficient formulas for counting the number of shift-symmetric configurations in a square lattice $N=n2$. To get a deeper and more qualitative insight, we now bound this number from the top and the bottom by exponential functions. We prove that the lower bound is tight on prime lattices (example in Fig. 7), whereas local maxima are reached on even ones (Fig. 6).

More precisely, for any $n\u2208N$, $|Sn\xd7n|$ can be bounded as

where equality holds if and only if $n$ is a prime.

For an upper bound, let $n=\u220fi=1kpi\alpha i$ be the prime factorization of $n$, where $k=\omega (n)$, the number of distinct prime factors of $n$. Then

Note that our bound is significantly lower than the bound $|\Sigma |n2\u2212(n2\u22121)|\Sigma |n2/2$ found by Castillo-Ramirez and Gadouleau.^{12} Also recall that they addressed a more general problem of counting aperiodic configurations on an arbitrary group.

By combining the inequalities (21′) and (22′), the number of shift-symmetric configurations satisfies

### B. Probability of selecting shift-symmetric configuration over uniform distribution

To calculate the probability that a randomly drawn configuration is shift-symmetric, we first handle a uniform distribution, in which each symbol from $\Sigma $ for $si$ in configuration $s$ is equally likely. For nonsymmetric tasks, this probability directly equals a least expected insolvability (or error lower bound).

Overall, there exist $|\Sigma |n2$ configurations and each configuration is equally likely, hence the probability of selecting a shift-symmetric configuration in a square lattice of size $N=n2$ over uniform distribution is $Pn\xd7n{unif}=|Sn\xd7n||\Sigma |n2$. Further, by applying the inequality (23) and knowing that $n|\Sigma |n\u2264|\Sigma |n(n+1)\u2212|\Sigma |n$, we can bound the probability as

As exemplified in Fig. 8 and mathematically rooted in inequality (24), the probability $Pn\xd7n{unif}$ decreases rapidly: square-exponentially by $n$ or exponentially by the lattice size $N=n2$. Since $|Sn\xd7n|$ depends on the prime factorization of $n$ the probability is nonmonotonous. Similar to $|Sn\xd7n|$ the probability $Pn\xd7n{unif}$ reaches local minima for prime and local maxima for even lattices ($n>4$).

## IV. ENUMERATING SHIFT-SYMMETRIC CONFIGURATIONS FOR $k$ ACTIVE CELLS

Having enumerated “all” shift-symmetric configurations we now tackle a subproblem of enumerating configurations with a specific number of cells in a given state, such as the state “active.” The motivation behind this endeavor is to calculate the probability of selecting a shift-symmetric configuration generated by a density-uniform distribution.

We first define a set of shift-symmetric configurations with $k$ cells in a special state $a$. Formally, for any state $a\u2208\Sigma $ and $n,k\u2208N$, we define $Dn\xd7n,ka$ to be the set of all square configurations with exactly $k$ sites in state $a$

where $#as$ denotes the number of cells in a configuration $s$ that are in a state $a$. Accordingly, let $Sn\xd7n,ka$ be the set of such configurations that are symmetric:

and for any $v\u2208Zn\xd7Zn$, let $Sn\xd7n,ka(v)$ denote the set of configurations in $Sn\xd7n,ka$ that are generated by $v$ so that

As a direct corollary, for any $a\u2208\Sigma $, any $n,k\u2208N$, and $v=(l1,l2)\u2208Zn\xd7Zn$,

To launch our enumeration endeavor, we focus first on shift-symmetric configurations of a single generating vector. For any $a\u2208\Sigma $, any $k\u2208N$, and $v\u2208Zn\xd7Zn$ such that $|\u27e8v\u27e9|$ divides $k$

To derive the counting formulas for the specifics of $k$-active-cell configurations, we mimic the advancements of the three counting techniques based on mutually-independent generators for $|Sn\xd7n|$ from Sec. III, but this time, we root them into Eq. (29′).

As before we start with a base formula. Pick $n,k\u2208N$ with $k\u2264n$ and let $d={gcd}(k,n)$. Let $n=\u220fi=1\omega (n)pi\alpha i$, $k=\u220fi=1\omega (k)qi\beta i$, and $d=\u220fi=1\omega (d)ri\gamma i$ be the prime factorizations of $n$, $k$, $d$, respectively. Then, for any $a\u2208\Sigma $,

where $r=(r1,\u2026,r\omega (d))$ and $h(u)=\u220fi=1\omega (d)rimin(ui,2).$

Similar to Eq. (18′) from Sec. III, the following alternative counting method is more efficient than the core Eq. (30′) due to the grouping of the exponential elements.

where $h(v)=\u220fi=1\omega (d)rimin(vi,2)$ and $top(v)\u2208Z\omega (d)$ has the $i$th coordinate

At last, as a parallel to Eq. (19′), we derive the final formula, which further simplifies the counting mechanics by collapsing the inner binomial sum to a simple expression $r(i)$.

where $h(v)=\u220fi=1\omega (d)rimin(vi,2)$ and

As a special case, it can be shown that the number of “binary” symmetric configurations ($|\Sigma |=2$) with $k$ sites in state $a$ is

For illustration purposes, an example of the three increasingly more compact counting formulas is given for $n=2\alpha 13\alpha 2$ and $k=2\beta 13\beta 2,\beta 1\u2264\alpha 1,\beta 2\u2264\alpha 2$ in Appendix B.

### A. Probability of selecting shift-symmetric configuration over density-uniform distribution

Besides a uniform distribution, a CA’s performance is commonly evaluated using a so-called density-uniform distribution, in which the probability of selecting $k$ active cells ($#as=k$), a “density,” is uniformly distributed. Since for a density $k$ there exist $n2k(|\Sigma |\u22121)n2\u2212k$ configurations and each density is equally likely, the probability of selecting a shift-symmetric configuration in a lattice $N=n2$ over a density-uniform distribution is then

As presented in Fig. 9, the probability for density-uniform distribution decreases a magnitude slower than for the uniform one and reaches $0.001$ even for $N=452$. That is due to the fact that density-uniform distribution selects configurations with a few or many active cells, which are combinatorially more symmetric, more often.

## V. SHIFT-SYMMETRIC CONFIGURATION DETECTION

For practical reasons, e.g., to test whether a current system’s configuration is shift-symmetric, and if yes take an action (restart), we provide an algorithm to effectively detect an occurrence of shift-symmetry.

First, to find out whether a configuration is shift-symmetric by a shift $v$ we start at a corner cell $w=(0,0)$ and check if all the cells at the orbit $w\u2295iv$ are in the same state. If yes, we repeat this process for the next orbit and so on, moving in an arbitrary but fixed order (e.g., left-right up-down), until we check all the cells. If a cell has been visited before we skip it and move on until we find an unvisited cell, which marks a start of the next orbit. Also, if the test fails at any point, a configuration is nonshift-symmetric (by $v$), and the process can be terminated. Otherwise, the property holds for all the cells and a configuration is shift-symmetric.

To determine whether a configuration is shift-symmetric globally, a naive way would be to try all possible nonzero vectors $v$ and check if any of them passes the aforementioned procedure. Luckily, as we discovered in Sec. II each configuration shift-symmetry “overlaps” with mutually-independent generators from $Gn$. Recall that these generators are defined by prime factors and their total number $|Gn|=\omega (n)+\u2211i=1\omega (n)pi$ is significantly smaller than $n2$.

In the worst case, the shift-symmetry test needs to visit all $n2$ cells and there are $|Gn|$ vectors to try. Since $O[|Gn|)=O(sopf(n)]$ and $sopf(n)=\u2211i=1\omega (n)pi$, also known as the integer logarithm, is at most $n$, the worst-case time complexity is

Similarly, with a slightly more complicated proof, we can show that the average-case time complexity of the shift-symmetry test for a configuration generated from a uniform distribution is

Note that the worst-case and average-case time complexity of $O(n3)$ and $O(n2)$, respectively, translate to $O(NN)$ and linear $O(N)$ when interpreted by the optics of the number of cells $N=n2$. The function $sopf(n)$, which plays a crucial role in both O formulas, is of a logarithmic nature in “most of the cases,” but $n$ for primes. Since the number of primes is infinite, we could not use any tighter asymptote than $n$. However, for randomly chosen $n$ the expected time complexities drop to just $O[{log}(n)n2]$ and $O[{log}2(n)]$, respectively.

It is worth mentioning that the presented algorithm detects “if” a configuration is shift-symmetric but does not count the number of shift-symmetries in a configuration. The validity of the detection holds because we know that “any” shift-symmetric configuration must obey at least one of the prime generators from $Gn$. Nevertheless, to determine the number of shift-symmetries, i.e., the number of vectors with distinct vector spaces in $Zn\xd7Zn$ for which the cells at a same orbit share the same state, we would need to consider also subvectors, whose satisfiability cannot be generally inferred from the prime generators. Construction of a “counting” algorithm is addressable but goes beyond the scope of this paper.

## VI. DISCUSSION AND CONCLUSION

Shift-symmetry, as we illustrated in the paper, decreases the system’s computational capabilities and expressivity, and is generally good to be avoided. For each shift-symmetry, a system falls into, a configuration folds by the order of symmetry and “independent” computation shrinks to a smaller, prime fraction of the system. The rest is mirrored and lacks any intrinsic computational value or novelty. The number of reachable configurations shrinks proportionally as well.

One of the key aspects of shift-symmetry is that it is maintained (irreversible) for any number of states, and any uniform transition and neighborhood functions. It means that the occurrence of shift-symmetry is rooted in the CA model itself, specifically, in the cells’ uniformity, synchronous update, and toroidal topology. Shift-symmetry is preserved as along as a transition function is uniform (shared among the cells), even if nondeterministic. In other words, during each step, a transition function can be discarded and regenerated at random. However, within the same synchronous update it must be consistent, i.e., two cells whose neighborhood’s subconfigurations are the same must be transitioned to the same state.

We showed that a nonshift-symmetric solution is unreachable from a shift-symmetric configuration. Even more, a shift-symmetric configuration cannot be reached from another shift-symmetric one, if the vector space defining the symmetries of the starting configuration is not a subset of the target configuration's vector space. This renders the tasks, such as leader election,^{6,56} several image processing routines including pattern recognition,^{49} and encryption,^{60} insolvable by uniform CAs in a general sense. These procedures are fundamental for many distributed protocols and algorithms. Additionally, leader election contributes to decision making of biological societies^{18,38} and is a key driver of cell differentiation^{37,44} responsible for their structural heterogeneity and specialization.

To determine how likely a configuration randomly generated from a uniform distribution is shift-symmetric, hence insolvable, we efficiently enumerated and bounded the number of shift-symmetric configurations using mutually-independent generators. We also introduced a lower, tight prime-size bound, and an upper bound, and showed that even-size lattices are locally most likely shift-symmetric. By specializing on Cartesian powers of cyclic groups (two-dimensional case), we obtained more effective counting and probability formulas and sharper bounds compared to the state-of-the-art work addressing the problem for general groups.^{12,25} We also extended our machinery to a fixed number of active symbols and derived a probability formula for density-uniform distribution.

Overall, shift-symmetry is not as rare as one would think, especially for small or nonprime lattices, or when a configuration is generated using density-uniform distribution. Asymptotically, the probability for uniform distribution drops exponentially with the lattice size but a magnitude slower for a density-uniform distribution. For instance, the probability for a $1002$ square lattice is around $10\u22121505$ using uniform and $2\xd710\u22124$ using density-uniform distribution. Importantly, shift-symmetry does not necessarily have to be harmful for all the tasks. For instance, the density classification,^{15,20,43,48} which is widely used as a CA benchmark problem, requires a final configuration to be either $1N$ if the majority of cells are initially in the state $1$, and $0N$ otherwise. Since the expected homogeneous configurations are fully shift-symmetric, they can be reached potentially from any configuration. Naturally, that depends on the structure of a transition function but shift-symmetry does not impose any strong restrictions here. The ability of reaching a “valid” answer does not necessarily mean reaching a “correct” answer. However, for the density classification, shift-symmetry tolerates the latter as well. It is because a shift-symmetric configuration consists purely of repeated subconfigurations, and so the density (ratio of ones) in a subconfiguration is the same as in the whole.

To detect whether a configuration is shift-symmetric we constructed an algorithm, which, by using the base prime generators, can effectively determine the presence of shift-symmetry in linear $O(N)$ time for prime and just $O([12log\u2061(N)]2)$ for randomly chosen $N$ on average.

By moving from one to two dimensions, we generalized our machinery to vector translations, which can be extended to the $n$-dimensional case.^{11} It is expected that the number of shift-symmetric configurations will grow with the dimensionality of lattice. It will be interesting to investigate this relation from the perspective of prime-exponent divisors.

An important implication of shift-symmetry is that cyclic behavior must occur only within the same symmetry class defined by a set of prime shifts (vectors) as illustrated in Fig. 7. Note that we count no-symmetry as a class as well. This leads to the realization that once a CA gains a symmetry, i.e., a configuration crosses symmetry classes, it cannot be injective and reversible, and there must exist a configuration without a predecessor, a so-called “Garden of Eden” configuration.^{1,34} It means that the only way for the CA to stay injective is to decompose all the configurations into cycles, each fully residing in a certain shift-symmetry class. Again, one large class would contain all the nonshift-symmetric configurations. Open question is for which lattices, i.e., for how many shift-symmetric configurations, CAs are noninjective, thus irreversible, on average. As opposed to our shift-symmetric endeavor, which applies to any transition function, investigating injectivity would require to assume something about the transition function, e.g., that is generated randomly. Trivially, for any lattice, there always exists an injective transition function. An example is an identity function.

As we proved, the number of symmetries in any synchronous toroidal CA is nondecreasing. A natural question is: could it be increasing in the “average” case for a random transition function? We know that the expected behavior of randomly generated CA is most likely chaotic and the attractor length is exponential to the lattice size $N$, as opposed to ordered or complex CAs with linear or quadratic attractors.^{66} Would the length of attractor be sufficient to discover a shift-symmetry if we keep a random CA running long enough, potentially $|\Sigma |N$ time steps? As seen in Fig. 8, the ratio of shift-symmetric configurations assuming a uniform distribution is exponentially decreasing with the lattice size, and prime lattices could produce “only” around $n|\Sigma |n$ symmetric configurations. For a randomly chosen lattice size, dimensions, and cell connectivity, we expect the number of reachable symmetries to be significantly smaller than the total number of symmetries available. However, for symmetry-rich lattices, we speculate that toroidal synchronous uniform systems, such as CAs, could undergo “spontaneous symmetrization” contracting an initial configuration to a fully homogeneous state (analogical to Big Crunch). If proven, it would directly imply the system’s noninjectivity and irreversibility, and would bind symmetrization with “nonergodicity.” This hypothesis will be addressed in our future work.

We suggest that several phenomena observed in CA dynamics, such as irreversibility, emergence of structured “patterns,” and self-organization could be explained or contributed to shift-symmetry. As demonstrated by Wolfram^{62} on 256 elementary one-dimensional CAs, when run long enough, most of these CAs condensate to ordered structures: homogeneous configurations and self-similar patterns, which are in fact shift-symmetric.

A straightforward way to fight symmetry would be to introduce noise, i.e., to break the uniformity of cells and/or to use an asynchronous update. Based on the amount of noise, this could, however, disrupt the consistency of local, particle-based, interactions, which give rise to a global computation. Clearly, asynchronicity makes a system more robust but sacrifices the information processing by “algebraic” structures, which could exist only due to synchronous update.

Practical utility of the presented enumeration formulas and probability calculations for a given distributed application is that, we can minimize a likelihood of shift-symmetry-caused insolvability as well as the number of resources needed. An online supplementary web page, which implements these formulas as well as an embedded simulator to run a CA on a shift-symmetric configuration, can be found at https://coel-sim.org/symmetry.

## ACKNOWLEDGMENTS

This material is based upon work supported by the National Science Foundation (NSF) under Grant Nos. 1028120, 1028378, and 1518833 and by the Defense Advanced Research Projects Agency (DARPA) under Award No. HR0011-13-2-0015. The views expressed are those of the author(s) and do not reflect the official policy or position of the Department of Defense or the U.S. Government. Approved for Public Release, Distribution Unlimited.

### APPENDIX A: PROOFS

Note: lemmas, theorems, and corollaries are numbered such that those starting with **E** correspond to the equations in the main text which they are referenced from [e.g., Lemma E.4 $\u2194$ Eq. (4′)]. The remaining nonequation-referenced (auxiliary) lemmas have the **A** prefix.

For any nonzero $v=(l1,l2)\u2208Zn\xd7Zn$, the following hold

$(i)$. $|Sn\xd7n(v)|=|\Sigma |n2|\u27e8v\u27e9|.$

$(ii)$. $|\u27e8v\u27e9|=ngcd(l1,l2,n)$,

$(iii)$. $|Sn\xd7n(v)|=|\Sigma |ngcd(l1,l2,n).$

(i). When $v=(l1,l2)$ is repeatedly applied to any cell in the lattice, an orbit is generated, consisting of $|\u27e8v\u27e9|$ cells that must share a common state for any configuration in $Sn\xd7n(v)$. The number of distinct orbits of cells in the lattice is simply $n2|\u27e8v\u27e9|$. Any configuration in $Sn\xd7n(v)$ is thus uniquely determined by choosing a state from $\Sigma $ for each orbit of cells, so (i) follows.

If $s\u2208Sn\xd7n(v)$ then $\Phi (s)\u2208Sn\xd7n(v)$ for any uniform global transition rule $\Phi $.

($\u21d0$). By way of contradiction, suppose that $Sn\xd7n(u)\u2288Sn\xd7n(v)$ and $\u27e8v\u27e9\u2264\u27e8u\u27e9$. Let $s\u2208Sn\xd7n(u)$ such that $s\u2209Sn\xd7n(v)$. Then $s$ is symmetric under $u$ but not under $v$. Consequently, there exists $w\u2208Zn\xd7Zn$ such that $sw\u2260sw\u2295v$. But $s\u2208Sn\xd7n(u)$ and $v\u2208\u27e8u\u27e9$ by assumption, so Lemma A.1 implies that $sw=sw\u2295v$, which is a contradiction.

For any prime $p$ that divides $n$ and any $i(0\u2264i<n)$, the cyclic group $\u27e8(np,inp)\u27e9$ is simple, i.e., it has no nontrivial proper subgroups.

By Lemma E.4(ii), we see that $\u27e8(np,inp)\u27e9$ has order $p$, and by Lagrange’s theorem, any group with prime order is simple.

By swapping the coordinates, the proof applies also to each subgroup of the form $\u27e8(inp,np)\u27e9$.

($\u2286$). Let $s\u2208Sn\xd7n$, so that $s\u2208Sn\xd7n(v)$ for some nonzero $v=(a,b)\u2208Zn\xd7Zn$. It suffices to show that $\u27e8w\u27e9\u2264\u27e8v\u27e9$ for some $w\u2208Gn$, since this fact, by Lemma E.10, implies $Sn\xd7n(v)\u2286Sn\xd7n(w)$ and, therefore, $s\u2208Sn\xd7n(w)$.

Without loss of generality, we may assume $gcd(a,b,n)=1$. Otherwise, we simply divide everything by $d=gcd(a,b,n)$ to obtain $v^=(a^,b^)$, and $n^$, respectively. Once we show that $\u27e8w^\u27e9\u2264\u27e8v^\u27e9$ for some $w^\u2208Gn^$, we multiply throughout by $d$ to obtain the desired result.

**Case 1.**Suppose $gcd(a,n)=1$. Then $ai\u2261nb$ and $aj\u2261n1$ for some $i$, $j\u2208Z$. Also, $nv\u2261n(0,0)$, so $|\u27e8v\u27e9|$ divides $n$. Let $p$ be any prime divisor of $|\u27e8v\u27e9|$ and write $n=pm$ for some $m\u2208Z$. Let $w=(m,im)$ and note that $w\u2208Gn(p)$. Also observe $v=a(1,i)$ and $w=m(1,i)$, so that

**Case 2.**Suppose $gcd(a,n)\u22601$. Let $p$ be any prime divisor of both $a$ and $n$, so that $a=pa\u2032$ and $n=pn\u2032$ for some $a\u2032,n\u2032\u2208Z$. Let $w=(0,n\u2032)$ and note that $w\u2208Gn(p)$. Observe that $an\u2032=a\u2032pn\u2032=a\u2032n\u2261n0$, so

($\u2287$). Immediate by Definition [Eq. (11)].

First, suppose that $u\u2208Gn(p)$ and $v\u2208Gn(q)$, where $p\u2260q$. By Lemma E.4(i), $|\u27e8u\u27e9|=p$ and $|\u27e8v\u27e9|=q$. Since $|\u27e8u\u27e9\u2229\u27e8v\u27e9|$ must divide both of these primes, the line (⋆) must hold as claimed.

Next, suppose $u,v\u2208Gn(p)$ and write $n=n^p$ for some $n^\u2208Z$. Suppose $u=(n^,in^)$ and $v=(n^,jn^)$ for some $0\u2264i<j<p$. If $x\u2208\u27e8u\u27e9\u2229\u27e8v\u27e9$ then $\u2203k,l$ $(0\u2264k,l<p)$ such that $x=ku=lv$. But then $(kn^,kin^)=(ln^,ljn^),$ so $kn^\u2261nln^$ and thus $k\u2261pl$. But also, $kin^\u2261nljn^$, so that $ki\u2261plj$. Since $i\u2262pj$, this forces $k\u2261p0$, so that $x=0$ and (⋆) must hold as claimed.

Finally, suppose $u,v\u2208Gn(p)$ and suppose $u=(0,n^)$ and $v=(n^,in^)$ for some $0\u2264i<p$. If $x\u2208\u27e8u\u27e9\u2229\u27e8v\u27e9$ then $\u2203k,l$ $(0\u2264k,l<p)$ such that $x=ku=lv$. But then $(0,kn^)=(ln^,lin^),$ so $0\u2261nln^$ and thus $0\u2261pl$. But also, $kn^\u2261nlin^$, so that $k\u2261pli$ and, therefore, $k\u2261p0$. Now $x=0$ and (⋆) must hold as claimed.

($\u2286$). First suppose $u=(n^,in^)$ and $v=(n^,jn^)$ for some $0\u2264i<j<p$. Then $u=(n^,0)+i(0,n^)$ and $v=(n^,0)+j(0,n^)$. So $\u27e8u,v\u27e9\u2286\u27e8(n^,0),(0,n^)\u27e9$ as desired. A similar argument holds when $u=(n^,in^)$ and $v=(0,n^)$.

($\u2287$). Again suppose $u=(n^,in^)$ and $v=(n^,jn^)$ for some $0\u2264i<j<p$. Then $u\u2212v\u2208\u27e8(0,n^)\u27e9$. But $u\u2212v\u22600$ and $|\u27e8(0,n^)\u27e9|=p$, so $u\u2212v$ generates $\u27e8(0,n^)\u27e9$. Thus $(0,n^)\u2208\u27e8u\u2212v\u27e9\u2286\u27e8u,v\u27e9$. Likewise, $(n^,0)\u2208\u27e8ju\u2212iv\u27e9\u2286\u27e8u,v\u27e9$, so the desired containment holds. A similar argument can be made when $u=(n^,in^)$ and $v=(0,n^)$, showing that $(n^,0)\u2208\u27e8u\u2212iv\u27e9$, which implies the desired result.

Now, because the content of $Ji$ is irrelevant and we care only about the cardinality $|Ji|$, for each size $vi=|Ji|$ we have $|Gn(pi)|vi=pi+1vi$ ways of choosing $vi$ elements from $Gn(pi)$, which produces the final formula as required.

We prove it by induction on $k$. As the induction basis, we choose $k=1$, and so $n=p$, where $p$ is a prime. Since $b(v)=r(0)$ we need to confirm it equals $\u22121,p+1,$ or $\u2212p$ for three different cases of $v$ defined by the function $r$.

For $v=(1)$, $g(v)=n$ and $b(v)=(n+1)$, and for $v=(2)$, $g(v)=1$ and $b(v)=\u2212n$.

To finalize the proof we use $|Sn\xd7n|=qn\xd7nk$.

Let $s\u2208Sn\xd7n,ka(v)$. Then, the number of selections of state in $s$, i.e., the pattern size, is $n2/|\u27e8v\u27e9|$. To enumerate the number of such configurations, we first have to choose $k/|\u27e8v\u27e9|$ out of $n2/|\u27e8v\u27e9|$ sites to be in state $a$, and then fill the remaining $n2/|\u27e8v\u27e9|\u2212k/|\u27e8v\u27e9|$ sites with states from $\Sigma \u2216{a}$.

Similar to the proof of Lemma E.18.

Similar to the proof of Theorem E.19.

For any state set $\Sigma $ and state $a\u2208\Sigma $, the set $Sn\xd7n,0a$ equals the set $Sn\xd7n$ for the state set $\Sigma \u2216{a}$.

It is easy to show that these probabilities sum to $1$, i.e., we must terminate at one of $m$ orbits. Further, the probability of successfully passing the test for all the orbits—the probability that a configuration generated from a uniform distribution is shift-symmetric by a vector with an order $p$—equals $|\Sigma |n2(p\u22121\u22121)$.

### APPENDIX B: EXAMPLES

## REFERENCES

*STOC ’80 Proceedings of the 12th Annual ACM Symposium on Theory of Computing*(ACM, New York, NY, 1980), pp. 82–93.

*Proceedings of the 24th Annual ACM Symposium on Theory of Computing*(ACM, 1992), pp. 438–449.

*Advances in Artificial Life. Darwin Meets von Neumann*, Lecture Notes in Computer Science Vol. 5778, edited by G. Kampis, I. Karsai, and E. Szathmáry (Springer, Berlin, 2011), pp. 310–317.

*Winning Ways for Your Mathematical Plays, Vol. 2: Games in Particular*(Academic Press, London, 1982), Chap. 25.

*Evolutionary Dynamics: Exploring the Interplay of Selection, Accident, Neutrality, and Function*(Oxford, 2003), pp. 361–411.

*International Conference on Unconventional Computation and Natural Computation*(Springer, 2014), pp. 177–189.

*Cellular Automata in Image Processing and Geometry*(Springer, 2014), pp. 25–45.

*International Conference on Unconventional Computation and Natural Computation*(Springer, 2016), pp. 168–181.

*2011 IEEE Symposium on Artificial Life (ALIFE)*(IEEE, 2011), pp. 233–240.

*HandBook of Evolutionary Computation*, edited by T. Baeck, D. Fogel, and Z. Michalewicz (Oxford University Press, 1997).

*Engineering Self-Organising Systems*, Lecture Notes in Computer Science Vol. 2977 (Springer, 2003), pp. 53–62.

*Proceedings of the 2002 ACM/SIGDA 10th International Symposium on Field-Programmable Gate Arrays*(ACM, 2002), pp. 106–112.

*Applications of Fuzzy Sets Theory: 7th International Workshop on Fuzzy Logic and Applications, WILF 2007, Camogli, Italy, July 7–10, 2007*(Springer, Berlin, 2007), pp. 404–411.

*2016 International Joint Conference on Neural Networks (IJCNN)*(IEEE, 2016), pp. 2015–2022.