Abstract
Unpredictable pseudo-random number generators (PRNGs) are presented based on dissociated components with only coincidental interaction. The first components involve pointers taken from series of floating point numbers (float streams) arising from arithmetic. The pointers are formed by isolating generalized digits sufficiently far from the most significant digits in the float streams and may be combined into multi-digit pointers. The pointers indicate draw locations from the second component which are entropy decks having one or more cards corresponding to the elements used to assemble random numbers. Like playing cards, decks are cut and riffle-shuffled based on rules using digits appearing in the simulations. The various ordering states of the cards provide entropy to the PRNGs. The dual nature of the PRNGs is novel since they can operate either entirely on pointer variability to fixed decks or on shuffling variability using fixed pointer locations. Each component, pointers and dynamic entropy, is dissociated from the other and independently shown to pass stringent statistical tests with the other held as fixed; a “gold standard” mode involves changing the coincidental interaction between these two strong emulators of randomness by either cutting or shuffling prior to each draw. Gold standard modes may be useful in cryptography and in assessing tests themselves. One PRNG contains
1. Introduction
The development of pseudo-random number generators (PRNGs) has advanced so that now several PRNGs generate integers on the interval [0,232–1] at rates exceeding 108 s−1 on common desktop computers through efficient programming and limited operation counts or bit manipulations, although often at the expense of experiencing predictability. Many modern and formerly popular PRNGs are included in the GNU Scientific Library (GSL). 1 Three such families which are fast and which perform well on tests for the appearance of randomness are the generalized phase shift register, 2 variants of the Mersenne Twister, 3 and the Tausworthe PRNGs. 4 Also within the GSL, the Randlux PRNGs 5 perform well on empirical tests, although with slower generation. The Dieharder project software used in this effort 6 includes the GSL PRNGs along with several others including the Advanced Encryption Standard (AES) PRNG. 7 Marsaglia 8 has given a review of PRNGs including his “multiply-with-carry” and KISS PRNGs, both of which perform well on empirical tests.
With hardware improvement, PRNGs are subjected to increased scrutiny for patterns observable at longer stream lengths. Evidence for this trend is apparent from empirical testing of the GSL PRNGs using Dieharder. Only the four aforementioned PRNGs out of sixty-two PRNGs included are not flagged by at least one of the well-functioning tests under default conditions. Presumably, PRNGs in the GSL once represented strong similarities to randomness under testing of streams considered to be long at the time of their development.
In comparison to the ability to emulate randomness, one might contend that generation rates are occasionally overemphasized, particularly since PRNG speeds rarely limit the overall speed of scientific computation as programming statements based on various physical laws are usually far more expensive. In addition to speed, PRNG selection may also be based on attributes such as unpredictability, period, equidistribution, and spectral characteristics.
The present effort presents a general class of PRNGs which should remain relevant through hardware advances by offering considerable levels of tunability. This tunability involves options including but not limited to choices in arithmetic and updates to constants, variations in mixing of pointer streams, and rates and types of transitions for the dissociated data. The use of dissociated data structures allows the performance of each component to be verified by testing under conditions holding the other as fixed. With each stream verified under empirical testing, the PRNGs described here present a coincidental interaction between two excellent sources of apparent randomness, introducing an element of “chance.”
Options for generation schemes exist which provide generation rates of the same order of magnitude as the fastest known predictable PRNGs and faster than the best cryptographic PRNG. A “gold standard” mode will also be described in which both dissociated data streams are updated on each call. With no correlation between the two streams other than through pure coincidence, the gold standard mode should be beneficial in testing the empirical tests which themselves may be suspect. The PRNGs presented here are unpredictable from observation of the output stream so that they might be useful in cryptography and games of chance. A basic overview of elements of these PRNGs will now be given.
2. Digit streams and entropy pool draws
The digits in a stream of pseudo-random numbers (PRNs) should be uniformly distributed and uncorrelated with all other digits. In support of this, the present PRNGs are assembled as digit combinations, each developed from an unbiased entropy source, meaning that the source holds an equal number of each of the digits and there is no preferred location for these digits within the source so that, over time, no location is any more or less likely to hold any given digit. Just as the outcomes of a roll of an unbiased die are equally probable, the entropy sources have an equal likelihood of being in any of their possible states.
The presentation here outlines a broad overview of similar PRNGs that can be developed with the common feature that they consist of two independent components brought together to output a random variable. Rather than presenting an outline of one specific algorithm, an overview of the steps which may be used to design any one of similar algorithms is given as follows:
Select a class of digits as a basis for the random variable, for example, octal, hexadecimal, or base-256.
Develop pointers to the digits: Select a range for each pointer based on the size of its target of candidate digits. Design a stream of computations to provide numbers as a source for the pointers. Isolate certain digits from numbers in the stream suitable to form pointers of appropriate range. Verify that these digits are uniformly distributed; modify computations or digit locations if not. Form pointers from digits or their combinations.
Develop a dynamic entropy source: Based on the number system to be used, assign a complete range of “place values” to multiple entropy vectors. Similar to cutting or shuffling playing cards, set up a scheme to transition this entropy through its possible states.
Program the draw of contributions from each entropy deck using the pointers developed.
Assemble the random number from the components drawn.
Figure 1 illustrates this operation. For simplicity, the figure illustrates a PRNG developed using a decimal system, although faster approaches will utilize other systems with bases only containing prime factors of two. The top box in Figure 1 shows a series of floating point numbers which may be taken as arising from simple arithmetic. While this arithmetic will be discussed later for the specific examples, generally, many types of successive operations which include conditional statements to modify coefficients on occasion and possibly rescale terms in the stream as needed will suffice. While the distributions of digits in arithmetic streams modified by conditional transitions are generally unknown, the suitability of any particular digit should be verified with digit histograms. Consistent with Benford’s “law,” it might be expected that the distributions of individual digits approach a uniform distribution with increasing distance from the leading digit, particularly when the floating point numbers involved span several orders of magnitude. However, this should be confirmed through numerical experimentation.

