Submitted:
13 July 2025
Posted:
15 July 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. 0-Dimensional CA
3. Rules that Generate Maximum Period Sequences: de Bruijn Rules
4. Characterization of de Bruijn Rules
- Boundary Conditions: The binary representations of de Bruijn rules must start with 0 and end with 1. This condition arises from the convention in rule ordering, which arranges input strings from the highest binary value () to the lowest (), and from the necessity to avoid fixed points (e.g., if , the sequence remains constant). This constraint immediately reduces the number of candidate rules by a factor of 4. For example, for , the number of potentially valid rules is reduced from to 16384.
-
Symmetry and Parity: The binary representations of de Bruijn rules are symmetric with respect to their midpoint, such that each half is the complement of the other. This symmetry ensures parity: the number of 0s equals the number of 1s, although the balance may be broken within each half. Under this constraint, valid de Bruijn rules correspond to multiples of certain numbers derived from sequences of Evil Odd numbers [1], multiplied by factors denoted as .For instance, if we denote the Evil Odd Numbers, i.e., an odd number whose binary representation contains an even number of 1, for each as , being , we get:The factors follow the recursive relation:For instance, , , , and . Table 2 presents all de Bruijn rules for whose decimal representations are products of an Evil Odd number and the corresponding . Note, however, that not all Evil Odd numbers yield valid de Bruijn rules, and the problem of determining which ones do remains open for larger values of . For , applying these conditions reduce the feasible set of de Bruijn rules to 32.
-
Constrained Position Pairs: There exist pairs of positions in the binary representation of de Bruijn rules that cannot simultaneously take the same value (1 for even -values and 0 for odd ones). This condition is applied only to the first half of the binary string for symmetry (according to the previous item) and depends on according to a recursive pattern. Specifically: For , the constrained positions are and , and
- -
- If , then and .
- -
- If , then and ,
for . This structural condition eliminates of the remaining candidates. For example, for these positions are and . For , and .Remarkably, for , the final count of feasible de Bruijn rules after applying all constraints is 24. In general, for all values of , the feasible set exceeds the actual number of de Bruijn rules (see Table 3). -
Symmetric Rule Invariance: If a rule of the form:is a de Bruijn rule, then its mirrored version:is also a de Bruijn rule.This property reflects the inherent symmetry and reversibility in de Bruijn rule structure. It ensures that for each valid de Bruijn rule constructed in this way, a corresponding reverse-complement rule also exists within the de Bruijn set.
5. Neural Networks to Classify de Bruijn Rules
- Data loading and preprocessing: The input data consisted of a character string representing a binary sequence and a binary integer label.
- Feature extraction: Each rule was split into individual bits transforming the strings into a matrix where each column corresponds to a bit ( to bit). According to the necessary properties of de Bruijn rules (see Section 4), only the first bits were retained for further analysis. The first and the bits were also removed because they are necessarily 0.
- Dataset splitting: The data was randomly split into training (80%) and testing (20%) subsets to evaluate model performance on unseen data.
- An input layer with 14 features (bits),
- A hidden dense layer with 32 units and ReLU activation,
- A second hidden dense layer with 16 units and ReLU activation,
- An output layer with 1 unit and sigmoid activation for binary classification.
- Three hidden dense layers with 64, 64, and 8 units respectively,
- ReLU activations in all hidden layers,
- A sigmoid output unit for binary classification.
6. Discussion
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- OEIS Foundation Inc. A129771 in the On-Line Encyclopaedia of Integer Sequences. Available online: https://oeis.org/A129771 (accessed on 10 July 2025).
- OEIS Foundation Inc. A016031 in the On-Line Encyclopaedia of Integer Sequences. Available online: https://oeis.org/A016031 (accessed on 10 July 2025).
- Allaire, J. , Chollet, F., et al. (2024). keras: R Interface to ’Keras’. R package version 2.16.0. URL: https://CRAN.R-project.org/package=keras.
- Bishop, C.M. (1995). Neural Networks for Pattern Recognition. Oxford University Press.
- De Bruijn, G. (1946) A combinatorial problem, Nederl. Akad. Wetensch. Proc., 49, 758-764.
- De Bruijn Sequence and Universal Cycle Constructions (2024). Available online: http://debruijnsequence.org. (accessed on 10 July 2025).
- Etzion, T. Sequences and the de Bruijn Graph: Properties, Constructions, and Applications. Elsevier (2024).
- Fredricksen, H. (1982) A Survey of Full Length Nonlinear Shift Register Cycle Algorithms. SIAM Review, Vol. 24, No. 2, pp. 195-221.
- Golomb, W. (1967) Shift Register Sequences, Holden-Day, San Francisco, 1967, pp. 118-122.
- Hall, M. (1967) Combinatorial Theory, Blaisdell, Waltham, MA.
- Jin, W. and Chen, F. (2025). Symbolic Dynamics of Cellular Automata. In book: Advances in Cellular Automata (pp.375-397). [CrossRef]
- Knuth, D.E. The art of computer programming, volume 4A: combinatorial algorithms, part 1. Pearson Education (2011).
- Li, W. (1992) Phenomenology of Noniocal Cellular Automata. J. Stat. Phys. Vol. 68, Nos. 5/6.
- Ralston, A. (1982) De Bruijn Sequences: A Model Example of the Interaction of Discrete Mathematics and Computer Science. Mathematics Magazine, Vol. 55, No. 3, pp. 131-143.
- Alonso-Sanz, R. Discrete systems with memory, World Scientific Series on Nonlinear Science Series A: Volume 75 (2011).
- R Core Team (2024). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL: https://www.R-project.org/.
- Wolfram, S. (1983) Statistical mechanics of cellular automata. Reviews of Modern Physics, Vol. 55, No. 3, 601-644.
- Wolfram, S. (1984) Computation Theory of Cellular Automata. Commun. Math. Phys. 96, 15- 57.


| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 16784 | 7220 | 9547 | 8060 | 8665 | 5668 | 3494 | 2670 | 1592 | 977 | 421 | 192 | 90 | 77 | 63 | 16 |
| Evil odd number | Rule in decimal | Rule in binary | de Bruijn Sequence | ||
|---|---|---|---|---|---|
| 1 | - | - | 1 | 01 | 01 |
| 2 | 3 | 1 | 3 | 0011 | 0011 |
| 3 | 3 | 15 | 45 | 00101101 | 00010111 |
| 3 | 5 | 15 | 75 | 01001011 | 00011101 |
| 4 | 3 | 255 | 765 | 0000001011111101 | 0000101101001111 |
| 4 | 9 | 255 | 2295 | 0000100011110111 | 0000110100101111 |
| 4 | 15 | 255 | 3825 | 0000111011110001 | 0000100110101111 |
| 4 | 17 | 255 | 4335 | 0001000011101111 | 0000111100101101 |
| 4 | 27 | 255 | 6885 | 0001101011100101 | 0000101111001101 |
| 4 | 29 | 255 | 7395 | 0001110011100011 | 0000110101111001 |
| 4 | 43 | 255 | 10965 | 0010101011010101 | 0000101001101111 |
| 4 | 57 | 255 | 14535 | 0011100011000111 | 0000110111100101 |
| 4 | 65 | 255 | 16575 | 0100000010111111 | 0000111101001011 |
| 4 | 71 | 255 | 18105 | 0100011010111001 | 0000100111101011 |
| 4 | 75 | 255 | 19125 | 0100101010110101 | 0000101111010011 |
| 4 | 83 | 255 | 21165 | 0101001010101101 | 0000101100111101 |
| 4 | 85 | 255 | 21675 | 0101010010101011 | 0000111101011001 |
| 4 | 89 | 255 | 22695 | 0101100010100111 | 0000110010111101 |
| 4 | 99 | 255 | 25245 | 0110001010011101 | 0000101001111011 |
| 4 | 113 | 255 | 28815 | 0111000010001111 | 0000111101100101 |
| # Feasible | # de Bruijn | Feasible/Total | de Bruijn/Total | de Bruijn/Feasible | ||
|---|---|---|---|---|---|---|
| 2 | 16 | 1 | 0.0625 | |||
| 3 | 256 | 2 | 2 | 0.0078125 | 0.0078125 | 1 |
| 4 | 65536 | 24 | 16 | 0.000366211 | 0.000244141 | 0.66666667 |
| 5 | 4294967296 | 6144 | 2048 | 1.4305E-06 | 4.7683E-07 | 0.33333333 |
| 6 | 1.84467E+19 | 402653184 | 67108864 | 2.1827E-11 | 3.6379E-12 | 0.16666667 |
| 7 | 3.40282E+38 | 1.7293E+18 | 1.4411E+17 | 5.082E-21 | 4.2351E-22 | 0.08333333 |
| 8 | 1.15792E+77 | 3.1901E+37 | 1.3292E+36 | 2.7550E-40 | 1.1479E-41 | 0.04166667 |
| 9 | 1.3408E+154 | 1.0855E+76 | 2.2615E+74 | 8.0964E-79 | 1.6867E-80 | 0.02083333 |
| Metric (definition) | ||
|---|---|---|
| True Positives (TP) | 397 | 198563 |
| False Positives (FP) | 3 | 19839 |
| True Negatives (TN) | 820 | 180668 |
| False Negatives (FN) | 9 | 930 |
| Accuracy, (TP + TN) / Total | 0.9902 | 0.9481 |
| Sensitivity (Recall), TP / (TP + FN) | 0.9780 | 0.9953 |
| Specificity, TN / (TN + FP) | 0.9964 | 0.9011 |
| Precision (PPV), TP / (TP + FP) | 0.9925 | 0.9092 |
| Negative Predictive Value (NPV), TN / (TN + FN) | 0.9891 | 0.9949 |
| Balanced Accuracy, (Sens. + Spec.) / 2 | 0.9872 | 0.9482 |
| Detection Rate, TP / Total | 0.3230 | 0.4976 |
| Detection Prevalence, (TP + FP) / Total | 0.3255 | 0.5473 |
| True Prevalence, (TP + FN) / Total | 0.3304 | 0.4999 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).