Show Summary Details
More options …

# Open Mathematics

### formerly Central European Journal of Mathematics

Editor-in-Chief: Gianazza, Ugo / Vespri, Vincenzo

IMPACT FACTOR 2018: 0.726
5-year IMPACT FACTOR: 0.869

CiteScore 2018: 0.90

SCImago Journal Rank (SJR) 2018: 0.323
Source Normalized Impact per Paper (SNIP) 2018: 0.821

Mathematical Citation Quotient (MCQ) 2018: 0.34

ICV 2017: 161.82

Open Access
Online
ISSN
2391-5455
See all formats and pricing
More options …
Volume 16, Issue 1

# Generation of pseudo-random numbers with the use of inverse chaotic transformation

Marcin Lawnik
Published Online: 2018-02-08 | DOI: https://doi.org/10.1515/math-2018-0004

## Abstract

In (Lawnik M., Generation of numbers with the distribution close to uniform with the use of chaotic maps, In: Obaidat M.S., Kacprzyk J., Ören T. (Ed.), International Conference on Simulation and Modeling Methodologies, Technologies and Applications (SIMULTECH) (28-30 August 2014, Vienna, Austria), SCITEPRESS, 2014) Lawnik discussed a method of generating pseudo-random numbers from uniform distribution with the use of adequate chaotic transformation. The method enables the “flattening” of continuous distributions to uniform one. In this paper a inverse process to the above-mentioned method is presented, and, in consequence, a new manner of generating pseudo-random numbers from a given continuous distribution. The method utilizes the frequency of the occurrence of successive branches of chaotic transformation in the process of “flattening”. To generate the values from the given distribution one discrete and one continuous value of a random variable are required. The presented method does not directly involve the knowledge of the density function or the cumulative distribution function, which is, undoubtedly, a great advantage in comparison with other well-known methods. The described method was analysed on the example of the standard normal distribution.

MSC 2010: 37M25; 11K45; 62E99

## 1 Introduction

The generation of pseudo-random numbers is crucial in many fields of science like cryptography, where cryptographically secure pseudo-random numbers are needed e.g. [1] or scientific computations, where often numbers from another than uniform distribution are crucial e.g. [2, 3].

There are many published algorithms that enable the derivation of values from the given probability distribution. One of the most popular is the method of inverse cumulative distribution function determined by the equation [4]: $X=F−1(U),$(1)

where U is a random variable from the uniform distribution on interval (0, 1), F−1 is a quantile function and X is a random variable with distribution corresponding to F.

Another very popular method for pseudo-random numbers generation is the rejection (also called acceptance and rejection) method, which is the implication of the following observation [5]:

if a random point (X, Y) is uniformly distributed in the region Gf between the graph of the density function f and the x-axis, then random variable X has density f.

Additionally, in professional literature the methods which allow the generation of pseudo random numbers from a concrete distribution can be found, for example, from the normal one [6, 7, 8, 9]. One of such algorithms is the Box-Muller transformation given by the equations [6]: $N1=−2ln⁡U1cos2πU2 and N2=−2ln⁡U1sin2πU2,$(2)

where N1 and N2 are standard normal random variables, whereas U1 and U2 are random variables from uniform distribution.

Apart from these classical methods, there are also ways of constructing chaotic maps solving the so-called inverse Frobenious-Perron problem [10, 11, 12], which enables the construction of recurrences with predefined invariant densities. Iterating such dynamical systems is an easy way of generating pseudo-random numbers. One of such recurrences is in the following form [13]: $xk+1=F−1UF(xk),$(3)

where F is a given cumulative distribution function, F−1 is the inverse function to F and U is the skew tent map. The skew tent map (also called as the asymmetric tent map) is given by the relation: $xk+1=f(xk)=xkp0(4)

For each value of parameter p ∈ (0, 1), the recurrence (4) is chaotic and has a uniform distribution of the iterated variable. Due to these properties, reccurence (4) is very popular as a component of pseudorandom number generators in cryptographic applications [14, 15, 16].

Transformations in the form of (3) were analyzed in [17]. The derived results indicate that for values of parameter p close to 0 or 1, the desired probability distribution of the iterative variable cannot be derived. The reason is a small -– close to zero – value of the Lyapunov exponent, which measures the rates of convergence or divergence of nearby trajectories. The Lyapunov exponent of the dynamical system xk+1 = f(xk) is given by the formula: $λ=limm→∞1m∑i=0m−1ln⁡|f′(xi)|.$(5)

Furthermore, methods for generating pseudo-random numbers with the use of chaotic maps related only to a specific distribution can be shown, for example the normal distribution with the use of the Weierstrass recurrence, which was firstly shown in [18] and futher analized in [19]. The Weierstrass recurrence can be expressed by the formula: $xk+1=∑i=0Naicos⁡(biπxk),$(6)

where 0 < a < 1, b is a odd number and $\begin{array}{}ab>1+\frac{3}{2}\pi .\end{array}$ As shown in [19], iterating (6) with parameter value a close to 1, generates values from the normal distribution.

