METHOD OF SPECTRAL TESTS OF MULTIPLICATIVE CONGRUENTIAL RANDOM NUMBER GENERATORS

Information

  • Patent Application
  • 20150169290
  • Publication Number
    20150169290
  • Date Filed
    December 09, 2014
    9 years ago
  • Date Published
    June 18, 2015
    9 years ago
Abstract
The present invention discloses a new method of spectral tests, on multiplicative congruential generator (d,z,n) or (d,z) comprising an odd integer d for the modulus and an integer z coprime with d for the multiplier and an integer n coprime with d for the seed and generating the sequence of integers {nk:≡nzk−1 mod(d)|1≦nk≦d, k=1,2, . . . } consecutively and giving the output random number sequence by realizing the arithmetic {vk:=nk/d|0≦vk≦1, k=1,2, . . . }, the new method being based on the valuation of the geometrical form of the lattice GL(d,z), wherein L consecutive integer outputs of the generator (d,z,n) {Qk:=(nk,nk+1, . . . ,nk+L−1)|k=1,2, . . . } take their seats, through the computation of the largest distance λL(d,z) between parallel and neighboring lattice hyperplanes of GL(d,z) and evaluating ρL′(d,z):=λL(d,z)/ML(d) of the generator d,z) on the basis of new reference values ML(d):=L−1/2(L+1)(L−1)/(2L)d(L−1)/L, L≧3, and judging (d,z) to be passable if conditions 1<ρL′(d,z)1|3≦L≦6}.
Description
BACKGROUND OF THE INVENTION

1. Field of the Invention


This invention relates to new ways of spectral tests. The aim is to improve them innovatively in selecting and producing excellent multiplicative congruential generators for uniform and independent random numbers on computers. More specifically, the invention presents new spectral tests of the degree L for L≧3, and gives methods to have more reliable valuations, to salvage excellent generators so far ignored, and to provide sharper criteria in eliminating inadequate generators. We denote here (d,z,n) for the multiplicative congruential random number generator comprising a natural number d>0 for the modulus, an integer z coprime with d for the multiplier, and an integer n also coprime with d to define the initial random number. The generator (d,z,n), or (d,z) in brief, produces the sequence of integers {nk≡nzk−1 mod(d)|0<nk<d, k=1,2, . . . } as the solution of the recursive equivalence relations






n
1
:≡n mod(d), nk+1:≡znk mod(d), 0<nk<d, k=1,2, . . . .


On computers the output of the (d,z,n) generator is the real number vk:=nk/d with 0<vk<1 emitted consecutively for k=1,2, . . . as the sequence of uniform and independent random numbers.


2. Description of the Related Art


What we need first is the reflection on structures of existing spectral tests. The L-th degree spectral tests for the (d,z) generator aim to evaluate, in particular, the degree of independence of the emitted L consecutive random numbers. The method takes L-consecutive integer outputs {Qk:=(nk,nk+1, . . . ,nk+L−1)|k=1,2, . . . } from the generator (d,z), and regards them as points in the L-dimensional Euclidean space EL. The fundamental fact is that these points {Q1,Q2, . . . } are in a lattice GL(d,z) determined by d and z. Stated more clearly, the sequence of points of L-consecutive random numbers take their seats in lattice points of a lattice that is determined by d and z and to be denoted as GL(d,z). The method has little, not to say no, concern with said seat-taking processes by (d,z) outputs. It concentrates on the valuation of the distribution of seats prepared by the lattice GL(d,z) in EL, whether the configuration is adequate as seats for uniform and independent random numbers. The meaning of this statement will become clear by visual examples of lattices G2(d,z) in the Euclidean plane E2 given by the consecutive 2-tuples of (d,z) random numbers. See FIG. 1 for plots of points {Qk:=(nk,nk+1)|k=1,2, . . . } for one period, emitted by (d,z) generator with odd prime d and its primitive root z. Values of (d,z) are chosen small, so as for plots to be decipherable to our eyes. Points are in the square Cd issuing from the origin O with the length d for their edges; the outer frame drawn shows a square that is slightly larger. Plots at the start show neat arrays of emitted points close to the so-called triangular lattice formed by regular triangles. If consecutive 2-tuples of random numbers take seats in these neatly distributed positions in, hopefully, some randomly looking manner, we shall have little reasons to negate the statistical hypothesis that consecutive 2-tuples of random numbers appear uniformly with independence. On the contrary, we see at the end of FIG. 1 such distributions of lattice points that appear to be packed on a few distinct lines with large, conspicuous separation between them. If points of 2-tuples appear on this type of seats, we shall find strong direction-dependence of their distribution that will suggest us that consecutive random numbers or their pairs appear correlated with dubious independence. Spectral tests give a number ρ2(d,z)>1 as the quantitative valuation of these impressions to the (d,z) generator; see FIG. 1 with ρ=ρ2(d,z) noted for G2(d,z) lattices with the understanding that ρ closer to 1 from above is better.


