The Runs Up-and-Down Performance of Tausworthe Pseudo-Random Number Generators

Any Tausworthe generator based upon a primit ive trinomial over GF(2), xp + xq + 1, can be represented as a simple linear recurrence in GF(2P). For a generator producing a sequence of p-bit pseudo-random numbers, (p, 2p 1) = 1, which is guaranteed by Tausworthe's theory to be 1-distributed, the recurrence may reveal combinatorial relationships implying a poor runs up-and-down performance. This occurs when q is small, too near p/2 , or nearly equal to p. E lementary but tedious combinatorics then enable the frequencies of runs of given length, ei ther up or down, to be predicted quant i ta t ively . Empirical studies strikingly confirm these predictions. A generator p roduc ing / -b i t numbers, (1, 2p 1) = 1, according to Tausworthe 's theory, yields a sequence of m-tuples uniformly distr ibuted in m = [p/l] dimensions. We, however, additionally require that (m, 2 p 1) = 1. If m > 4, a simple argument shows tha t satisfactory runs up-and-down behavior is to be expected for runs of length not exceeding m 3. Empirical evidence confirms this expectation. Satisfactory performance in an m-dimensional simulation also reqi.lires sat isfactory stat ist ical properties along each dimension, i.e. it needs, among other things, good runs up-and-down performance for the subsequence obtained by taking every ruth number generated. Combinatorial argmnents similar to those used for the p-bit generators can be applied to this subsequence and, for the defective generators studied, lead to quant i ta t ive predictions of the frequencies of runs of any length. These predictions too • are in remarkable accord with empirical studies. A combinatorial argument shows that this problem can be overcome as m-dimensional uniformity of dis t r ibut ion can be imposed on the subsequence along dimensions by set t ing 1 = q. A recommended generator is based upon ei ther x p + xq ~ 1 or xp -{xp-~ ~ 1, q < p/2, m = [p/q], (qm,.2, 1) = 1, and is designed to produce a sequence of q-bit numbers. I t has predictably good run properties, provided neither q nor m is too small. Empirical studies confirm greatly improved run properties for such a generator. KEY W O R D S A N D P H R A S E S : pseudo-random numbers, random number generators, Tausworthe generators, pseudo-noise sequences, random number analysis, s tat is t ical tests for randomness, runs up and down, theory of runs, Galois fields, GF(2), GF(2"), polynomial elements, primit ive marks, primit ive trinomials, finite fields, combinatorics, combinatorial analysis, decimation, linear recurrences CR CATEGORIES : 5 . 5 , 5 . 39 1. I n t r o d u c t i o n As r e c e n t l y p o i n t e d o u t b y W h i t t l e s e y [11, t h e d o u b t s cas t b y 5 I a r s a g l i a [2] on conven t iona l m u l t i p l i c a t i v e c o n g r u e n t i a l g e n e r a t o r s p r o m o t e T a u s w o r t h e ' s [3] l i n e a r r ecur rence m o d (2) g e n e r a t o r s to p r i de of p l ace in t h e field of p s e u d o r a n d o m n u m b e r g e n e r a t i o n . T h e a d v a n t a g e of T a u s w o r t h e ' s a p p r o a c h lies in t h e f ac t t h a t , w i t h i n s t a t e d b u t not a t all e x a c t i n g l i m i t a t i o n s , t h e des i r ab l e s t a t i s t i c a l p r o p e r t i e s of l ack of a u t o corre la t ion , possess ion of t h e c o r r e c t m e a n a n d v a r i a n c e , a n d u n i f o r m i t y of d i s t r i b u Journal of the Association for Computing Machinery, Vol. 18, No. 3, July 1971 pp. 381-399 382 J . P . R . TOOTILL, W. D. ROBINSON, AND A. G, ADAMS tion over a specified number of dimensions are theoretically demonstrable. Empirical work by Tausworthe [3] himself, Canavos [4], and Whittlesey [5] has fully confirmed these properties. We shall show that any Tausworthe generator based upon a primitive trinomial (PT) can be regarded as a simple linear recurrence in GF (2~). From this it may be adduced that the strength of Tausworthe's approach derives ultimately from the combinatorial properties of Galois fields. Unfortunately, however, these combinatorial properties can also be a source of weakness. For many of the generators that have appeared in the l i terature--e.g, those based upon the PT's, x 3~ --tx ~ -t1 of Tausworthe [3], x 29 + x ~ -t1 of Canavos [4], and x 31 -tx 3 + 1 of Whittlesey [5J--quite elementary combinatorics suffice to show that the sequence of generated numbers cannot comply with the runs up-and-down test for randomness of Levene and Wolfowitz [6]. Moreover, on the simplifying assumption that the generator is otherwise satisfactory, the same combinatorics predict what the actual runs up-and-down performance will be. The object of this paper is, however, constructive. Our work shows that by paying attention to the combinatorics involved it is quite easy to find generators which do have satisfactory runs up-and-down properties. 2. Preliminary experimental work To obtain some leads, we undertook the preliminary experimental exercise, dubbed for obvious reasons "Operation Wallpaper," of implementing p-bit psuedo-random number generators based upon various PT's, say x p ~ x q + 1, so chosen that q covered the range 1 to (p 1 )/2. A feasible amount of output from each generator was then printed out as a sequence of binary integers and examined for systematic patterns. For q small or q equal to (p 1 )/2, such patterns were only too obvious. Because, with Tausworthe generators, implementation of the generator based upon the complementary P T is much more easily achieved by exchanging the words "lef t" and "r ight" in the coding, it was not necessary to cover the range q equal to (p ~ 1) /2 to p 1. I t sufficed to examine the mirror image of the output already obtained. 3. Pseudo-Noise and Galois Field Generators Tausworthe derived his generators from the properties of the so-called pseudo-noise (PN) sequences. These are fully described by Golomb [8], but it may be helpful briefly to indicate here how they are generated. (0, 1) pseudo-noise sequences are usually generated on-shift registers with linear feedback. This may be exemplified by considering the generation of the P N sequence derived from the P T x ~ ~ x 3 W 1 as a particular example of the general P T x p -tx q • 1. The shift register is connected up as shown in Figure 1. p tubes numbered 0 to p 1 are required. Each tube is either off (0) or on (1). Initially each tube may arbitrarily be in either state, provided not all the tubes are off. The tubes numbered zero and q are connected to an adder modulo (2), which in turn is connected to the tube p -1. At each clock pulse, the content of each tube is shifted to its left-hand neighbor, if any. In addition, the contents of tubes 0 and q are added modulo (2) and the sum fed back to tube p 1. The sequence of states produced in the shift register is shown in Table I. Journal of the Association for Computing Machinery, Vol. 18, No. 3, July 1971 Runs-Up-and-Down Performance of Pseudo-Random Number Generators Tube O Tube i Tube 2 Tube 3 Tube #