Illustration of process for assembling a random variable u from two streams of floating point numbers, showing determination of third significant figure using base-10 digits.
As indicated in Figure 1, any patterns which might appear in one of the streams may be mitigated by combination with a digit from another stream. For example, if the digit in the given upper stream position was slightly biased toward the current digit “6,” various combinations of this digit with others from the lower stream could largely mask this so that pointers on the interval [0,99] were nearly uniform. Figure 1 shows a pairing in one of many possible configurations, using the circled “8” in the second stream as the digit in the “ones” position and the digit “6” in the “tens” position. Other possibilities include reversal of the digits, different pairings, and so on, all of which can change on different calls.
The sets of pointers isolated from digits in this fashion can be used to point to a fixed source, meaning that the entropy vector to be discussed next is held fixed throughout all generation of PRNs. Under this operation, variability is only through the pointers themselves and testing will show that, taken by themselves, the isolated digits described above provide a very strong emulation of randomness.
The other component of the PRNGs shown in Figure 1 is one or more digit entropy pools containing the digits used to assemble either pseudo-random integers or floats. Similar to the definition of entropy S in statistical thermodynamics,
As indicated in Figure 1, these pools may show a redundancy of digits under the obvious restriction that each digit has equal representation in each pool so that the pools are never biased toward more frequent drawing of any given digit. Also as indicated in the figure, pointers from the float streams are used to “draw cards” from the entropy pools which are then combined into random numbers. The entropy pools or “decks” are transitioned similar to the “cutting” and “riffle shuffling” of playing cards such that any card may be in any position, completely independent of its value. As discussed previously, the pointers to the decks are designed to appear to be uniformly random over the draw locations. It will be shown that excellent results are obtained with occasional cutting or shuffling, relying on variability in the pointer streams.
As previously discussed, while the pointers can be set to point to fixed entropy pools to test the strength of the pointer streams, the pointers may also be taken as fixed, drawing from the same positions each time. The notion of fixed pointers here is used to imply that the PRNGs are compiled with the pointers hard-coded to some fixed value location, typically one-quarter of the way through the entropy vectors, which never changes. By fixing draw locations and relying only on cutting or shuffling of the entropy pools on each draw, one may test the apparent randomness of the cutting and shuffling scheme, and this case will also be shown to perform as well as any known PRNG. With both pointer variability and continual entropy state transitions vetted as passing stringent tests to detect any discernible patterns, gold standard modes of generation exist where there is only purely coincidental interaction between these two sources, which might prompt one to ask the question of how any patterns could arise. An attractive feature of the PRNGs to be presented is that users can easily increase shuffling frequency, ranging from the expense of the gold standard mode to rather rare shuffles simply to extend the period of these generators based on one’s needs in any given simulation.
All PRNGs described here and all data to be shown are completely repeatable since all starting point data are taken from a single unsigned integer seed. The choice to use a single seed was made for compatibility with testing software since the vast majority of PRNGs in the literature seem to use a single seed. However, limiting the various deterministic PRNGs to a small number of patterns arising from a relatively small number of starting configurations seems rather restrictive and the present PRNGs could be easily modified to include much more data. These data, in the form of a seed vector, could include information on both arithmetic constants and information for the entropy pools such as shuffling frequency and cutting location.
It is also mentioned that, if desired, the present PRNGs implemented in C are well-suited to operate using true sources of randomness. As an example, entropy transitions could be reprogrammed to run entirely on data from the system clock and one or more thermal sensors available in most computers. The computer thermal data as a function of time are affected by the random nature of weather and its effects on room temperatures, ultimately affecting processor temperatures. Obviously, operation in fully nondeterministic modes would have some limitations regarding lack of repeatability, but could be useful, for example, in various games of chance and in some Monte Carlo applications where repeatability is not of specific interest. In this fashion, the present PRNGs could provide some of the advantages sought in the true randomness of hardware generators while being much faster and unencumbered with concerns over possibilities of non-uniform distributions. This inclusion is only mentioned for possible future use and is not considered further herein.
Regardless of operation, the PRNGs here are practically unpredictable from the output stream. Such knowledge would require the identification of dozens of floating point numbers, the correct identification of an extremely large number of possibilities for shuffling combinations, all in conjunction with entropy pool states which may be as high as
2.1. Single-source float base-256 integer PRNG (SS4x256)
The first PRNG described provides integers on (0,232–1) to facilitate comparisons with PRNGs producing large unsigned integers using the Dieharder test suite. A floating point number is used for the pointers in conjunction with four 256-digit entropy decks in this PRNG, termed as the SS4x256 PRNG. Since all the new PRNGs have common features, this PRNG is described in the most detail beginning with a discussion of the pointer data source.
2.1.1. Pointers isolated from floating point streams
The C programming language facilitates digit isolation using an array of char pointers. The following short program demonstrates an example of the isolation of certain base-256 digits of 31.4039061899269498.
For machines with little-endian architecture, this simple program has the following output:
The PRNGs presented here will typically not use a full set of digits from any floating point number, so the preceding example is limited to only six base-256 digits. The constant 31 in the preceding program was chosen to demonstrate ordering of the remaining portion of the significand under the IEEE standard; the program output is unchanged when the constant is chosen as any whole number from 16 through 31. The present work was limited to little-endian architectures; a first call test for “endianness” could be added for portability. Alternatively, digits may be accessed through other means as described later in section 2.3.
The arithmetic in the SS4x256 PRNG involves seven additional floating numbers,
where the general use of braces such as those around
Constants
Constants
In the previous expressions, digits other than the most significant were obtained through nearly simultaneous “keyboard mashes.” In other words, the most significant digit, which includes placement of the decimal point, scales the recursive arithmetic, but the digits used in the PRNGs which are far from the leading significant figures are acceptable as keyboard mashes; the method should work well with any combination of numbers.
The next assignments give the pointer source,
The small constant in Equation (7) introduces variety into the least significant digits of
where id denotes the array of base-256 digits taken from
Finally, the static doubles may be modified depending on an arbitrary range,
As previously, many of the trailing digits in the preceding expressions were programmed by “keyboard mashes.” This scheme provides variety in the double