BRIEF SUMMARY OF INVENTIONS

We describe new ideas of the present invention. We go back to the mathematics of lattice structures arising in consecutive L-tuples of (d,z) random numbers, starting from the simplest L=2 case. A consecutive 2-tuple Qk may conveniently be regarded as a position row vector, Qk:=(nzk−1,nzk)=nzk−1e1, e1:=(1,z). Integer coordinates of Qk are taken without the equivalence modulo d. The position vector of any point in the Euclidean plane E2 with its 2nd coordinate equivalent to that of Qk modulo d may be obtained by adding an integral multiple of the vector e2:=(0,d). Similarly, a point with its 1st coordinate equivalent modulo d to that of Qk is obtained by adding an integral multiple of the vector e1′:






e
1′:=(d,0)=de1−ze2.


Thus, points of 2-tuples generated by (d,z) together with their equivalents modulo d are contained in the set S of all integral linear combinations of vectors {e1,e2}, S:={c1e1+c2e2|c1,c2 are integers}. This S defines the lattice spanned by basis vectors {e1,e2}. Since S is determined by d and z, we denote the lattice as S=G2(d,z). Note first that G2(d,z) contains points with their coordinates that are not coprime with d. Therefore, 2-tuples emitted by the (d,z) generator take only a portion of lattice points of G2(d,z). Thus, all plots of FIG. 1 for cases of odd prime moduluses and primitive roots, show unanimously the absence of the origin O among plotted points.


Two general features of G2(d,z) are to be noted. The one is that basis vectors {e1,e2} span a parallelogram of area d by their determinant. This area is independent of the multiplier z. The other is that there are exactly d lattice points in the square Cd, with sides of length d. This is suggested by the fact that Cd has d2 for its area. We may more quantitatively argue that a lattice point c1e1+c2e2=(c1, zc1+dc2) has d possible values {0,1, . . . ,d−1} for the first integer coordinate c1 in Cd while the second coordinate zc1+dc2 in Cd fixes c2 without choice. The parallelogram spanned by {e1,e2} neatly fills Cd regarded as a 2-dimensional torus with period d in both coordinates. Once G2(d,z) is known to be a lattice with these two features, the geometry of E2 gives us significant structures without needing the information of z. We first note a general way to construct any set of basis vectors. Define a lattice line as a line including two distinct lattice points. In fact there exist infinitely many lattice points on a lattice line in E2. Observe a pair of parallel and neighboring lattice lines, and another pair of parallel lattice lines which are not parallel to the preceding pair. Involved 4 lattice lines intersect at 4 lattice points; each lattice line has 2 adjacent lattice points of intersection. Choose a vertex of the parallelogram as Q0′ and define vectors {e1′,e2′} by directed sides or edges of the parallelogram issuing from Q0′. If we let the parallelogram slide in all possible ways along lattice lines taken here, Q0′ itinerate all d lattice points, and the parallelogram fill the torus Cd of area d2 without overlap. Thus, vectors {e1′,e2′} form a set of basis vectors of the lattice G2(d,z). We call the noted parallelogram of area d as the unit cell after physicists. Two pairs of parallel neighboring lattice lines determine a set of basis vectors {e1′,e2′} of the lattice and the unit cell in this way. Conversely, any set {e1″,e2″} of basis vectors of the lattice manifestly gives two pairs of parallel and neighboring lattice lines via a parallelogram, and the unit cell given by them share the same area d. The correspondence is one-to-one. Consider now the distance h between any pair of parallel and neighboring lattice lines. By the noted correspondence we conclude that h is a height of a vertex of a unit cell parallelogram to a base line facing it. Conversely, any height of any vertex of a unit cell parallelogram to its facing base line is certainly the distance between a pair of parallel and neighboring lattice lines. These matters are unified more conveniently in terms of the triangle spanned by basis vectors {e1′,e2′} with the area d/2: The distance h between any set of parallel and neighboring lattice lines is a height of a vertex of a triangle spanned by a set of basis vectors with the area d/2, and vice versa.


