{'fraction_non_alphanumeric': 0.048352770920234954, 'fraction_numerical': 0.011236911551885588, 'mean_word_length': 4.515492957746479, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Generation of Correlated Binary Sequence from White Noise

We suggest a method for generation of random binary sequences with prescribed correlation properties. It is based on a kind of modification of the widely used convolution method of constructing continuous random processes. Apart from the theoretical interest, this method can be used in various applications such as the design of one-dimensional devices giving rise to selective transport properties.

Applications of some versions of this method for the generation of random sequences with specific correlations, including the long-range non-exponential correlations, can be found in Refs. [3,4,5,6,7,8].
In the theory of spatially disordered systems the role of the pair correlator (for random potentials) is emphasized by the fact that it determines the scattering cross section in the Born approximation (for weak potentials). As a result, many linear transport characteristics (conductance, transmission and reflection coefficients, localization length, etc.) are expressed through the pair correlator. 9,10 There are some examples of the systems (or processes) with correlated disorder, for which the fluctuating parameter takes discrete values. An example of such a system is the DNA macromolecule. Here the genetic information is written using four symbols that are the basic nucleotides. In the digital devices the information is transmitted in a form of a telegraphic signal, i.e. a binary code. The binary sequences is the limiting case of random sequences with the least number of the basic elements. For practical applications it is desirable to develop a method of generation of a binary sequence with prescribed pair correlator -a kind of colored noise containing two elements, e.g., "0" and "1". Although there were some attempts to obtain a robust algorithm for generation of a correlated binary sequence with the purpose of increasing the performance of a pulse radar, 11 the problem is still lacking a general solution. It is worth mentioning that there are methods of generation of a correlated binary sequence, which are not based on the properties of the correlation function, see, e.g., Ref. [12]. It is not known yet, what are the constraints (if there are any) for the pair correlator, imposed by the fact that the sequence is dichotomous (binary). For example, an attempt to generate a dichotomous sequence with the correlations decaying according to the inverse power law, was unsuccessful. 13 Recently, we addressed the mathematical problem of generation of a dichotomous sequence with prescribed correlation properties. 14 We concentrated our attention on statistical properties of binary additive Markov chains. It was shown that some special classes of correlations can be reconstructed with the use of the so-called memory function. The latter is related to the pair correlator through a quite complicated linear integral equation.
In this paper we present a new approach based on the convolution method that was modified for the generation of correlated binary sequences. The relation between the filtering function -the kernel of the convolution operator -and the pair correlator turns out to be relatively simple. The advantage of this method is that it requires less computation efforts to generate long sequences.

II. CONVOLUTION METHOD
The convolution method of generation of a continuous colored noise β(n) starting from a white-noise α(n) is based on a linear transformation with the use of the modulation function G(n), see Refs. [ 6,7,15]. The most general form of this transformation is as follows, Here α and β are the mean values, and C α (0) = α 2 (n)−(α) 2 and C β (0) = β 2 (n)−(β) 2 are the variances of the white and colored noise respectively. For a homogeneous sequence α(n) the generated sequence β(n) is also homogeneous. In what follows, we introduce the normalized pair correlator K β (r) = C β (r)/C β (0), which is an even function of r. Substituting the linear transformation (1) into the correlation function C β (r), and taking into account that the sequence α(n) is δ-correlated, the following relation between the pair correlator and the modulation function is readily obtained, From the condition K β (0) = 1 one gets, Calculating the product β(n + r)β(n), we took into account that the white noise α(n) is ergodic, i.e. the average over n can be replaced by the average over ensemble of white-noise sequences.
Since K β (n) and G(n) are even functions, it is convenient to apply the cosine Fourier transform to both sides of Eq. (3). This results in the following relation, where Similar relations can be written for G(k) and G(n).
The expression (5) determines the modulation function in terms of the Fourier transform of the pair correlator, Evidently, the solution (7) satisfies the normalization condition (4).
For different white-noise sequences α(n) the convolution method, Eqs. (1), (6) and (7), defines an ensemble of colored-noise sequences β(n), possessing the same pair correlator K β (n). The number of terms contributing to the series (1) depends on the sharpness of the correlator K β (n). For short-range correlations, when K β (n) decays very fast, the modulation function G(n) is also sharp, therefore, the principal contribution is mainly given by a single term with n ′ = n. The sequence β(n) in this case is practically delta-correlated for both continuous and binary sequences α(n). In the opposite case of long-range correlations, when the correlation length R c is large (R c ≫ 1), many terms contribute to Eq. (1). In this case even for a binary sequence α(n), employing the method of characteristic function, one can obtain that the probability density ρ B (β) for stochastic variable β(n) has the Gaussian form, provided the condition is fulfilled. The deviations from the Gaussian shape may appear only at the far tails, where Note that for a continuous Gaussian distribution of α(n) Eq. (8) is exact for any value of R c .
From the above consideration it is clear that the correlated sequence β(n) may be generated using very different uncorrelated sequences α(n), including the binary white noise.
However, if we start with the binary white noise α(n), the generated sequence β(n) is obviously a non-binary one since at any site n the value of β(n) in Eq. (1) results from a linear superposition of binary entries. This means that the direct application of the convolution method does not generate a binary correlated sequence.

III. FILTERING PROBABILITY
Let us now consider the problem of generating a binary sequence ε(n) with prescribed correlations, assuming that the sequence α(n) is also binary. We suppose that both the sequence ε(n) and α(n) contain 0's and 1's. Let the nth site for ε(n) is associated with the number P n (0 ≤ P n ≤ 1), which is the probability of "1" obtaining at this site. In order to calculate the filtering probabilities P n from white noise α(n), in analogy with Eq. (1) we propose the linear transformation Here C ε (0) = ε(1 − ε) and C α (0) = α(1 − α) are the variances of ε(n) and α(n), respectively, and F (n) is an unknown modulation function to be determined. Having the value of P n , the nth symbol is generated by drawing randomly a number from the interval [0,1]. If this number is less than P n , then ε(n) = 1, otherwise, ε(n) = 0. Thus, a binary sequence ε(n) can be generated, once the set of numbers {P n } ∞ n=−∞ is known due to Eq. (10). The values of P n are correlated in the following way, According to the method of generation of the sequence ε(n) from the filtering probabilities, the probability of the symbol ε(n + r) obtaining at the (n + r)th site does not depend on the emergence of the symbol ε(n) at nth site (for r = 0). Therefore, the product P n+r P n gives the joint probability of 1 obtaining at the nth and (n + r)th sites. If 0 appears at either of these sites, the corresponding pair does not contribute to the product ε(n + r)ε(n).
Hence, the correlation function for sequence ε(n) can be expressed through the correlation function of the filtering probabilities As one can see, the correlations in the sequence ε(n) occur because of the correlations between the filtering probabilities. The latter are enforced by the modulation function, see Eq. (10). Thus, using Eqs. (11) and (12), the relation between the correlator of the binary sequence and the modulation function can be written as The normalization condition (14) is the property of the correlator K ε (r). It should be stressed that unlike Eq. (3) that is valid for all values of r including r = 0, in the case of binary sequences the derived Eq. (13) is not valid for r = 0. Therefore, the sum n F 2 (n) remains undefined and has to be considered as a free constant, This constant appears now in the Fourier transform of Eq. (13) as follows, Using Eq. (16) the relation between the modulation function and the pair correlator of the binary sequence can be written in the form, Thus, Eqs. (10) and (17) define the algorithm of the generation of a binary sequence with the prescribed pair correlator.
The unknown constant A has to satisfy to the condition that the values of the filtering probabilities (10) do not exceed 1, Taking into account that the argument of the square-root in Eq. (17) must be positive, this inequality can be rewritten (forᾱ =ε = 1/2) in terms of the constant A, The constraints imposed by Eqs. (18) and (19) limit the class of generated binary sequences that can have a given pair correlator. In particular, a binary sequence with the slow-decaying correlator K ε (n) = sin(an)/an cannot be generated with the use of the proposed algorithm since the sum n |F (n)| diverges in this case. As is known, the power-decaying correlators provide an emergence of a kind of mobility edges in systems with random one-dimensional potentials. 6,16 In this case, a sharp transition from localized to delocalized eigenstates occurs when crossing some value in the energy spectrum, specified by the mobility edge. Although such mobility edges were experimentally observed for a continuous distribution of fluctuations in artificially fabricated site-potentials with long-range correlations, 15 it is not clear yet, if they do exist for a correlated binary sequence. That is why the existence of a mobility edge in a sequence of nucleotides in a DNA molecule is still questionable. 13,17 As an example, let us consider the exponential binary correlator with the corresponding Fourier representation, Since K ε (k) reaches its minimum at k = π, the condition 1 − K ε (k) ≤ A is satisfied for A = 1 − K ε (π) = 1 − tanh(γ/2). Therefore, we have, and the function F (n) reads For n ≫ 1 the modulation function decays as follows, therefore, the sum n |F (n)| converges. It, however, exceeds 1 for γ < γ cr ≈ 1.60, thus violating the last inequality in Eq. (19). The numerical simulation shows that for γ > γ cr the method works quite well, giving a possibility to construct binary chains of length 10 7 with the prescribed correlator K(r) within a few percents of accuracy for r ≤ 5.
In conclusion, we suggest a method of filtering probabilities to construct a binary correlated sequence from a white noise. The proposed algorithm consists of the following steps.
First, starting from the prescribed mean value ε, variance C ε (0) and power spectrum K ε (k), one calculates the filtering function F (n) by making use of Eq. (17). The next step is optimization of the value of the constant A according to Eq. (19). Then, the filtering probabilities P n are calculated from Eq. (10). Finally, for any site n by comparing the value of P n with a number drawn randomly from the interval [0,1], one gets the number 0 or 1 that create the binary sequence β(n).