Variation in
Figure 3 shows base-256 digit histograms for the least and most significant digits used over 107 draws following a run-off of 9×107 draws, indicating a reasonable approximation to uniform randomness. Table 1 presents the statistical data in the histograms computed using the xmgrace plotting software. The measured standard deviation for the bin frequency counts is consistent with the expected binomial standard deviation of bin frequency of approximately 197.3. While verification of PRNGs requires stringent testing, a check of bin variances may be used to determine whether any given digit is sufficiently far from the leading figure to be useful. The pointers described here will be independently verified in section 6 with entropy pools held as fixed. A discussion of these entropy pools now follows.
Histogram data for four sets of 107 base-256 digits. Mean occurrences:

Base-256 digit histograms of
2.1.2. Dynamic digit entropy pools
Entropy pools serve both to mitigate possible patterns in the pointers and to extend the period. One may consider the entropy pools as an ensemble of digit cards, possibly containing multiple copies of each digit card, which are shuffled and cut, in virtual fashion similar to the mixing of playing cards prior to various card games. Other than the fact that the SS4x256 PRNG decks lack digit redundancy, a detailed discussion of the entropy pools can take this particular PRNG as a representative example.
The SS4x256 PRNG produces large unsigned integers which are represented as four-digit base-256 numbers. Its entropy pools are four decks, each containing 256 digits. The first deck
The entropy may be viewed as virtual decks of playing cards with face values and positions within each deck. As such, many elements of shuffling employed here likely have similarities to shuffling schemes used in video card games. Many options have been tested for transitioning, and they all seem to work equally well as long as they involve combinations of deck cuts at pseudo-random locations and riffle shuffles. Although results from an expensive verification mode will be presented in which cards are taken from fixed locations while continuously shuffling, the primary and faster mode of operation is to vary the selection locations while occasionally refreshing the decks. This section will give one specific example of an instruction set for shuffling used in the SS4x256, followed by some more general comments on shuffling.
The numerical results from testing for patterns to be presented later for the SS4x256 are based on the following strategy, designed to reorder the decks approximately once every sixteen draws. The configuration described here will only involve cutting of the decks. One integer,
so that
The trigger to cut the decks is then based on a conditional statement testing for the equivalence of
When cutting does occur, the locations for cuts are determined by the values of cards occupying a changing set of locations with bit shifting done where needed to place values in the range [0,255]. For the specific case of the SS4x256, the values of the deck cards themselves completely prescribe the cutting, once triggered. The cut locations,
Obviously, the preceding represents one of many possibilities which should be fully expected to work well. The SS4x256 also uses some conditional statements which occasionally will alter the cut locations when they are true.
For each value of the integer
While the particular mode of operation currently described bypasses riffle shuffles, shuffling is used in other modes and may be reinstated by changing a single line of code in the presently discussed PRNG. Since other modes, including a gold standard mode to be described later, will use shuffling, the snippet of C code used to shuffle four sets of entropy decks,
The cutting and shuffling parameters previously described are easily changed, typically with a line or two of code to increase or decrease frequency by either conditional placement of values within a larger range or by adding additional match conditions to reduce their frequency of occurrence. Numerical results will be presented later for three modes of operation: fixed or never shuffling, cutting the decks at pseudo-random locations as described above, and alternating pseudo-random cuts and riffle shuffles on each draw.
It is again noted that all of the cutting and shuffling schemes in conjunction with their triggers are completely repeatable here. However, if one requires an element of true randomness at the expense of repeatability, for example, as required in an online game of chance, the inputs for shuffling could easily be drawn from a small amount of sensor data, though this will be reserved for future effort.
As a final point, the entropy values and the assembly of their data to produce PRNs is now discussed. Since the Dieharder software operates on streams of unsigned integers from 0 through 232–1, it is noted that these integers are developed from values of the cards drawn from each of the four decks according to,
In the previous expression,
The SS4x256 is unpredictable from observation of its output, and its period is also unknown. Each of the 256 card entropy pools has
This description of the SS4x256 PRNG has presented the main details regarding the design of a number of similar PRNGs. The following sections will briefly highlight the small modifications required to develop two similar PRNGs, each offering different qualities.
2.2. Twin-source base-256 integer PRNG (TS4x65,536)
The next PRNG differs from the SS4x256 PRNG in two ways. First, two-digit streams are taken from two floating point sources and combined to form sets of two-digit base-256 pointers
The pointers in the TS4x65,536 PRNG are isolated from the floating point numbers using two integer arrays,
where the array numbers begin at 0 in the C programming language and where the pools
Each pool with a redundancy of 256 has
The four pools have
2.3. Twin-source base-256 float PRNG (TS7x256)
Inasmuch as Fortran remains in wide use for computations in physics and engineering due to its speed and simplicity, a final PRNG is presented here programmed in Fortran, set up to directly produce double-precision floating point numbers. Since pointers are not used in Fortran as commonly as they are in C, a different strategy is presented to isolate digits, which will be one of the main differences from the PRNGs previously presented. This PRNG draws base-256 numbers from two floating point sources, X1 and X2. The arithmetic is generally similar to that used for other PRNGs described previously. A difference is that the two floating point numbers are maintained on the interval [0,1] by taking their reciprocal if they exceed unity. In order to extract specific digits at a high level of speed, the two floating point numbers are assigned to four integers in order to use Fortran’s bit manipulation intrinsics. The following section of Fortran assigns the real number X1
Similar statements assign the second variable X2 to two other integers, I3 and I4. The choice to use
This process is described as follows. The leading parts of significands of X1 and X2 are mapped to the integers I1 and I3, respectively, while the least significant parts are mapped to the I2 and I4. Only the last eight bits of I1 and I3 are used; the leading significant figures of X1 and X2 are discarded, consistent with the expectation that digits become more nearly uniformly distributed with increasing distance from the most significant digit. The trailing bits in I2 and I4 are discarded so rounding concerns are eliminated. The next two data segments in I2 and I4 are retained. Finally, the first four bits in I2 and I4 are combined as previously discussed. Digit isolation of the previous expressions is through bit manipulation to create a seven-element pointer array I. The following Fortran statements provide the isolations and assignments,
where one is added in accordance with the Fortran array convention. The integer vector LCOL contains the elements 1 through 7 and is often shuffled so that the pointer values for each deck are not limited to a fixed position within the two floating point numbers.
The TS7x256 PRNG produces double-precision floating point numbers using seven entropy pools of floating point numbers. The pools have a dual array of integers from 1 through 256 which are involved in shuffling rather than the floating point numbers themselves. The seven entropy pools Q i contain elements formed from dividing each of the integers 0 through 255 by the following denominators on the first call to the PRNG as shown as follows:
The Q i are directly ready to be added since the division just described scales the given card to its appropriate “positions value” in the floating point number. In terms of the Q i , the PRN is determined through,
where HEX256F is the pseudo-random variable on [0,1) and the J arrays are the integer dual array used for shuffling the values of the floating point parts Q i since the shuffling of integers is notably faster than the shuffling of double-precision floating point numbers.
3. Generation rates
This section provides speed comparisons with other PRNGs. Two issues are considered in the comparisons. First, the present PRNGs offer various shuffling frequencies so that several rates are given. Second, the TS7x256 Fortran PRNG generates float streams in which the smallest non-zero float is
For speed benchmarks, testing was performed on a machine with Intel® Xeon® CPU E3-1230 3.30 GHz processors running Debian Linux 7. The compilers used were gcc and gfortran bundled for Debian. Table 2 gives rates of generation for several of the “good” PRNGs included in Dieharder. For this architecture, the table shows that strong, but predictable PRNGs generate at approximately 2 × 108 to 3 × 108 random numbers per second (rnps), that the leading encryption PRNG generates at approximately 5 × 107 rnps, and that efforts to produce high-quality random streams have produced PRNGs which produce slightly less than 107 rnps. The slower Randlux rates are an indication of the extent to which expert users may be willing to sacrifice speed for quality.
Rates of generation for PRNGs in Dieharder and GSL.
PRNG: pseudo-random number generator; GSL: GNU Scientific Library; AES: advanced encryption standard.
The rates of generation for the new PRNGs described here are shown in Table 3 including entries for different rates of entropy mixing. All of the PRNGs reported in Table 3 will be shown to perform as well as the best PRNG included in Dieharder, the AES PRNG. A comparison of the rates between Tables 2 and 3 shows that a number of the implementations compare well. The fastest mode for a PRNG generating long unsigned integers is the TS4x65,536 when it is triggered to shuffle on one of the 65,536 pointer possibilities, which is approximately 38% of the rate of the widely used and predictable Mersenne Twister.
Generation rates for new PRNGs based on unpredictable entropy transitions observed in 108 calls.
PRNG: pseudo-random number generator.
Cuts at random locations.
Alternating cuts and riffle shuffles on successive triggers.
Both a cut and riffle shuffle on each trigger.
At approximately 25% of the speed of the Mersenne Twister, the AES cryptographic PRNG gives indication of the sacrifice in generation rates which have been accepted as a compromise in return for an unpredictable stream suitable for encryption. Table 3 shows that the only PRNGs presented here which are not as fast as the AES PRNG are the two SS4x256 implementations in which the entropy decks change at a rate greater than or equal to approximately every sixteenth draw. As previously discussed, the two Fortran implementations of the TS7x256 effectively have a higher rate of data generation than the AES PRNG since they are generating a full “double” float as opposed to an unsigned integer.
The tables show that the two high shuffling variations of the SS4x256 are comparable with the Randlux family. The implementation which cuts the entropy pools approximately every sixteenth draw is nearly identical in speed to the Randlux389. The implementation of the SS4x256 applying either a cut or a riffle shuffle on every draw is approximately one-eighth of the speed of the ranlxd2 PRNG and should offer a purely coincidental stream which will be shown as a possible outlier in performance among all PRNGs on at least one test in section 6.
The present class of PRNGs was designed to be free of patterns as the primary objective and then revised to enhance speed. Their rates of generation are fast enough that they are competitive options since bottlenecks in computer simulation are rarely associated with sources of random numbers. In applications in which there is a need for an unpredictable source for any reason such as is necessary in games of chance or for encryption purposes, the present PRNGs are shown to offer a speed advantage over the AES PRNG.
4. Background on Dieharder
This section provides an overview of Dieharder (v. 3.31.1-4) used in testing along with empirical benchmarks from some well-known PRNGs. For reference, it is noted that Dieharder is also offered for use with the R package
9
although the implementation used here was to pipe random numbers directly into Dieharder using the standard output from C or a C wrapper around the Fortran generators. Dieharder offers more than a straightforward re-programming of Marsaglia’s
10
original Diehard suite. One of its key features is the ability to remove ambiguity over a single test result which may have a high or low p-value by allowing the user to repeat the tests and assess the distribution of p-values using the Kolmogorov–Smirnov (K–S) test on the resulting data. The default specification in Dieharder on many of the tests is 100 replications, which fails the vast majority of the PRNGs in the GSL. In addition, the software may be run using the “
In addition to these and other improvements to the original Diehard suite, Dieharder includes tests from the Statistical Test Suite (STS)
11
developed at the National Institute of Standards and Technology which were primarily developed to be sufficiently stringent to investigate the suitability of a given PRNG for cryptographic purposes. Finally, Dieharder also includes several tests developed and implemented by the Dieharder team which are discussed in the manual released with Dieharder Brown.
6
The option “
4.1. Performance of control PRNGs
Since only four PRNGs from the GSL pass the well-functioning tests along with variants of the KISS PRNG and the AES cryptographic PRNG, which the Dieharder manual describes as having “the strongest proof of randomness” the discussion of control PRNGs is limited. An investigation of their performance through Dieharder will lend appreciation to the stringent nature of the tests and to identify tests which seem to be flawed. In section 6, the gold standard mode of the SS4x256 PRNG will be used to assess the tests themselves.
Dieharder assigns a “WEAK” assessment when the p-value from the K–S tests is either less than 0.005 or greater than 0.995. Testing may flag stretches in very good PRNGs with low values as shown in Figure 4, representing an excerpt from the full test list at default values for the Mersenne Twister. The low p-values likely reflect a portion of the sequence where the Mersenne Twister may contain some apparent serial correlation.