We rephrase the overview for the amenability in higher dimensions. Suppose we are given a lattice. The operational definition of a set of lattice basis vectors is as follows. (1) Take a lattice line, (2) choose a lattice point Q0′ on it, (3) define a vector e1′ issuing from Q0′ and directed to L−1=1 of its neighboring lattice point on the lattice line, (4) take a parallel and neighboring lattice line to the first, (5) take any lattice point on it, (6) and finally define the vector e2′ from Q0′ to this point. The set {e1′,e2′} is a set of linearly independent basis vectors of the lattice by the preceding arguments. Obviously, any set of basis vectors may be constructed in this way. Call the triangle formed by any 2 basis vector {e1′,e2′} as a 2-simplex after the terminology of geometers. If the lattice is G2(d,z), then any 2-simplex formed by basis vectors has a constant area d/2. And the distance between any parallel neighboring lattice lines is the height of some vertex of a 2-simplex formed by some set of basis vectors. Conversely, any vertex of any 2-simplex formed by any set of basis vectors is the distance between some parallel lattice lines.


With the clear perspective obtained we again look at plots listed in FIG. 1. They show that 2-simplexes in these plots take diverse forms according to choices of (d,z) and to choices of basis vectors. Early plots in FIG. 1 show lattices that may readily be conceived as constructed with nearly regular triangles Since points are in fact discrete, observations need to be conducted with some smearing by small areas or by belts with small widths. On this premise these early entries of lattices in FIG. 1 seem to provide 2-tuples of (d,z) random numbers with seats that are nearly equidistantly located in the plane. These lattices will give little room for objections against the statistical hypothesis that random numbers are emitted uniformly and independently. In plots appearing near the end of FIG. 1 on the contrary, we see sparse distributions of a few densely crowded lattice lines, which are located parallel with conspicuously large distances. It will be difficult to insist that plots show the appearance of consecutive random numbers with statistical independence. If we are to choose a random number generator on our computers, we shall hesitate to adopt (d,z) showing this type of plots with its emitted 2-tuples.


To the feeling of ours noted, the 2nd degree spectral tests give quantitative valuations using the largest distance λ2(d,z) of the parallel neighboring lattice lines in G2(d,z).


(Corollary 1) Among all triangles with a constant area, the regular triangle realizes the smallest value for its largest height of vertices to the base lines facing them. In the setting that the constant area is d/2, the regular triangle or the regular 2-simplex realizes this smallest value of the largest height as Λ2(d)=2−1/231/4d1/2≈0.93060d1/2.


(Proof) We use the reduction to absurdity, expecting applications to higher dimensions. Assume that the smallest of the largest height is realized by a triangle that is not regular. Then the dichotomy is the existence of two shortest edges or one. If two shortest edges exist, we take one of them as the base, and let the vertex facing it move parallel to the base without changing the area of the triangle and the height of the vertex. There is a direction to which the other shortest edge is elongated, so that a small movement of the vertex realizes a triangle of the same area with only one shortest edge to which the height of the facing vertex retains the smallest value of the largest height among all possible shapes. We therefore need to consider only the case k=1. Then we may take a different edge as the base, and let the vertex facing it be moved parallel to the new base. Then the shortest edge may be elongated slightly but without losing the shortest position, thanks to the continuity of real numbers. This implies that the shortest value of the largest height may be diminished, contradicting the assumption that the original length is the smallest of realizable values among any shape of the triangle. The absurdity proves that the shape of the triangle must be regular. Drawing the regular triangle of the area d/2, we readily obtain noted shortest value Λ2(d).


The lattice in E2 with basis vectors {e1,e2} forming a regular triangle, or a regular 2-simplex, is called a triangular lattice as said. The regular 2-simplex is formed by 2 linearly independent vectors, and is characterized by the fact that all 3 vertices, say origin and two points with noted two position vectors, give 3 pairs that are all at an equal distance. This is in a sense the ideal geometrical configuration of lattice points in which consecutive 2-tuples of points formed by uniform and independent random numbers take their seats. Let again λ2(d,z) be the largest distance of parallel neighboring lattice lines in the lattice G2(d,z). Corollary 1 proves the inequality λ2(d,z)>Λ2(d); equality never holds, because basis vectors {e1,e2} of the lattice G2(d,z) have necessarily integer coordinates and can never realize the global minima provided by regular triangles needing irrational coordinates. The closeness of the ratio





ρ2(d,z):=λ2(d,z)/Λ2(d)>1