Another method which applies chaotic maps in pseudo-random numbers generation was shown in [20], where values from uniform distribution are generated. This method may be described by the following procedure:

#### Method 1

Let Un (x) denote the n-th iteration of the chaotic map with a uniform distribution starting from initial condition x. Furthermore, let: $X={x0,x1,…,xN−1}$(7)

be a certain pseudo-random set of numbers from continuous distribution with finite support. In such case, the set $U={u0=Un|ax0|,u1=Un|ax1|,…,uN−1=Un|axN−1|}$(8)

where a is a normative coefficient, has the distribution similar to uniform.

The above procedure enables the ”flattening” of continous distribution, i.e. reducing it to the uniform distribution. Furthermore, the accuracy of this process depends on the number of iterations n - if it is too small, then the obtained distribution only ”flattens” the oryginal density functions of (7). The transformation f may be chosen as the skew tent map (4). Other examples of chaotic maps with uniform distribution may be found in [21, 22]. Likewise, as recurrence (4), they consist of several independent functions, which may be called as branches.

While analyzing the above-described method a natural question arises: Is the process of reduction of any distribution to the uniform distribution reversible? If yes, then in consequence, a new method enabling the generation of pseudo-random numbers from any distribution could be derived. The fact that the transformation described in (8) is a 1D chaotic map means that it is irreversible. However, by additional assumptions the process may become reversible, which is discussed in the next section of this paper.

## 2 Method and analysis

The inversion of a chaotic transformation given, for example, by (4) does not render an unequivocal solution. Yet, knowing which of the branches of the transformation were iterated, the chaotic map may be inverted. This may be achieved by finding successive inverse images by means of a inverse function to an appropriate branch. Assuming that we have two branches that are denoted as ”0” and ”1” (see Fig. 1), any orbit starting from an initial point in (7) creates a certain binary sequence. Thus, by replacing every binary sequence with the appropriate integer number, in consequence, a set of integers is derived. Next, for such set it is possible to calculate the frequency of the occurrence wi of particular integers, in accordance with the dependence: $wi=niN,$(9)

where ni denotes the amount of successive integers in the above-mentioned set and i = 0,1,…,2n − 1.

Fig. 1

Skew tent map (4) with the assignment of the values of 0 and 1 to successive branches.

An example of such numerical normalized frequency set is shown in Fig. 2. Conducted numerical analysis has shown, that this set is invariant if the number of elements in (7) changes and the values of parameters p, a and n are fixed. Changing values in the mentioned parameters provides a new set of elements in the form (9).

Fig. 2

Frequency wi of particular combinations of the branches of recurrence (4) with n = 7 and p = 0.45.

Thus, the algorithm of generating pseudo-random numbers from the given distribution with the use of transformation f may be described by the following procedure:

1. Set the values of the frequency of the occurrence wi.

2. In accordance with wi, generate an adequate value of discrete random variable i from the set {0,1,…,2n − 1}.

3. Generate a value of random variable u ∈ (0, 1) from the uniform distribution.

4. In accordance with i inverse the value of u by calculating x = fi(u), where f is the mapping used to get (9).

5. Return x.

Above-described algorithm is an approximate method of generation of pseudo-random numbers. It can be seen as a form of decomposition method of distributions. The accuracy of the method depends on the values of wi, which must be designated for properly large set X with adequate number of iterations n. Next, the derived values of wi may be catalogued. Then, to generate the values from the given distribution it is not necessary to know the density function or the cumulative distribution function. This eliminates the first step in above proposed algorithm. In comparison with other methods, such as inversion of the cumulative distribution function, or method of acceptance-rejection, it is, undoubtedly, a great advantage. Nevertheless, the algorithm requires to generate two values of random variables (one discrete and one from uniform distribution) which in comparison with the inversion cumulative distribution method is a disadvantage.

## 3 Example

The implementation of the above-described method shall be presented on the example of standard normal distribution. Accordingly, taking advantage of (8) and (4) the frequency of the occurrence of specific combinations of the branches wi (9) was calculated. The results are presented in Fig. 2. Next, on the grounds of the frequencies using presented algorithm, a sequence of pseudo-random numbers was generated which numerically calculated density function shown in Fig. 3. The obtained results show good matching of the obtained distribution with the standard normal distribution. Moreover, a series of statistical tests was carried out to verify the properties of the analysed method. The results are compiled in Table 1, certifying that the discussed method enables the generation of pseudo-random numbers from standard normal distribution.

Fig. 3

Numerically obtained density function of the set of numbers derived by means of the presented algorithm (black line), red line shows the standard normal distribution.

Table 1

Normality tests (from scipy.stats - Python module for statistics [23]) results for 500000 computed values with presented algorithm with skew tent map (4).

## 4 Conclusions

