# Application of Genetic Algorithms for Periodicity Recognition and Finite Sequences Sorting
## 3 Problem Statement  
Studying unpredictable strings and functions will enable the improvement of specific algorithms in terms of enhancing their efficiency because many of these types of algorithms heavily rely on the unpredictability of input data. Researching the role of unpredictability allows for the optimization of these algorithms and the enhancement of quality assurance. This is particularly significant as the quality and unpredictability of generated sequences hold key importance in many applications [11].  
Our task is to obtain all possible periodicity options for a given sequence. A new genetic algorithm is used to solve the problem. In turn, the development of this genetic algorithm consists in finding optimal solutions in a finite set of objects that will meet certain criteria.  
A logistic mapping is used to construct the sequence under test. This is a discrete mapping that is often used to model dynamic systems with limited resources or to generate binary sequences [12]. Despite the simplicity of the logistic mapping, it allows you to model very complex processes. Our choice to use the logistic mapping is justified by the desire to take advantage of the simplicity of the formula, but we also emphasize that the logistic mapping is, in fact, a special case of a more general class of chaotic maps. Chaotic mappings, including logistic mappings, provide important tools for creating dynamic and complex sequences with interesting characteristics. Although we used a specific logistic mapping to create a sequence, it is also important in our study to further consider more general concepts of chaos. The logistic equation has the form  
\[x_{n+1}=\mu x_{n}(1-x_{n}),\quad x\in\mathbb{R}, \tag{1}\]where \(x_{n}\) is the current value, and \(x_{n+1}\) is the next value. The parameter \(\mu\) controls the behavior of the system.  
The choice of the parameter \(\mu\) and the initial value \(x_{0}\) in the equation strongly affect the generation of the binary sequence. It is convenient to take the parameter \(\mu\) in the interval [0, 4] [13]. Two areas, \(F_{1}\) and \(F_{2}\), are also selected, which, depending on its value, will relate to \(x\). An element of a binary sequence will have the value 0 or 1 if it belongs to the domains \(F_{1}\) and \(F_{2}\), respectively:  
\[s_{i}=\begin{cases}0,&x_{i}\in F_{1}\\ 1,&x_{i}\in F_{2}\end{cases} \tag{2}\]  
Thus, to construct a binary sequence, the value of the parameter \(\mu=3.91\), and the initial value \(x_{0}=0.4\). Since we needed to obtain the sequence \(s_{n}\), which will consist of 0 and 1, the regions were chosen as follows, respectively: \(F_{1}=[0,0.5]\) and \(F_{2}=[0.5,1]\).  
For a computational program, a sequence consisting of 0 and 1 is considered as input data. A genetic algorithm is applied to it, which solves the problem by methodically iterating through states and state transitions in order to find a solution from the initial state to the final one. The task of the algorithm is to make a calculation based on a heuristic approach, which, for the initial length of the considered (input) sequence \(s_{n}\), checks it for periodicity \(P\), after which it outputs all its received variants converted into a periodic form. The process of checking the sequence \(s_{n}\) for periodicity \(P\) occurs by comparing \(s_{i}=s_{i+P}\) the value of each element with \(i\leq N-P\), where \(N\) is the length of the sequence.  
Heuristic algorithms are widely used to solve problems of high computational complexity. The idea is that instead of a complete search of options, which takes a time-consuming process, a relatively easy approach is used. The main disadvantage of this approach is an insufficiently theoretically sound algorithm [14].