to 1 gives a good measure how close is the lattice G2(d,z) to the ideal triangular lattice, and to what degree (d,z) generator emits consecutive 2-tuples with the least reasons to deny the statistical hypothesis of uniformity and independence. The fundamental idea of the 2nd degree spectral tests is to utilize this fact. We compute ρ2(d,z)>1 for every candidate multiplier z under the modulus d, and selects z that realizes 1<ρ2(d,z)<R2 for a pre-assigned criterion R2>1. Pioneers Fishman and Moore (1986) chose R2=1.25, and this criterion has been proved versatile and useful in all later applications. FIG. 1 shows ρ=ρ2(d,z) for each depicted generator (d,z). A glance of plots will readily convince us that the criterion ρ<1.25 is highly reasonable. Sorry to say, the circumstance is not so transparent with consecutive L-tuples of random numbers for L≧3.

    • Fishman and Moore (1986)/G. S. Fishman and L. R. Moore: An exhaustive analysis of multiplicative congruential random number generator with modulus 231−1, SIAM Journal on Scientific and Statistical. Computing Vol. 7 (1986), pp. 24-45.


We take L≧2, and consider generally consecutive L-tuples of random numbers emitted from the (d,z,n) generator. We again denote Cd for the hypercube issuing from the origin O of the L-dimensional Euclidean space E1 with edges of length d. Points





{QL:=(nzk−1,nzk, . . . ,nzk+L−2)=nzk−1(1,z,z2, . . . ,zL−1)|k=1,2, . . . }


in EL represent the consecutive L-tuples emitted from the (d,z,n) generator, and all of their equivalents modulo d are readily seen to be expressed by suitable integral linear combinations of the following vectors,








e
1

:=

(

1
,
z
,

z
2

,





,

z

L
-
1



)


,






e
2

:=

(

0
,
d
,
0
,





,
0

)


,






e
3

:=

(

0
,
0
,
d
,





,
0

)


,












e
L

:=


(

0
,
0
,
0
,





,
d

)

.





These vectors are linearly independent and span the parallelepiped of volume dL−1 by their determinant. Let GL(d,z) denote the lattice in EL spanned by these L basis vectors. The volume dL of the hypercube Cd at once suggests that this lattice will have d lattice points in Cd. The fact may be ascertained as follows. The vector c1e1+c2e2+ . . . +cLeL with integer coefficients c1,c2, . . . ,cL has the first coordinate c1, which can have d different values {0,1, . . . ,d−1} in Cd. Once c1 is fixed as one of these, the 2nd coordinate c1z+c2d chooses a unique integer c2 in Cd; the matter is the same with c3, . . . ,cL. Hence there are d lattice points of GL(d,z) in Cd.


Just as the triangle or the 2-simplex formed by linearly independent 2 basis vectors in L=2 dimension, the above noted linearly independent L basis vectors {e1,e2, . . . ,eL} of GL(d,z) form an L-dimensional simplex, or L-simplex. In analogy to 2-dimensional case, think about a general set {e1′,e2′, . . . ,eL′} of basis vectors for this GL(d,z) given, and call the parallelepiped formed by them the unit cell. The lattice line corresponds to the lattice hyperplane of L−1 dimension that contains L−1 lattice points {P1,P2, . . . ,PL-1} whose position vectors, say from a lattice point P0, are linearly independent. We may say after geometers that this lattice hyperplane is determined by the inclusion of L affinely independent points {P0,P1,P2, . . . ,PL-1}. An operational definition of a general set of basis vectors {e1′,e2′, . . . ,eL′} is stated readily. We take (1) a pair of parallel and neighboring lattice hyperplanes, take (2) any set of affinely independent lattice points {P0′,P1′, . . . ,PL-1′} on one of the lattice hyperplane with the restriction that {P1′, . . . ,PL-1′} are the nearest lattice points from P0′ on the line connecting them, take (3) any lattice point PL′ on the other parallel lattice hyperplane and define (4) vectors {e1′,e2′, . . . ,eL′} as position vectors of {P1′,P2′, . . . ,PL′} from the reference point P0′. In translations along each of these vectors, the parallelepiped or the unit cell formed by {e1′,e2′, . . . ,eL′} fills the hypercube Cd of hypervolume dL which is taken as a torus with the period d in coordinates, and the reference lattice point P0′ itinerates all of d lattice points in Cd. The unit cell has the hypervolume dL−1 which is the determinant of vectors {e1′,e2′, . . . ,eL′}. These are basis vectors of the lattice GL(d,z). They form an L-simplex with L vertices {P0′,P1′, . . . ,PL-1′}. In this simplex each vertex faces an L−1 dimensional lattice hyperplane that is determined by the inclusion of other L−1 vertices. Any L-simplex formed by L linearly independent vectors {e1′,e2′, . . . ,eL′} with the determinantal volume dL−1 is well-known to have V=dL−1/L! for its hypervolume; this is because V is linear in respective vectors, since the position vector ej′+ej″ of a vertex gives a height that is the sum of heights of respective vectors from the hyperplane facing the vertex; and L-simplexes formed by unit vectors along coordinate axes have 1/L! as its hypervolume. Thus, in the L-simplex formed by {e1′,e2′, . . . ,eL′} the length h of the perpendicular line from a vertex to the facing hyperplane with the hyperarea S gives the hypervolume hS/L=dL−1/L! as a cone. What matters here is the fact that the hypervolume of the L-simplex is the same for any choice of basis vectors, and in any such L-simplex its arbitrary vertex with the height h to the facing hyperplane of area S gives the constant product hS. Therefore, the largest distance between neighboring parallel lattice hyperplanes of dimension L−1 is given by the height of the vertex from the facing lattice hyperplane with the smallest hyperarea in some L-simplex. The setting is all the same in this L-dimension as in the dimension L=2. However, the kernel of the matter attains a different feature summarized below.