Excerpt of Dieharder report (
For the
Portion of results for Dieharder reports on two control PRNGs using the
AES: advanced encryption standard.
Test fails other control PRNGs.
Test is biased low for other control PRNGs.
Summary of 75 tests excluded from Table 4 for control PRNGs: sts_serial (n-tup = 1, 2 and two runs each at 3 through 16), rgb_bitdist (n-tup = 1 through 12), and rgb_lagged_sum (n-tup = 0 through 32).
PRNG: pseudo-random number generator.
Arguably, the most attractive feature of Dieharder lies in its capability to run a large number of repetitions of the same test followed by a K–S test on the resulting data sets in order to unambiguously resolve an isolated low or high p-value. While this K–S test is an excellent summary by itself, it may also be attractive to examine histograms of the individual test results, either to elucidate the mode of failure or to gage the general level of uniformity in histograms which would be consistent with “passing.” Dieharder includes an option to generate histograms in text format.
Some of the original tests from Diehard used empirical results from sources thought to be random. While these tests worked well at the time of their development, the improvements in both hardware and software now show shortcomings in the original empirical distributions of test results. As an example, the Parking Lot Test shows a non-uniform distribution of p-values when tested by strong PRNGs such as the AES encryption PRNG. A histogram from conducting the Parking Lot Test with the

Text histogram from AES PRNG subjected to Parking Lot Test with
The histogram shows some indication of non-uniformity in the p-values and the K–S test returns a p-value of 0.00754409; this particular seed for testing was selected as being very near the 0.005 threshold to be considered to have “passed” by Dieharder. The same test was repeated with the

Text histogram from AES PRNG subjected to Parking Lot Test with
As shown, the bins are clearly non-uniform and the Dieharder assessment is “FAILED” with a p-value of 0.0. The unusual nature of the distribution, such as the low number of p-values falling between 0.4 and 0.5, is a likely indication that the empirical data used in assessing the test need to be improved. For reference, the original Diehard test would have only conducted the Parking Lot Test once and this non-uniformity would not have been noticeable.
While the level of acceptable bin variance in a uniform distribution may be directly assessed analytically, a visual depiction of the lower threshold is provided for reference. As an example, a histogram for the RGB Generalized Minimum Distance Test with n-tuple set to four and with the

Text histogram from AES PRNG subjected to the RGB Generalized Minimum Distance Test with n-tuple set to four and with the
As seen in the histogram, only one bin is slightly lower than the others, although only by the minimum resolution which could be shown in the text plot. For histograms with an expected number of 104 samples per bin, the example shows that no visible variation in bin height would be seen at the levels of resolution provided in the text plot for PRNGs considered to have “PASSED” a given test. While more variation in bin height would be considered acceptable on a limited number of tests, any test passed with the
5. Empirical tests for non-linear PRNGs
The performance of the new PRNGs will be assessed using the
Test results for the new PRNGs are either listed in Table 6 or summarized in Table 7. The entropy triggers used to produce the results in Tables 6 and 7 were a pseudo-random cut of all four decks on approximately every sixteenth draw for the SS4x256 PRNG, alternating pseudo-random cuts or riffle shuffles for each of the four decks approximately once every 65,536 draws for the TS4x65,536 PRNG, and both a pseudo-random cut and riffle shuffle approximately once every 256 draws for each of the seven decks in the TS7x256 PRNG. In addition, the TS7x256 PRNG shuffles a dual-integer vector for the floating point data, and this dual association was shuffled approximately six out of every 256 draws.
Portion of results for Dieharder reports the three new PRNGs presented using the
Test fails all control PRNGs.
Test is biased low for all control PRNGs.
Summary of tests with
PRNG: pseudo-random number generator; STS: statistical test suite; RGB: Robert G. Brown.
As seen in columns four and five of Table 6, the performance of the SS4x256 is strong on the well-functioning tests, even using 100 times the default level of p-samples. Only one test, the “dab_monobit2,” was assessed as “WEAK,” although this seems to be an acceptable, but low p-value. Rationale for the interpretation that the result happens to be an acceptable low p-value will be presented in more detail in section 6, where a modified form of the SS4x256 PRNG is used which never cuts or shuffles the entropy decks, giving a p-value of 0.61054454. Since the entropy cuts are decoupled from the pointer streams and the PRNG performs well in testing when only using shuffling with fixed pointers as will be shown in section 6, the low p-value in Table 6 is considered likely to be acceptable. Three of the serial correlation tests were removed from Table 6 for brevity and summarized in Table 7, showing that the p-values from testing at this high level are consistent with a uniform variable on (0,1) which would have an expected mean of 0.5 and an expected standard deviation of
For the TS4x65,536 PRNG, the sixth and seventh columns of Table 6 show an assessment of “PASS” assigned on the well-functioning tests with one exception. This PRNG can also be run in different modes and, in this case, when the entropy is held as fixed, the test shows,
This suggests that the low p-value is likely an acceptable outcome for the reason previously discussed. The results summarized in Table 7 are consistent with a uniform random variable.
Finally, the eighth and ninth columns of in Table 6 show that the TS7x256 PRNG also performed well on the well-functioning tests, with the exception of two “WEAK” assessments for the diehard_3dsphere and the rgb_minimum_distance, n-tup = 4 tests. An altered shuffling scheme was again used to check whether these low p-values are cause for concern. When the TS7x256 PRNG was run with entropy shuffling completely removed and the tests repeated with the same seed, the two tests in question return p-values as shown as follows:
Again, the resulting p-values are much higher without shuffling and the low p-value is likely to be an acceptable outcome. The results in Table 7 are consistent with uniform p-values.
6. Gold standard for PRNGs
The SS4x256 PRNG may be set to either cut or shuffle the entropy on every draw so that the pointers never point to entropy in the same state on successive draws. The SS4x256 PRNG may be tested in three modes: running only on the random pointers with the entropy held constant, running only on the shuffling scheme ignoring the pointers and drawing from fixed locations, and in a gold standard mode where the entropy is either cut or shuffled on every draw in conjunction with full use of the random pointers to the entropy. The latter case is termed as a gold standard. It will be shown that the two partially functioning modes show excellent results under empirical testing. Since there is no correlation whatsoever between the pointer values and the entropy states, the gold standard mode represents purely coincidental interaction between two excellent sources of apparent randomness.
Reports from each mode are combined in Table 8. The second and third columns in Table 8 correspond to drawing the cards from a fixed position, arbitrarily chosen as element 63 in the entropy decks. The strong results shown in the first two columns are only due to shuffling of the entropy. With a single low p-value, the SS4x256 PRNG operating only on the shuffling scores as well as the best PRNGs included in Dieharder and the GSL.
Test data on various modes of operation for the SS4x256 PRNG using
Test also fails control PRNGs.
Test is biased low for control PRNGs.
The fourth and fifth columns in Table 8 show the SS4x256 PRNG in normal operation of pointers to draw “cards” for the case in which the entropy decks are neither cut nor shuffled. The very strong performance shown in the fourth and fifth columns is only due to the appearance of randomness in the pointers taken from the arithmetic streams. With two high p-values, this mode is also similar in performance to the best-known PRNGs.
Finally, the sixth and seventh columns represent the gold standard mode in which the pointers as shown in the fourth and fifth columns are used to point to the fully shuffled data as shown in the second and third columns with the only exception that riffle shuffles and cuts are alternated on each successive draw since this mode is rather slow. As previously stated, there is no correlation whatsoever between the operations leading to the p-values in the second column and those leading to the p-values in fourth column. Any patterns would be a purely coincidental occurrence between these streams, each of which independently performs extremely well on the tests as shown in columns two through five in Table 8. The results of the gold standard mode can be used to confirm the shortcomings in the highlighted tests in Table 8 and may suggest that other tests such as the diehard_birthdays may be biased low.
Alternatively, the gold standard mode may also suggest that certain tests are functioning well in spite of the performance of some of the best PRNGs. As an example, the rgb_minimum_distance, (n-tup = 4) test gives consistently low results at the
Summary of tests excluded from Table 8 for various operational modes of the SS4x256 PRNG: sts_serial (n-tup = 1, 2 and two runs each at 3 through 16), rgb_bitdist (n-tup = 1 through 12), and rgb_lagged_sum (n-tup = 0 through 32).
7. Conclusion
Avoiding the difficulties associated with attempts to emulate randomness in simple algorithms, the present effort has highlighted an alternative strategy with three main features. First, the digits sufficiently far removed from the most significant in many streams of numbers arising from computations will pass tests based on similarity to apparent randomness. Second, entropy sources of digits may be shuffled in similar fashion to playing cards, and drawing from this process also passes tests seeking to identify patterns not representative of apparent randomness. Third, when the former digits are used to form pointers to the entropy pool locations of the latter digits, with no correlation between the two sets of digits, the interaction can only be purely coincidental. The claim is made that the coincidental interaction between two sources which each, independently, strongly emulate random behavior, is also an excellent model for apparently random behavior. Numerical test results were presented in support of these claims.
Expanding on the composition of a PRNG as two dissociated components, pointers and entropy sources, an attractive feature is that both the pointers and the dynamic entropy may each be verified in isolation. Each was shown to perform well in isolation under empirical testing at test levels similar to the best-known PRNGs. Thus, it was shown that the pointer generation schemes generally emulated uniform randomness over the draw locations when entropy shuffling was completely suppressed and that the entropy shuffling schemes also emulated uniform randomness in at least one of the draw positions when the pointers were set to point to the same draw location on every call. A gold standard mode of operation was presented in which both the pointers and the entropy decks were varied on every draw, giving purely coincidental interaction between the two excellent dissociated sources. The gold standard mode was used to assess the tests in Dieharder themselves and showed acceptable results in at least one test (rgb_minimum_distance, n-tup = 4), although this particular test is biased low for both the AES PRNG and the Mersenne Twister as well as for the gold standard mode itself. While the expense of gold standard modes may not be required in all applications, they should be able to provide strong similarities to randomness under the increased scrutiny made possible by future hardware improvements.
Using various shuffling rates, the new PRNGs perform at least as well as the AES PRNG on empirical tests, yet one integer PRNG was 49% faster than the AES PRNG and another PRNG produced 14-digit hexadecimal floats at rates comparable to the AES PRNG’s production of 8-digit hexadecimal integers. The fastest unpredictable integer PRNG is approximately 38% of the speed of the predictable Mersenne Twister. The PRNG designed to have the longest period has approximately 1.135 × 10629675 states in the entropy pool alone in addition to a number of floating point stream and parameter states.
Footnotes
Acknowledgements
The author acknowledges the thoroughness of the referees and is most appreciative of their work in suggesting improvements for the manuscript.
Funding
This research received no specific grant from any funding agency in the public, commercial, or not-for-profit sectors.
