GENERATION OF VALUES FROM DISCRETE PROBABILITY DISTRIBUTIONS WITH THE USE OF CHAOTIC MAPS

The values of random variables are commonly used in the field of artificial intelligence. The literature shows plenty of methods, which allows us to generate them, for example, inverse cumulative density function method. Some of the ways are based on chaotic projection. The chaotic methods of generating random variables are concerned with mainly continuous random variables. This article presents the method of generating values from discrete probability distributions with the use of properly constructed piece-wise linear chaotic map. This method is based on a properly constructed discrete dynamical system with chaotic behavior. Successive probability values cover the unit interval and the corresponding random variable values are assigned to the determined subintervals. In the next step, a piece-wise linear map on the subintervals is constructed. In the course of iterations of the chaotic map, consecutive values from a given discrete distribution are derived. The method is presented on the example of Bernoulli distribution. Furthermore, an analysis of the discussed example is conducted and shows that the presented method is the fastest of all analyzed methods.


INTRODUCTION
Many algorithms and calculating methods are based on random values. Unfortunately, the use of these methods is not always profitable, because of costs or time required for generating these numbers. In case of above-mentioned situations, we can apply pseudo-random values, which are using computers to generate them. The literature provides methods for continuous and discrete distributions. Algorithms and methods from the first group may be used in artificial intelligence algorithms, for example [1,2]. The other group of algorithms is used especially for data encryption, for example, stream ciphers [3,4]. The discrete values are often connected with binary values genration based on uniform distribution. In this case, the obtained values have to be of appropriate quality, which means they have to pass many statistical tests [5,6]. Also, discrete pseudorandom numbers may be used in other applications, for example, computer games, in which data processing form other probability distributions.
Many known methods use statistical relationships that allow you to generate pseudo-random numbers from discrete distributions, e.g. [7]. Some of the methods used for making pseudo-random values are based on chaotic mappings. The reason is connected with the properties of chaotic systems (such as behavior resembling the randomness) and the deterministic way in which values are obtained. Due to this reason, in the literature, one can find a lot of publications on the use of chaos in this type of issue. Most of such research works apply to continuous distributions [8,9,10] and generating strings of binary values [11,12,13]. Non-uniform discrete distributions are practically not considered in the literature with the use of chaotic mappings. For this reason, it seems reasonable to use chaotic maps and their properties to generate those types of values.
The main contribution of this work is the presentation of the method of generating pseudorandom values from a given discrete distribution. The method is using a properly constructed dynamic system with chaotic behavior, which generates appropriate values as a result of iteration. The layout of the article consists of the following sections: Section 2 presents the mathematical foundations of chaotic mappings and discusses the research findings related to pseudo-random values which are generated using chaotic mappings; Section 3 presents a new method that allows to generate values from a given discrete distribution and an analysis with an example using the presented method; finally, conclusions are presented in section 4.

PRELIMINARIES
One of the most common and, at the same time, simplest dynamical system with chaotic behavior, is the asymmetric (skew) ten map. It is defined by the following formula (1). (1) where . For any values of parameter this dynamical system is chaotic. The Lyapunov exponent is calculated as: (2) for (1) is given by equation [14]: Positive value of (2) is a necessary condition for dynamical system to appear chaos. The distribution (invariant density) of iterated variable of (1) is uniform, which is a direct result of the Frobenius-Perron equation [15].
A more general form of (1) was used in [16,17,18] for the construction of a compression algorithm, and expressed in the following way (4): (4) where , , .
Likewise (1), the distribution of the iterated variable of (4) is uniform, and the recurrence is chaotic with Lyapunov exponent equal to: (5) for any values of parameters . Recurrence (4) was used as well in [19,20,21], for the purpose of construction of an encryption algorithm, which enabled the compression of the encrypted plaintext.