(Corollary 2) Let L≧3 be a given dimension, and consider L-simplexes which are issuing from the origin O of EL and defined by O and L points with L linearly independent position vectors from O. Define the regular simplex in EL by the restriction that its (L+1)L/2 pairs of vertices have one and the same length. Under the restriction that L-simplexes have the same hypervolume in the vicinity of a regular form, the regular L-simplex gives the local minimum of the largest height of the vertex to the base hyperplane facing it.


(Proof) Again we use the reduction to absurdity. Consider a neighborhood of the configuration of L-simplexes of a constant hypervolume around a regular form, viz. all (L+1)L/2 edges have their lengths in a small vicinity of the all-equal case. Note that heights of any vertex from the facing base hyperplane vary continuously together with areas of base hyperplanes. Assume that an L-simplex does not have the regular form, but its k vertices face base hyperplanes with the smallest hyperarea and have the same height h which is the smallest among all possible L-simplex configurations in this local range close to the regular form. If the base hyperplane with the smallest area is unique with k=1, then a slight deformation of the L-simplex (e.g. by letting a vertex facing other base hyperplane more slightly to a direction parallel to its base hyperplane) will keep the smallest-area base hyperplane to the smallest position but with a slightly increased area and a slightly diminished height h of the facing vertex. This contradicts the assumption that h is locally the smallest among all possible forms of the L-simplex with a single smallest area base hyperplane. Therefore, the case k=1 does not arise. The remaining possibility is that k base hyperplanes with 2≦k≦L−1 are the smallest. But then we may take one of them as the base hyperplane and let the opposing vertex move in parallel to the base hyperplane. Then, the area of this particular hyperplane and the height h of the opposing vertex remain the same, but some other base hyperplane (which is necessarily not parallel to the fixed base hyperplane) may be enlarged in its area by a suitable choice of the movement of the vertex. This diminishes the number k of the smallest area base hyperplanes. The procedure may be repeated to reduce k to k=1, which has been proven contradictory. Thus the starting hypothesis is false, and the assertion holds true.


Let points {P1,P2, . . . ,PL} in the Euclidean space EL have linearly independent position vectors from a reference point P0, or {P0,P1,P2, . . . ,PL} be affinely independent. A regular L-simplex with vertices {P0,P1,P2, . . . ,PL} is defined by the condition that any pairs of points among them, which exist (L+1)L/2 in their total number, give one and the same Euclidean distance. In our present problem L linearly independent lattice basis vectors {e1,e2, . . . ,eL} may be used to define a regular L-simplex by the noted definition, say with the origin O for P0. Regarded from the standpoint of spectral tests, the regular L-simplex is manifestly the ideal configuration as building blocks of the lattice GL(d,z). Forgetting that the lattice is composed by L-tuples of outputs from the (d,z) generator, we start by assuming that a regular L-simplex is spanned by the following form of basis vectors:








e
1


:=

(

b
,
a
,
a
,





,
a
,
a

)


,






e
2


:=

(

a
,
b
,
a
,





,
a
,
a

)


,






e
3


:=

(

a
,
a
,
b
,





,
a
,
a

)


,













e

L
-
1



:=

(

a
,
a
,
a
,





,
b
,
a

)


,






e
L


:=


(

a
,
a
,
a
,





,
a
,
b

)

.






Constants a and b are to be determined by the following two restrictions:

    • (1) These vectors span by their determinant the volume dL−1.
    • (2) They form a regular L-simplex.


      By assumed forms, vectors have one and the same ∥ej′∥2=(L−1)a2+b2 as Euclidean length for any j. Also, the inner product for i≠j, (ei′,ej′)=(L−2)a2+2ab, does not depend on i and j, so that any pair of vectors form an equal angle between them. The unit vector