The method discussed in the paper enables the generation of pseudo-random numbers from a given distribution. It requires the knowledge of the frequency of the occurrence of particular branches of the transformation during the process of generating the uniform distribution described in [20]. However, neither the density function nor the cumulative distribution function are directly used in the method. The method was numerically analysed on the example of standard normal distribution. The obtained results prove its accuracy. It may be applied to create a series of generators of pseudo-random numbers from continuous probability distribution.

## References

• [1]

Blum L., Blum M., Shub M., A Simple Unpredictable Pseudo-Random Number Generator. SIAM Journal on Computing, 1986, 15 (2), 364–383

• [2]

Woźniak M., Połap D., On some aspects of genetic and evolutionary methods for optimization purposes, Int. J. Electron. Telecommun, 2015, 61(1), 7–16

• [3]

Słota D., Using genetic algorithms for the determination of an heat transfer coefficient in three-phase inverse Stefan problem, Int. Commun. Heat Mass Transf., 2008, 35(2), 149–156

• [4]

Devroye L., Non-Uniform Random Variate Generation, Springer, 1986 Google Scholar

• [5]

Hörmann W., Leydold J., Derflinger G., Automatic Nonuniform Random Variate Generation, Springer-Verlag, Berlin Heidelberg, 2004 Google Scholar

• [6]

Box G.E.P., Muller M.E, A Note on the Generation of Random Normal Deviates, Ann. Math. Stat., 1958, 29(2), 610–611

• [7]

Marsaglia G., Bray T.A., A convenient method for generating normal variables, SIAM Rev., 1964, 6, 260–264

• [8]

Leva J.L., A fast normal random number generator, ACM T. Math. Softw., 1992, 18, 449–453

• [9]

Afflerbach L., Wenzel K., Algorithm Normal random numbers lying on spirals and clubs, Stat. Pap., 1998, 29, 237–244 Google Scholar

• [10]

Pingel D., Schmelcher P., Diakonos F.K., Theory and examples of the inverse Frobenius–Perron problem for complete chaotic maps, Chaos, 1999, 9(2), 357–366

• [11]

Koga S., The Inverse Problem of Flobenius-Perron Equations in 1D Difference Systems: 1D Map Idealization, Prog. Theory. Phys., 1991, 86(5), 991–1002

• [12]

Grossmann S., Thomae S., Invariant Distributions and Stationary Correlation Functions of One-Dimensional Discrete Processes, Z. Naturforsch, 1977, 32, 1353–1363 Google Scholar

• [13]

Lai D., Chen G., Generating Different Statistical Distributions By The Chaotic Skew Tent Map, Int. J. Bifurcat. Chaos, 2000, 10, 1509–1512

• [14]

Palacios-Luengas L., Delgado-Gutiérrez G., Díaz-Méndez J.A., et al., Symmetric cryptosystem based on skew tent map, Multimed Tools Appl, 2017, 1–32

• [15]

Li C., Luo G., Qin K., Li C., An image encryption scheme based on chaotic tent map, Nonlinear Dynamics, 2017, 87(1), 127–133

• [16]

Khan J., Ahmad J., Hwang S.O., An efficient image encryption scheme based on: Henon map, skew tent map and S-Box, In: 6th International Conference on Modeling, Simulation, and Applied Optimization (ICMSAO) (27-29 May 2015 Istanbul, Turkey), 2015, 1–6 Google Scholar

• [17]

Lawnik M., Analysis of the chaotic maps generating different statistical distributions, J. Phys.: Conf. Ser., 2015, 633(012086), 1–4 Google Scholar

• [18]

Berezowski M., Lawnik M., Identification of fast-changing signals by means of adaptive chaotic transformations, Nonlinear Anal. Model. Control, 2014, 19(2), 172–177 Google Scholar

• [19]

Lawnik M., The approximation of the normal distribution by means of chaotic expression, J. Phys.: Conf. Ser., 2014, 490(012072), 1–4 Google Scholar

• [20]

Lawnik M., Generation of numbers with the distribution close to uniform with the use of chaotic maps, In: Obaidat M.S., Kacprzyk J., Ören T. (Ed.), International Conference on Simulation and Modeling Methodologies, Technologies and Applications (SIMULTECH) (28-30 August 2014, Vienna, Austria), SCITEPRESS, 2014, 451–455 Google Scholar

• [21]

Huang W., Characterizing chaotic processes that generate uniform invariant density, Chaos, Soliton Fract., 2005, 25(2), 449–460

• [22]

Anikin V.M., Arkadaksky S.S., Kuptsov S.S., Remizov A.S., Vasilenko L.P., Lyapunov exponent for chaotic 1D maps with uniform invariant distribution, B. Russ. Aca. Sci. Phys., 2008, 72(12), 1684–1688

• [23]

Python scipy.stats module, http://docs.scipy.org/doc/scipy/reference/stats.html (last access 23.03.2016)

Accepted: 2017-12-22

Published Online: 2018-02-08

Citation Information: Open Mathematics, Volume 16, Issue 1, Pages 16–22, ISSN (Online) 2391-5455,

Export Citation