# Application of Genetic Algorithms for Periodicity Recognition and Finite Sequences Sorting
## 6 Conclusions  
During the research, an efficient method utilizing a genetic algorithm was developed for transforming binary sequences with a size of over 100,000 elements into their periodic counterparts. This method allows for extracting all possible variations of transformation \begin{table}
\begin{tabular}{l l} \hline \hline
**Period** & **Solutions (\(n\) = 15)** \\ \hline
2 & 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 \\  & 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 \\ \hline
3 & 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 \\  & 0 1 1 1 0 1 1 0 1 1 0 1 1 \\  & 0 0 1 0 0 1 0 0 1 0 0 1 0 \\  & 1 1 0 1 1 0 1 1 0 1 1 0 1 0 \\ \hline
4 & 1 1 0 0 1 1 0 0 1 1 0 1 0 \\  & 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 \\  & 1 0 0 1 1 0 1 1 0 0 1 1 0 0 \\  & 0 1 0 1 0 1 0 1 0 1 0 1 0 \\  & 1 0 1 1 1 0 1 1 0 1 1 0 1 0 \\  & 1 0 1 0 1 0 1 0 1 0 1 0 1 \\  & 0 0 0 1 0 0 0 1 0 0 0 1 0 0 \\  & 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 \\  & 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 \\  & 0 1 1 0 0 1 0 0 1 0 0 1 0 0 \\  & 1 1 1 0 1 1 1 0 1 1 0 1 1 1 \\  & 0 1 1 0 1 1 0 1 1 0 1 1 1 0 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The results of transforming the previously obtained sequence into a periodic form using the logistic map. \begin{table}
\begin{tabular}{l l} \hline \hline
**Period** & **MinError** \\ \hline
2 & 0.04357534482380826 \\
3 & 0.09115647632270596 \\
4 & 0.04357534482380826 \\
5 & 0.018129348944227353 \\
6 & 0.01182951947279324 \\
7 & 0.003172854048733235 \\
8 & 0.006835432479136291 \\
9 & 0.001426824949332663 \\
10 & 0.0005645921357144535 \\
11 & 0.00038676431381845375 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The results of calculating all minimum errors for each period value ranging from 2 to 11.  
from the original sequence to its periodic form for a specific chosen period value. An analysis was conducted on all obtained variations using sequences generated with the logistic map. As a result of error calculations for a sequence of size \(n\) = 100,000 using a logistic map for periodicity, minimum errors were obtained for each value of the period from 2 to 11. For example, for period 7, the minimum error was 0.0031728354084733235. To optimize the genetic algorithm process, an algorithm called MakePeriod was developed, which yielded results in just 2 generations, as opposed to 2314 previously. The use of the MakePeriod method reduced the number of generations from 2314 to 2, which represents an improvement of 99.91%. The concept of error for nonperiodic sequences was introduced, and these errors were analyzed within the period values ranging from 2 to 11 for sequences with a size of 100,000. As the period value increases, the error value decreases, which in turn is due to the unpredictability property. The study of errors in the interval of period values can also be key to understanding which parameters and conditions can affect the accuracy of the approximation. Furthermore, a comparative analysis of three different crossover methods and three mutation methods was performed. The best results were achieved using single-point crossover with bit inversion, where a solution for a period of 7 was found in just 5 generations. As a result of analyzing the operation of the algorithm of single-point crossover with mutations, it can be noted that all three mutation variants (bit inversion, exchange, reversion) lead to a maximum value of 128. Single-point crossover with bit inversion reached the optimal solution with a period of 7 over 5 generations. This indicates the effectiveness of the algorithm when using these mutation methods in combination with single-point crossover. Crossover with uniform distribution showed the lowest performance, requiring 399 generations to reach a solution. The developed algorithm offers significant potential for application in cases involving large sequences and period values. This research approach presents significant potential for solving complex problems related to the approximation of nonperiodic sequences.