e
0′:=(1,1,1, . . . ,1,1)/L1/2


gives the inner product (e0′, ej′)={(L−1)a+b}/L1/2=:h for any 1≦j≦L; this h is the distance or height of the origin O to the centroid of the base hyperplane that contains points with position vectors {e1′,e2′, . . . ,eL′}. Therefore, the height ML(d) of any vertex to its facing base hyperplane in the regular L-simplex formed by these basis vectors with the determinant giving the volume dL−1 to the unit cell, is given by






M
L(d)=h={(L−1)a+b}/L1/2=s/L1/2, s:=(L−1)a+b,


which will be obtained after a and h are determined by (1) and (2). We first compute the determinant volume,












b





a





a











a





a










a





b





a











a





a










a





a





b











a





a



























a





a





a











a





b






=







s





s





s











s





s










a





b





a











a





a










a





a





b











a





a



























a





a





a











a





b






=


d

L
-
1


.






Subtracting the 1st column from all of other columns, we obtain dL−1=s(b−a)L−1. Next we consider the restriction (2). Using ∥e1′∥2=∥ej′−ek′∥2 for 1≦i,j,k≦L with j≠k, we obtain





(L−1)a2+b2=2(b−a)2.


Putting b=ξa, we have that ξ satisfies ξ2+(L−1)=2(ξ−1)2, or ξ=2±(L+1)1/2. some algebras on any of these solutions give the same result for the regular L-simplex in any dimension L≧2,






M
L(d)=L−1/2(L+1)(L−1)/(2L)d(L−1)/L.


This solves the problem. The explicit forms of ML(d) are as follows for 2≦L≦6:






M
2(d):=2−1/231/4d1/2≈0.93060d1/2,






M
3(d):=3−1/222/3d2/3≈0.91649d2/3,






M
4(d):=2−153/8d3/4≈0.91429d3/4,






M
5(d):=5−1/262/5d4/5≈0.91575d4/5,






M
6(d):=6−1/275/12d5/6≈0.91844d5/6.


Fishman and Moore (1986) quoted the geometry of numbers for the minimum ΛL(d) of the largest distance λL(d,z) of parallel and neighboring lattice hyperplanes in the L-dimensional lattice GL(d,z), and conducted their epoch making exhaustive spectral tests on primitive roots of the prime modulus d=231−1. Values of {ΛL(d)|2≦L≦6} in their Eq. (15) are as follows:





Λ2(d)=M2(d)=2−1/231/4d1/2≈0.93060d1/2,





Λ3(d)=2−1/6d2/3≈0.80909d2/3,





Λ4(d)=2−1/4d3/4≈0.84090d3/4,





Λ5(d)=2−3/10d4/5≈0.81225d4/5,





Λ6(d)=2−1/231/12d5/6≈0.77490d5/6.


These are smaller than ML(d) for L≧3. In short, Fishman and Moore performed spectral tests taking the global minima of largest distances for neighboring parallel lattice hyperplanes as the values to be realized by (d,z) generators. The present inventors rather think that the form of regular L simplex is the ideal to be realized by the lattice GL(d,z), and spectral tests should prefer the local minima {ML(d)|2≦L≦6} as reference values. This necessitates the introduction of a new set of valuations different from {ρL(d,z)|L≧3} of Fishman and Moore (1986),





ρL′(d,z):=λL(d,z)/ML(d)<ρL(d,z)=λL(d,z)/ΛL(d), L≧3,


as adequate indicators of the performance of (d,z) generator. Since ML(d) is not the global minimum, some lattices may give values ρL′(d,z)≦1. If ρL′(d,z)≦1 occurs, it implies that the lattice GL(d,z) has a configuration that is out of the so-called local basin of the minimum, or is not in the vicinity of the regular L-simplex in its geometrical configuration. It will thus be adequate to judge (d,z) to be passable only if 1<ρL′(d,z)<RL is the case for a pre-assigned RL, and to reject those (d,z) with ρL′(d,z)≦1, even if ρL′(d,z) is close to 1 from below.







DETAILED DESCRIPTION OF INVENTIONS

