Uniform Twister Plane Generator

Corresponding Author: Yulian A. Menyaev Winthrop P. Rockefeller Cancer Institute, University of Arkansas for Medical Sciences, Little Rock, AR, USA Email: yamenyaev@uams.edu Abstract: Random plane generators may use various types of the random number algorithms to create multidimensional planes. At the same time, the discrete Descartes random planes have to be uniform. The matter is that using the concept of the uncontrolled random generation may lead to a result of weak quality due to initial sequences having either insufficient uniformity or skipping of the random numbers. This article offers a new approach for creating the absolute twisting uniform two-dimensional Descartes planes based on a model of complete twisting sequences of uniform random variables without repetitions or skipping. The simulation analyses confirm that the resulted random planes have an absolute uniformity. Moreover, combining the parameters of the original complete uniform sequences allows a significant increase in the number of created planes without using additional random access memory.


Introduction
In our previous studies (Deon and Menyaev, 2016a;2016b; there were proposed several pseudorandom number generators, particularly nsDeonYuliTwist32D, which offers a technique of using no congruential twisting array. This generator allows the creation of absolutely complete twister uniform sequences having various lengths. The direction of Random Plane (RP) Generators (RPG) employs a stochastic process at the time of creating the points distributed on N-dimensional plane.
The principles of all these studies are based on the conception of random planes, in which the Descartes plane features have to satisfy the following properties: (1) The generation process has to provide the uniqueness (i.e., no repetitions) of each point on the plane and (2) the generation process has to keep the completeness (i.e., without skipping) for all created points. These properties should be considered as a 'natural filter' for choosing the random number generator.
Let's consider two of them in brief. If the generation uses the twister generator MT19937 (Matsumoto and Nishimura, 1998;Matsumoto et al., 2006;2007;Saito and Matsumoto, 2008), then the result of this attempt is very discussable since this generator in DieHard Tests (Berger and Zorn, 2006;Novark and Berger, 2010;Alani, 2010) demonstrates a uniqueness level of 0.7, which is equivalent to the level of repeatability 1-0.7 = 0.3. On the other hand, we may use the twister generator nsDeonYuliTwist32D (Deon and Menyaev, 2017), which is guaranteed to create the complete uniform twisting sequences of an arbitrary size having no repetitions and skipping of elements. Now the question here is: Would it be possible to observe the Descartes properties in the current particular task?
So, the aim of this article is to find a solution for the generation of uniform discrete twisting planes, which possess the Descartes property of a single presence of the random points in nodes of the discretization grid.

Theory
One of the options to represent the discrete Descartes plane is an enumeration of all points in the grid nodes, formed from the values of discretization on the corresponding axes. If the location of axes is independent, the grid has a rectangular view. Moreover, if discretization for both axes is the same and uniform, the grid has a square view.
Let's assume that the square grid includes N points of discretization along each axis. Thus, the total number of grid points is N×N = N 2 . To set these points in a random way, an algorithm is required that can provide a random move from one point to another. Now would be a good time to point out and emphasize the following: The plane is random only if moving from one point to another, while creating the plane, utilizes the stochastic process.
In this case, the requirement of Descartes axes, which prescribes a unique representation of each point, has to be kept. The unambiguity is determined by the discretization of the axes. Uniqueness is provided by an appropriate procedure, which does not allow entering each point of the grid twice or more times. The skipping of vertices of the grid isn't allowed either. In other words, each point is presented once during generation of all the grid points. In this case, the total enumeration of the points is N 2 . Following this way, such a grid on the Descartes plane is called uniform and a random Descartes plane, which contains uniform grid, is called uniform Descartes RP.
There are many ways to specify the points on the grid. Let's name a few of them: • Rectangular left or right filling of the grid, when one of the axes is selected and at each location of discretization of this axis, the points along the discrete points of the other axis are placed on the grid • Rectangular top or bottom filling of the grid under the same conditions • Diagonal filling of the grid under the same conditions • The secondary indexing of the discrete points along the Descartes axes This is not a whole list of possible techniques. The options to choose aren't limited and can be organized by the designer in any possible way. Note that items (1) -(3) create ordinary Descartes planes and item (4) allows obtaining the random Descartes planes, if the secondary index is a result of the stochastic process.
If random value x 0 = 1 is chosen as an initial value, then the designated generator GU creates the sequence U = <1, 0, 3, 2>. From this it follows that the initial random vertex will be located on the vertical part of the grid with horizontal discrete mark 1 along the U axis ( Fig. 1).
If the second independent generator, which is designated as GV, uses the initial random value x 0 = 3, then sequence V = <3, 2, 1, 0> is created. From this it's obvious that the second coordinate has the value of 1 for the initial random point <1, 3>. The next vertex has coordinates <0, 2>. Both obtained vertices are connected by an arc, forming the beginning of the random track. Then, vertex <3, 1> will be placed on this track. Finally, the vertex with coordinates <2, 0> completes the random track. For clarity, the visual representation of this track is shown in Fig. 1.
Regarding the random sequence of secondary indices <1, 0, 3, 2> along the U axis, four sequences along the V axis are possible: These sequences V can be interpreted as the left circular shift (Deon and Menyaev, 2016b) of the original sequence <3, 2, 1, 0>. Figure 2 shows four tracks of an interaction of the pairs of sequences on the U and V axes. These tracks provide an exact one-time generation of each vertex on a grid of the Descartes RP.  The program code for this task is presented below, in which all the vertices are generated on a grid of the Descartes RP. Random numbers have the length of w = 3 bits. In each sequences U and V there are N = 2 w = 2 3 = 8 random numbers with Both sequences U and V are given by a congruential model x i+1 = (ax i + c)&maskW with coefficients a = 5 and c = 1. The first sequence begins with value x 0 = 1 and has the form U = <1, 6, 7, 4, 5, 2, 3, 0>. The second sequence begins with value x 0 = 4 and has the form V = <4, 5, 2, 3, 0, 1, 6, 7>. Each cell of matrix A corresponds to one vertex on a grid of RP. The value of cell a ∈ A shows how many times the corresponding vertex is generated. Program names P040201 and cP040201 are selected by chance.
Similar tests of creating uniform planes with an arbitrary bit length w of the random numbers confirm a uniformity of the received RPs. Replacement of the congruential sequences by the different corresponding twisting sequences shows a similar result when generating the twisting RPs. Thus, the complete uniform twisting sequences can ensure a creation of the complete uniform twisting RPs. Now we may proceed to the generator designing.

Construction and Results
Program P040201, described in the previous section, utilizes two arrays U and V as initial congruential sequences. Such arrays can be created using the twister generator nsDeonYuliTwist28DA (Deon and Menyaev, 2016b). However, this solution will not be perfect for the case of large planes because it requires a lot of available Random Access Memory (RAM). For many reasons it may be unavailable on a computer. This limitation can be overcome by using the twister generator nsDeonYuliTwist32D (Deon and Menyaev, 2017), which doesn't use arrays of the twisting sequences. However, a more satisfactory solution is the aforementioned program P040201, which implies the repeated generation of U and V, whereas nsDeonYuliTwist32D doesn't provide this. Thus, we come to the inference that before performing a generation of the twisting planes, it is necessary to have tools for the trivial operations with the twisting sequences.

Simple Twister Generator
Class cDeonYuliSTwist32D, which is presented below, includes in its name a letter S indicating the meaning of the word 'simple'. This class provides elementary operations with the twisting sequences and it does not use any arrays. The prototype of class cDeonYuliSTwist32D is class cDeonYuliTwist32D. They are different in the issue that automatic setting of the congruential parameters a and c is excluded in class cDeonYuliSTwist32D. An example of using this class is presented in this section later, in the description of the program code P040301.
Running the program P040301 with other values of the bit length w of the random numbers confirms a completeness of the generated sequences. This is sufficient to ensure the development of programs for generating the Descartes uniform twisting RPs.

Discussion
Twister generator nsDeonYuliPlaneTwist32D is capable creating a set of uniform twisting RPs for each pair of the congruential constants are automatically presented in circles of the twisters (Deon and Menyaev, 2016b). However, the question is how many twisting planes could be obtained for each pair of parameters a and c?
In the previous section, it has been determined that when creating the initial RP U×V, two random sequences U and V can be taken, which are created by the corresponding twisting generators. It is known that twister 0 is the initial uniform congruential sequence. Let's denote it as U 0 . Another sequence V 0 could be chosen arbitrarily but on the condition that it is also uniform. If the sizes or quantity of elements in the initial sequences are the same card (U 0 ) = card (V 0 ), then it can be stated that among all the possible tracks of the random uniform plane there has to be a track that creates points on the second diagonal (from the left-bottom position to the right-top one) of the corresponding square discrete grid. This is somewhat reminiscent of the idea of a central abstract element and specifically in our case this second diagonal track is the central track of the discrete grid. In generator nsDeonYuliPlaneTwist32D this is exactly what is done, shown at the beginning of the listing of results for the previous program P0040302. U 0 = 3 0 1 6 7 4 5 2 V 0 = 3 0 1 6 7 4 5 2 This is not the only solution because as the central track, one could take the main diagonal (from the left-top position to the right-bottom one) of a grid. But since the initial sequences U and V are random, the order of the vertex passage <3, 3>,<0, 0>, <1, 1>, <6, 6>, <7, 7>, <4, 4>, <5, 5>, <2, 2> is also random. Now let's fix the sequence U while the sequence V is shifted to the left by the circular technique by one position. U 0 = 3 0 1 6 7 4 5 2 V 1 = 0 1 6 7 4 5 2 3 This combination of pairs gives the points of the first track <3, 0>, <0, 1>, <1,6>, <6, 7>, <7, 4>, <4, 5>, <5, 2>, <2, 3> on RP. None of these points can appear on the reverse main diagonal of a grid, since sequences U 0 and V 1 are uniform. Their uniformity follows from the determined properties of the complete twisting sequences (Deon and Menyaev, 2016b). Shifting of sequence V, provided that sequence U 0 is fixed, could be continued and so the second track on a grid might be obtained. U 0 = 3 0 1 6 7 4 5 2 V 2 = 1 6 7 4 5 2 3 0 The second track contains the points, which also cannot occur on track 1 and track 0 of the reverse diagonal and again that is because of the properties of the complete uniform twisting sequences. In this example, only 8 options to present sequence V are possible since the 9 th shift repeats the initial variation V 8 = V 0 .
So, the shift operations for sequences comply with the corresponding varieties of the twisting sequences. In the presented example, the shifts of the congruential sequence, which comply with the congruential generation from the corresponding initial values, are considered. Thus, the congruential initial generation of sequences U 0 and V 0 initiates the creation of one RP using the complete sequence of shifts of one of the original sequences V j while another sequence U 0 is fixed. By analyzing the result of the previous program P040301, it's easy to see that among all sequences [0,23] k V ∈ there are all 8 congruential shifts V k = 0 , V k = 3 , V k = 6 , V k = 9 , V k = 12 , V k = 15 , V k = 18 , V k = 21 in amount of N = 2 w = 2 3 = 8 random numbers having length of 3 bits in the complete sequence. As a result, it turns out that tracks <U 0 , V j > = <U 0 , V K > form the initial plane L 0 .
Similar arguments apply to plane L 1 . If we refer again to the result of the previous program P040301, this example shows that plane L 1 is created using the congruential twisting tracks <U k = 0 , V k∈ [1,4,7,10,13,16,19,22] >. Plane L 2 is created by using shifts of the next twister <U k = 0 , V k∈ [2,5,8,11,14,17,20,23] >. Next is plane L 3 , but to create it we need to perform the congruential circular shift of sequence U 0 by one random step to the left, which leads to obtaining the new distribution of the random values U k = 3 along the axis U. Then, the next plane L 3 , which can be obtained with the help of tracks <U k = 3 , V k∈ [0,3,6,9,12,15,18,21] >.
A summary of all the points obtained leads us to the conclusion that number card (L) of the complete set of RPs is defined by multiplication of two things. The first is card(U CT ) = w·N = w·2 w , which is a quantity of the different options of the congruential twisting forms of sequence U; the second is card(V T ) = w, which is a quantity of the various twisters in sequence V including the congruential twister 0, i.e.,: card(L) = card(U CT ). card(V T ) = wN·w = w 2 N.

Conclusion
Analysis of the sources indicates that algorithms of the generators of uniform planes do not take into account the potential of the sequences having absolutely uniform distribution. Techniques of those generating algorithms do not guarantee the absolute uniformity of the complete random planes. To overcome this limitation, we proposed here the generators of the complete uniform sequences, which include unique twisting techniques described in our previous works. However, their direct application for the described task is hampered by the required properties of Descartes uniform planes. To satisfy this requirement, a new class nsDeonYuliStwist32D was constructed and now with its help it is possible to create the dynamic objects of the simplest twisters without using congruential arrays. Applying secondary indexing technique allows for getting a generator of Descartes twisting random planes, which ensures the completeness and uniqueness of all the random variables on a grid of the Descartes plane. The performed tests confirm the absolute uniform distribution of the generated random values on a plane. In addition, a variety of the initial twisting sequences allows getting a set of the twisting planes for each pair of the congruential constants. In perspective, the obtained results can be used in a large number of applied tasks, which use the spatial plane distributions.