RELATED WORKS
The basic method of generating pseudo-random values from given probability distributions (both continuous and discrete) is the inverse cumulative distribution function method. This method requires a pseudo-random value from a uniform distribution and by transforming it with a quantile function of a given probability distribution, one obtains the desired value. The whole can be described using the following equation [22]: (6) where is the mentioned random variable value, is a quantile function and is a random variable with distribution corresponding to .
Method (6) in combination with mapping (1) was also applied in [8] for the derivation of chaotic recurrences, which made it possible to generate values from a given probability distribution. The recurrences are expressed as: (7) where is a cumulative distribution function of a given probability distribution, whereas represents (1). Similar recurrences were analyzed in [9]. Furthermore, in [10] an algorithm for generating pseudo-random values based on the inversed method of "flattening" of probability distributions was shown. This method uses inverse transformations to chaotic recurrences.
The above mentioned juxtaposition of algorithms for generating pseudo-random values is concentrated on methods generating from continuous distributions. Literature also contains methods for generating values from discrete distributions. They focus mainly on receiving binary strings. The following is an example of such an algorithm [8,9,10]: Algorithm 1 -The method of generating binary values [11,12,13] where is the value obtained from a chaotic map, e.g., tent map (1), while is fixed threshold value.
The above method is nothing else but a method of inverting a cumulative distribution function for the Bernoulli distribution, which is determined by means of the probability mass function [23]: The method from the Algorithm 1 can be generalized to more than one threshold value , thanks to which it will be possible to generate values from other discrete probability distributions.

PROPOSED METHOD
Let for denote the probability mass function of discrete random variable designated on a set . Hence, the following equations must hold: (9) The values of may be assigned to unit interval as following: Accordingly, the recurrence in the form of (4) may be derived for the above mentioned separable unit interval. Next, the corresponding value related to probability may be assigned to each separable subinterval of the unit interval, i.e., each arm of considered map has assigned one value of . Thus, in the course of the iterations of so constructed dynamical system, each of its consecutive iteration will derive a certain value of random variable . In consequence, a sequence of the values assumed by random variable are derived for the successive iterations of the map.

CORRECTNESS OF THE METHOD
The method is correct due to the properties of equation (4). Each subinterval on which (4) is defined is visited by the number of iterations that are proportional to its length in a given orbit. Because the invariant density of (4) is uniform, the successive lengths of the subintervals correspond to division (10).
Equation (4) is only one of the possible piecewise linear maps, that enable the generation of values of the given discrete random variable . Other forms of such maps are constructed in such manner, that their direction coefficient of each arm of the map is equal to or . Moreover, the order of the assignment probabilities to the unit interval in equation (10) may be changed. Thus, different linear maps may be derived, which, in the course of the iterations lead to the same distribution of their values (see Fig. 1).
Furthermore, for each of this piece-wise linear maps their Lyapunov exponent is also given by equation (5). Moreover, equation (5) expresses the entropy of the source that is a sequence of the values generated by means of described method (see [17]).

CASE STUDY
In accordance with the definition of the probability mass function for Bernoulli distribution (8), value of random variable assumes probability , whereas value probability . Thus, recurrence in the form of (4) may be designated and the corresponding values and assigned to partition of unit interval (see Fig. 2). Next, by iterating the dynamic system described in the above mentioned manner, a binary sequence is obtained, generating values of random variables from Bernoulli distribution. Thus, Algorithm 1 is implemented by means of chaotic map (4).
The map plotted in Fig. 2 is not the only one of the chaotic maps that enables the procedure of generating values from Bernoulli distribution. Other recurrences that render the same result in the course of iterations are illustrated in Fig. 1, which are the same as used in [24] for the construction of one-time pad as a dynamical system. Accordingly, Algorithm 1 may be regarded as a particular case, and, in consequence, the chaotic maps in Fig. 1 as the generalization of the procedure of generating values from Bernoulli distribution.
Furthermore, in Fig. 3 the implementation of the described method by means of the recurrence from Fig. 2 and skew tent map (1) is plotted, starting at the same initial condition. The graph shows that the derived sequences of values are significantly different. The presented method was compared with the following algorithms allowing to obtain a random variable from the Bernoulli distribution: 1. method 1: Algorithm 1 with tent map (1) with a threshold value 2. method 2: Algorithm 1 with mapping: (11) with a threshold value . This mapping is similar to (1) -has an invariant density equal to 1 [14].
The above methods can be treated as special cases of the cumulative inversion method (6) with set chaotic maps (1) and (11). The results are presented in Table 1. It shows that the presented method is much faster than methods: 1 and 2. It is because a smaller number of comparisons are required for the presented method.
In turn, Figure 4 presents histograms of 0 and 1 values of generated binary strings. The obtained results confirm that all analyzed methods generate values from the Bernoulli distribution.

CONCLUSIONS
In this paper a method of generating values from discrete probability distributions with the use of piecewise linear chaotic maps is proposed. By assigning the successive values of the discrete probability distribution to particular arms of the maps, the generated sequence of values from a given distribution is derived in the course of iterations. The method may be applied to any discrete distribution designated on the finite space of values. An example of generating values from Bernoulli distribution was presented. A comparative analysis was made. The presented method is the fastest of all mentioned in the article.