We have discussed that {ML(d)|2≦L≦6} are the standard reference values to be used in higher degree spectral tests. The technological task is to specify procedures needed to realize the tests explicitly. Examples will show the points clearly. Fishman and Moore (1986) gave 5 excellent primitive root multipliers in their Table 2 for the prime modulus d=231−1. We quote them in List 2A to List 2E in the present FIG. 2. A similar figure was given in our preceding patent applications, I27665HIR, OUS27668HIR, OEP27669HIR and ORU27670HIR, noting 2nd degree tests of (d,z2), (d,z3), . . . , (d,z6). The row labeled a) reproduces the row S1 in Fishman and Moore. The row labeled 1a) is the inverse of numbers in the row a), and corresponds to the present ρL(d,z):=λL(d,z)/ΛL(d). The same quantities are re-calculated by inventors in the row b). Numbers in the row labeled ML(d) show ρL′(d,z):=λL(d,z)/ML(d) for L≧3. These may also be confirmed by conversion from the row c). A special mention will be necessary on List 2C for the primitive root multiplier z=1226874159. As reported already, the valuation of (d,z2) in the row c) is bad; this multiplier is inadequate. The row of ML(d) further contains ρ6′(d,z)=0.99917993<1, implying that the lattice G6(d,z) is out of the local basin around the regular 6-simplex. Though the number itself is very close to 1 from below, this primitive root multiplier should be discarded as unqualified also in this 6-th degree test, reinforcing the conclusion of the 2nd degree spectral test of (d,z2).


We thus conclude that the new spectral tests based on {ML(d)|L≧3} should be used as a sharper method to pick out excellent (d,z) generators correctly. They are also needed to salvage excellent multipliers, which have been discarded in reference to {ΛL(d)|L≧3} as not passable, but might have in fact been passable in their reference to larger {ML(d)|L≧3}. There exist, however, due cares with which new tests based on {ML(d)|L≧3} should be conducted. In order to clarify the point, we go back to the method of computing the largest distance λL(d,z) between parallel neighboring lattice hyperplanes from d and z. The method relies on the use of vectors in a lattice GL*(d,z) dual to GL(d,z). This dual lattice GL*(d,z) is defined by the set {f1,f2, . . . ,fL} of basis vectors,








f
1

:=

(

d
,
0
,
0
,

,
0

)


,






f
2

:=

(


-
z

,
1
,
0
,

,
0

)


,






f
3

:=

(


-

z
2


,
0
,
1
,





,
0

)


,












f
L

:=


(


-

z

L
-
1



,
0
,
0
,





,
1

)

.





These are manifestly linearly independent, and have inner products





(ej,fk)=jk, 1≦j,k≦L.


Let matrices E, F be defined by vectors {e1,e2, . . . ,eL} and {f1,f2, . . . ,fL} as row vectors, respectively. The noted inner products are the relation of the matrix product, EtF=dI, with tF for the transposed matrix of F and I for the L×L unit matrix. Thus tF is determined as tF=dE−1 uniquely. There holds the following.


(Corollary 3) Dual lattice basis vectors {f1,f2, . . . ,fL} have integer coordinates, and the shortest non-zero vector has the Euclidean length not less than 1. Let umin be the shortest non-zero vector of the dual lattice. There holds the following for the largest distance λL(d,z) between L−1 dimensional parallel and neighboring lattice hyperplanes of the lattice GL(d,z):





λL(d,z)=d/∥umin∥,


with the Euclidean length ∥umin∥ of umin. (End of Corollary 3)


The proof of this statement is plain but takes some length. Please consult Nakazawa and Nakazawa (2012) for the unabridged proof. This corollary enables us to convert works of L-th degree spectral tests to the search of shortest vectors in GL*(d,z). The search is performed most conveniently in terms of Cartesian coordinates.


(Corollary 4) Let u be a vector with Cartesian integer coordinates (u1,u2, . . . ,uL). A necessary and sufficient condition for u to be in the dual lattice GL*(d,z) is the following:






u
1
+zu
2
+z
2
u
3
+ . . . +z
L−1
u
L≡0 mod(d).


(Proof) If the vector u is in GL*(d,z), then it is a linear combination of basis vectors {f1,f2, . . . fL} with integer coefficients c1,c2, . . . ,cL, and has Cartesian coordinates






u=(u1,u2, . . . ,uL)=c1f1+c2f2+ . . . +cLfL=(c1d−c2z−c3 z2− . . . −cL zL−1, c2, c3, . . . , cL).


This proves u1+zu2+z2u3+ . . . +zL−1uL=c1d≡0 mod(d). The relation is thus necessary. Conversely, if u1+zu2+z2u3+ . . . +zL−1uL≡0 mod(d) is true, there is an integer c that gives u1+zu2+z2u3+ . . . +zL−1uL=cd. We have u1=cd−u2z−u3 z2− . . . −uLzL−1 and






u=(u1,u2, . . . ,uL)=cf1+u2f2+u3f3+ . . . +uLfL.


Therefore, the vector u is in GL*(d,z), and the condition is sufficient.


It is significant to grasp that global minima {ΛL(d)|L≧2} used in Fishman and Moore (1986) retain their significant roles in the search of the shortest vector umin of GL*(d,z), because they stipulate λL(d,z)=d/∥umin∥>ΛL(d), or ∥umin∥<d/ΛL(d) to hold. Thus, we may summarize procedures of the L-th degree spectral test as follows.


(Corollary 5) Let L≧2 be given. The valuation ρL′(d,z):=λL(d,z)/ML(d) of the L-th degree spectral test of a (d,z) generator is obtained by the following steps.


(1) Obtain the vector umin of the dual lattice GL*(d,z) by sweeping over every vector u with Cartesian coordinates u=(u1,u2, . . . ,uL) satisfying





u∥2=(u1)2+(u2)22+ . . . +(uL)2<d2/{ΛL(d)}2, u1+zu2+z2u3+ . . . +zL−1uL≡0 mod(d),


and finding the one with the smallest ∥u∥.


(2) Compute λL(d,z)=d/∥umin∥.


(3) Compute the valuation ρL′(d,z):=λL(d,z)/ML(d).


(4) If 1<ρL′(d,z)<RL holds true with a pre-assigned level RL>1, then adopt (d,z) as passable.

    • Nakazawa and Nakazawa (2012)/N. Nakazawa and H. Nakazawa: Multiplicative congruential generators with moduluses formed by two odd-prime factors for uniform and independent random numbers II. Structures of spectral tests, uploaded (Oct. 13, 2012) in the URL http:www10.plala.or.jp/h-nkzw/.


After the preceding patent application of the present inventors, the greatest urgency in spectral tests exists in the incorporation of 2nd tests of (d,z2), (d,z3), . . . . The meaning of ideal values {ML(d)=L−1/2(L+1)(L−1)/(2L)d(L−1)/L|L≧3}, as heights of vertices of regular L-simplexes to facing L−1 dimensional lattice hyperplanes, then entitles these new ideal values with outstanding positions to be chosen as reference levels in higher degree spectral tests, together with the level M2(d)=Λ2(d) so far used. Inventors feel that {RL=1.25|2≦L≦6} might be a judicious choice in deciding the multiplier z to be passable, but this may depend on the number of passers. Can spectral tests be improved further? The question still remains open to be investigated. However, one certain moral of all these story is that we can never rely on our intuition or guesses in random number problems. Everything should be tested before use. We think that we are on the right track at present, but this might require some further tests for reinforcement of for confirmation. Contributions from people all around the world are wished for.


BRIEF EXPLANATIONS OF FIGURES

(FIGS. 1A and 1B) Typical plots of points formed by consecutive 2-tuples of random numbers emitted from the multiplicative congruential generator (d,z); depicted distributions correspond to the valuation ρ:=ρ2(d,z) around 1.05, 1.10, . . . ; squares drawn are taken slightly larger than the square Cd, and (d,z) may be read from figure captions.


(FIG. 2) Performances of top 5 multipliers of Fishman and Moore (1986) shown in their p. 37 as Table 2; the row a) is for the values shown in their paper as S1, the row 1a) shows the inverse of values of a) and agrees with the present ρL(d,z), the row b) is the calculation of ρL(d,z) by the present inventors, the row titled ML(d) shows the valuation ρL′(d,z) based on regular L-simplex values, and the remaining row c) shows ρ2(d,zj) for j=2,3, . . . ,6.

Claims
  • 1. A method of spectral tests on a multiplicative congruential generator (d,z,n) or (d,z) comprising an odd integer d for a modulus, an integer z coprime with d for a multiplier, and an integer n coprime with d for a seed, wherein the method comprises: generating a sequence of integers {nk:≡nzk−1 mod(d)|1≦nk≦d, k=1,2, . . . } consecutively;providing an output random number sequence by realizing the arithmetic {vk:=nk/d|0≦vk≦1, k=1,2, . . . };performing a valuation of a geometrical form of a lattice GL(d,z), wherein L consecutive integer outputs of the generator (d,z,n) {Qk:=(nk,nk+1, . . . ,nk+L−1)|k=1,2, . . . } take their seats, through the computation of a largest distance λL(d,z) between parallel and neighboring lattice hyperplanes of GL(d,z);evaluating ρL′(d,z):=λL(d,z)/ML(d) of the generator (d,z) on the basis of new reference values ML(d):=L−1/2(L+1)(L−1)/(2L)d(L−1)/L, L≧3;
Priority Claims (1)
Number Date Country Kind
2013-273814 Dec 2013 JP national