International Journal of Pure and Applied ————————————————————————– Volume 72 No. 4 2011, 515-526

UNIFORM EQUIPARTITION TEST BOUNDS FOR MULTIPLY

Marco Pollanen Department of Mathematics Trent University Peterborough, ON K9J 7B8, CANADA

Abstract: For x0 ∈ [0, 1), the multiply xn = axn−1 mod 1, with a > 1 an , is equidistributed. In this paper we show that equidis- tributed multiply sequences are not m-equipartitioned for any m> 2. We also provide uniform asymptotic bounds for equipartition tests for such sequences.

AMS Subject Classification: 11K06, 11J71 Key Words: multiply sequences, equipartition, ∞-distribution

1. Introduction

The sequence xn = axn−1 + c mod 1, where a is a non-negative integer, is an important sequence that arises in number theory, fractals, and applied mathe- matics [4]. A sequence hyni is equidistributed in [0, 1) if for all 0 ≤ a < b ≤ 1, 1 lim χ[a,b)(yn)= b − a, N→∞ N 1≤Xn≤N where χA is the characteristic of a A. For the case when a = 1, the sequence hxni was studied by Weyl [7] and shown to be equidistributed if and only if c is irrational. In the case when a> 1, the sequence is referred to as a multiply sequence. It was first shown by Borel that, for a> 1 and c = 0, the sequence is equidistributed for almost all x0.

Received: July 6, 2011 c 2011 Academic Publications, Ltd. 516 M. Pollanen

As in [2], let hSni be a sequence of propositions about the sequence hyni. We define 1 P (hSni) = lim 1 , N→∞ N Sn isX true 1≤n≤N when the limit exists. A sequence hyni is ∞-distributed [3] if, for every value of k,

P (a1 ≤ yn < b1, · · · , ak ≤ yn+k−1 < bk) = (b1 − a1) · · · (bk − ak) for all real aj, bj, with 0 ≤ aj < bj ≤ 1 for 1 ≤ j ≤ k. n As an example, un = θ mod 1 is ∞-distributed for almost all real numbers θ > 1 [2]. ∞-distributed sequences are of interest in that they automatically pass a large number of asymptotic statistical tests, including: the frequency test, serial test, gap test, poker test, coupon collector’s test, permutation test, run test, maximum-of-t test, collision test, birthday spacings test, serial correlation test, and tests on subsequences [3]. One test of particular importance is whether a sequence is m-equipartitioned. A sequence hxni is m-equipartitioned if for any permutation i1,...,im of the index set {i,...,i + m − 1} we have 1 P (x >...>x )= . i1 im m! Multiply sequences and their generalizations have been extensively studied by Franklin [1, 2], and have been shown to be not 3-equipartitioned. It was, however, shown in [2] that, for almost all x0, as a → ∞, multiply sequences become ∞-distributed and m-equipartitioned, so in a sense multiply sequences are almost ∞-distributed. In the next section we demonstrate that for c = 0 and almost all x0, multiply sequences are only m-equipartitioned for m = 2. However, we also show that for all m, as a → ∞ they are uniformly m-equipartitioned by exhibiting an explicit uniform bound. Thus, for large a we might expect multiply sequences to have good statistical properties. To prove these results we will use the concepts of generating functions (see [8]) and tetrahedral numbers, which we will now briefly introduce. A generating function for a sequences of real numbers hani, n ≥ 0 is an ∞ n infinite series G(x)= n=0 anx . This is a formal series, with questions about convergence being ignored.P Given a generating function, the sequence it repre- sents can be determined by calculating the coefficients of xn, for all n ≥ 0, in its formal power series expansion. UNIFORM EQUIPARTITION TEST BOUNDS... 517

The n-th triangular number is the sum 1 + 2 + · · · + n. It derives its name from the fact that the number can be represented graphically by a triangular lattice with n rows, with the summands representing the number of points in each row. The n-th tetrahedral number is the sum of the first n triangular numbers, and can graphically be represented in three dimensions as an n-row tetrahedron, where the i-th row contains the i-th triangular number of points. Likewise, for d> 3 an integer, the n-th d-dimensional tetrahedral number will be the sum of the first n (d − 1)-dimensional tetrahedral numbers.

2. Uniform Bounds for Multiply Sequences

We will first use a generalization of a technique found in [2] to show that multiply sequences with c = 0 are not m-equipartitioned for m> 2.

Theorem 2.1. Let xn = axn−1 mod 1 be an equidistributed sequence, with a> 1 an integer and x0 ∈ [0, 1). Then 1 a + k − 1 P (xi >xi > · · · >xi k)= . +1 + ak(a − 1)  k + 1 

Proof. Assume xi > xi+1 > · · · > xi+k. Now, for i

If Aj+1 > Aj, then

Aj xj+1 Aj + 1 Aj+1 xj = + < ≤ ≤ xj , a a a a +1 which is a contradiction. Thus, if xi >xi+1 >...>xi+k, then

Aj a − 1 ≥ Ai ≥ Ai ≥ . . . ≥ A − ≥ 1 and 0 ≤ xj < . (1) +1 i+k 1 +1 a − 1 Conversely, the inequalities (1) imply A x x < j + j+1 = x , j+1 a a j 518 M. Pollanen

and so xi >xi+1 >...>xi+k. Now, for each xi ∈ [0, 1), we have the unique a-ary representation

A A A − x x = i + i+1 + · · · + i+k 1 + i+k . i a a2 ak ak

For each possible set {Ai,...,Ai+k−1}, the length of the of permis- Ai+k−1 sible xi’s is a−1 . Hence, the measure of the set of xi’s is:

a−1 Ai Ai+k−2 1 A − · · · i+k 1 ak a − 1 AXi=1 AiX+1=1 Ai+Xk−1=1

a−1 A Ai+k−1 1 i = · · · 1. ak(a − 1) AXi=1 AiX+1=1 AiX+k=1 Ignoring the factor in front, the last sum is a tetrahedral number, so combina- torially the sum is a + k − 1 ,  k + 1  and so we are done. This follows since triangular numbers have a generat- ing function x/(1 − x)3 [6] and, by convolution, the d-dimensional tetrahedral numbers have a generating function x/(1 − x)d+1. Accordingly, the n-th d- tetrahedral number can be combinatorially represented as

n A Ad−1 1 n + d − 1 Td(n)= · · · 1= . (2)  d  AX1=1 AX2=1 AXd=1

From this theorem, the following corollary of [2] is immediate.

Corollary 1. Let xn = axn−1 mod 1 be an equidistributed sequence, with a> 1 an integer and x0 ∈ [0, 1). Then 1 P (xi >xi )= P (xi x >x )= + . i i+1 i+2 3! 6a The multiply sequence is not 3-equipartitioned. However, as the next corol- lary demonstrates, in a sense the case of 3-equipartitioning is the worst case. UNIFORM EQUIPARTITION TEST BOUNDS... 519

Corollary 2. Let xn = axn−1 mod 1 be an equidistributed sequence, with a> 1 an integer and x0 ∈ [0, 1). Then 1 1 P (xi >xi > · · · >x ) − ≤ . +1 i+k (k + 1)! 6a

Proof. We have equality for k = 2. Accordingly, we will proceed by induc- tion, by assuming

1 a + k − 1 1 1 ≤ + , ak(a − 1)  k + 1  (k + 1)! 6a that is, 6(a + k − 1)! ≤ 6ak−1 + ak−2(k + 1)!. a! Now, as a ≥ 2, 6a ≤ (a − 1)(k + 1)! + a(k + 1)(k − 1)! holds for k = 2. It also holds for k ≥ 2. Thus, if we expand the first term on the right hand side and multiplying both sides by kak−2, we have

6kak−1+kak−2(k+1)! ≤ kak−1(k+1)!+ak−1(k+1)! = ak−1(k+2)!−ak−1(k+1)!.

Thus, using our induction hypothesis: (a + k)! 6 ≤ (a + k)(6ak−1 + ak−2(k + 1)!) a! = 6ak + ak−1(k + 1)! + 6kak−1 + kak−2(k + 1)! ≤ 6ak + ak−1(k + 2)!.

Hence, by induction, the desired result holds for all a, k ≥ 2.

We now show that, for all possible equipartition tests, the error in the estimate in the last corollary is uniformly bounded as a →∞.

Theorem 2.2. Let xn = axn−1 mod 1 be an equidistributed sequence, with a > 1 an integer and x0 ∈ [0, 1). Then, for any permutation i1,...,im of the index set {i,...,i + m − 1}, we have 3 1 3 − ≤ P (x >x > · · · >x ) − ≤ . a i1 i2 im m! a − 1

Proof. Suppose x0 ∈ [0, 1) and xn = axn−1 mod 1, with a > 1 an integer, is an equidistributed sequence. We may write xi with a unique a-ary expansion A A A x x = 1 + 2 + · · · + k + i+k , (3) i a a2 ak ak 520 M. Pollanen

where 0 ≤ Aj < a for all j ∈ {1,...,k}. Now it follows that

A2 A3 Ak xi+k xi = + + · · · + + +1 a a2 ak−1 ak−1 . . A A A x x = j+1 + j+2 + · · · + k + i+k i+j a a2 ak−j ak−j . . Ak xi+k x − = + . i+k 1 a a

Let us define a reordering of the index set {i,...,i + k − 1}, say {j1,...,jk} such that

xj1 ≥ xj2 ≥ . . . ≥ xjk (4) and, for some l ∈ {1,...,k − 1},

xjl >xi+k >xjl+1 . (5) The last assumption (5) is for notational convenience. The following calculation could be easily repeated, and is in fact simpler, with xi+k being either the smallest or largest of the consecutive members of the sequence.

Now, if we compare the first terms in the expansions of xj1 ,...,xjk , it follows that

a − 1 ≥ Aj1 ≥ Aj2 ≥ . . . ≥ Ajk ≥ 0, (6) and so by inequality (5) we have

Ajl Ajl+1 Ak xi+k + + · · · + + >xi+k a a2 ak−jl+1 ak−jl+1

Aj Aj +1 A x > l+1 + l+1 + · · · + k + i+k . a a2 ak−jl+1+1 ak−jl+1+1 If we write this using common denominators and isolate xi+k, we have

k−jl k−jl+1 Ajl a + · · · + Ak Ajl+1 a + · · · + Ak >xi+k > . (7) ak−jl+1 − 1 ak−jl+1+1 − 1

We wish to calculate the measure of the set of initial values xi that give us the ordering (4) and (5). To do this, for each combination of Aj’s, we will establish upper and lower estimates for the length of the interval of xi+k’s that satisfy the inequality (7). Thus, we want to calculate

k−jl k−jl+1 Ajl a + · · · + Ak Ajl+1 a + · · · + Ak I(A1,...,Ak)= − , ak−jl+1 − 1 ak−jl+1+1 − 1 UNIFORM EQUIPARTITION TEST BOUNDS... 521 which we will abbreviate as I. Note that for integers a> 1 and b> 1

1 ab 1 < < , a ab+1 − 1 a − 1 and so

k−j k−j +1 k−j +1−1 A a l Aj a l + (a − 1)a l · · · + (a − 1) I ≥ jl − l+1 ak−jl+1 − 1 ak−jl+1+1 − 1 k−j k−j +1 k−j A a l Aj a l (a − 1)(a l+1 − 1) = jl − l+1 − ak−jl+1 − 1 ak−jl+1+1 − 1 (a − 1)ak−jl+1+1 − 1 k−j k−j +1 A a l (Aj + 1)a l > jl − l+1 ak−jl+1 − 1 ak−jl+1+1 − 1 A Aj + 1 > jl − l+1 . a a − 1

Similarly, A + 1 Aj I < jl − l+1 . a − 1 a We will now establish lower and upper bounds for

P (xj1 >...>xjl >xi+k >xjl+1 >...>xjk ), (8) which we will abbreviate as P . From equation (3) we see that we can find an upper bound for (8) by calculating I(A1,...,Ak) for each possible combination of A1, · · · , Ak, such that inequalities (6) are satisfied, that is

A a−1 Aj1 jk−1 I(A ,...,A ) P ≤ · · · 1 k ak AXj1 =0 AXj2 =0 AXjk =0 A a−1 Aj1 jk−1 1 A + 1 Aj < · · · jl − l+1 . (9) ak  a − 1 a  AXj1 =0 AXj2 =0 AXjk =0

For a lower bound, we note that if

a − 1 > Aj1 > Aj2 >...>Ajk > 0, 522 M. Pollanen

then surely xj1 >...>xjk . Hence, we can establish the following lower bound:

A −1 a−1 Aj1 −1 jk−1 I(A ,...,A ) P ≥ · · · 1 k ak AXj1 =1 AXj2 =1 AXjk =1 A −1 a−1 Aj1 −1 jk−1 1 A Aj + 1 > · · · jl − l+1 . (10) ak  a a − 1  AXj1 =1 AXj2 =1 AXjk =1

Thus, the key to estimating P is to calculate sums of the form

n B1 Bd−1 · · · Bd−m+1 (11)

BX1=0 BX2=0 BXd=0 and n−1 B1−1 Bd−1−1 · · · Bd−m+1 (12)

BX1=1 BX2=1 BXd=1 for integers m, 1 ≤ m ≤ d. The sum n B1 Bd−1 · · · 1 (13)

BX1=0 BX2=0 BXn=0 is the coefficient of xn in the generating function 1/(1−x)d+1 or, in other words, it is given by Td(n + 1). Thus, the sum in (11) can be represented by the generating function

x d 1 mx = , (1 − x)d−m+1 dx (1 − x)m  (1 − x)d+2 and so,

n B Bd−1 1 n + d · · · Bd−m = m Td (n)= m . +1 +1  d + 1  BX1=0 BX2=0 BXd=0

Likewise,

n−1 B1−1 Bd−1−1 n · · · B − = m T (n − d)= m . d m+1 d+1  d + 1  BX1=1 BX2=1 BXd=1 UNIFORM EQUIPARTITION TEST BOUNDS... 523

As Ajl is the l-th largest of the Ai’s, and Ajl+1 is the (l + 1)-th largest of the Ai’s, from (9) we have the following upper bound for (8): k − l + 1 a + k − 1 1 a + k − 1 k − l a + k − 1 + − ak(a − 1)  k + 1  ak(a − 1)  k  ak+1  k + 1  a + k − l a + k − 1 1 a + k − 1 = + ak+1(a − 1)  k + 1  ak(a − 1)  k  a + k − l a + k − 1 1 k + 1 a + k − 1 = + ak+1(a − 1)  k + 1  ak(a − 1) a − 1  k + 1  a2 + 2ak − (a − 1)l − k a + k − 1 a + 2k a + k − 1 = ≤ . ak+1(a − 1)2  k + 1  ak(a − 1)2  k + 1  Likewise, from (10) we have the following lower bound for (8): k − l + 1 a k − l a 1 a − 1 − − ak+1  k + 1  ak(a − 1)  k + 1  ak(a − 1)  k  a − k + l − 1 a k + 1 a = − ak+1(a − 1)  k + 1  ak+1(a − 1)  k + 1  a − 2k + l − 2 a a − 2k − 2 a = ≥ . ak+1(a − 1)  k + 1  ak+1(a − 1)  k + 1  Thus, we have shown that a − 2k − 2 a a + 2k a + k − 1

ak(k + 1)! − 0.5(k + 1)(k + 2)ak = ≥ 0. ak(a − 1)(k + 1)! The last inequality follows as 2(k + 1)! ≥ (k + 1)(k + 2), for k ≥ 2. Now, consider a − 2k − 2 a 3 1 L = + − ak+1(a − 1)  k + 1  a (k + 1)! (a − 2(k + 1))(a − 2) · · · (a − k) + 3ak−1(k + 1)! − ak = . ak(k + 1)! Consider the expansion of the polynomial f(a) = (a−2(k+1))(a−2) · · · (a− k)

− f(a) = ak − 2(k +1)+ i ak 1 + 2≤Xi≤k  

− + 2(k + 1) i + ij ak 2 −··· + (−1)k2(k + 1)!. 2≤Xi≤k 2≤Xi 1, will not exceed (2(k + 1)(k − 1)!k! + (k − 1)!k!) ar < 2(k + 1)!k!ar < 2k!ar+1. Now, discarding the positive coefficients of ar, for r < k − 1 and bounding the k k k−1 2 − 1 ≤ 2 negative terms by −2k!a , we have   f(a) > ak − 0.5(k2 + 5k + 2)ak−1 − kk!ak−1. However, for k ≥ 2, 2(k+1)! > 0.5(k2 +5k+2) and so, f(a) > ak −3(k+1)!ak−1. Thus, ak − 3(k + 1)!ak−1 + 3ak−1(k + 1)! − ak L> = 0. ak(k + 1)! Thus, the desired result follows. UNIFORM EQUIPARTITION TEST BOUNDS... 525

3. Discussion

In Theorem 2.1 we demonstrated that equidistributed multiply sequences are not m-equipartitioned for any m> 2 by establishing an exact value for P (xi > xi+i > · · · > xi+m−1). Calculations for other individual permutations can be established in a similar fashion. For example, for m = 3 it is easy to show that: 1 1 P (xi >xi >xi )= P (xi >xi >xi)= 1+ , +1 +2 +2 +1 6  a 1 1 P (xi >xi >xi )= P (xi >xi >xi )= 1 − , +1 +2 +2 +1 6  a 1 and P (xi >xi >xi )= P (xi >xi >xi)= . +2 +1 +1 +2 6

Exact values for m > 3 can likewise be established, although they become increasingly more complex. However, in Theorem 2.2 we established a uniform bound for all equipar- tition tests of equidistributed multiply sequences. As multiply sequences are almost ∞-distributed in an asymptotic sense, these bounds can be thought of as one measure of how close a sequence is to ∞-distribution. In comparing the general bounds of Theorem 2.2 to the above permutation tests for m = 3 it is apparent that the bounds can be improved. We have provided some alternate bounds, such as inequality (14), in intermediary steps. For large a and m, other bounds might be possible from our calculations by using Stirling-like approximations [5]. We conjecture in fact that Theorem 2.1 provides the worst case upper bound, and a symmetric worst case lower bound, as follows:

Conjecture 1. Let xn = axn−1 mod 1 be an equidistributed sequence, with a > 1 an integer and x0 ∈ [0, 1). Then, for any permutation i0,...,ik of the index set {i,...,i + k}, we have 1 1 a + k − 1 1 P (xi >xi > · · · >xi ) − ≤ − . 0 2 k (k + 1)! ak(a − 1)  k + 1  (k + 1)!

Acknowledgments

This research was supported by a grant from the Natural Sciences and Engi- neering Research Council of Canada (NSERC). 526 M. Pollanen

References

[1] J.N. Franklin, On the equidistribution of pseudo-random numbers, Quar. Appl. Math., 16 (1958), 183–188.

[2] J.N. Franklin, Deterministic simulation of random processes, Math. of Comp., 17 (1963), 28–59.

[3] D.E. Knuth, The Art of Computer Programming: Seminumerical Algo- rithms, Volume 2, Addison-Wesley, New York (1998).

[4] D. Luzeaux, From beta-expansions to chaos and fractals, Complexity In- ternational, 1 (1994) url: http://www.complexity.org.au/ci/vol01/luzeau01/html/

[5] H. Robbins, A remark on Stirling’s formula, Amer. Math. Monthly, 62 (1955), 26–29.

[6] N.J.A. Sloane, S. Plouffe, The Encyclopedia of Integer Sequences, San Diego (1995).

[7] H. Weyl, Uber¨ die Gleichverteilung von Zahlen Modulo Eins, Math. Ann., 77 (1916), 313–352.

[8] H.S. Wilf, Generatingfunctionology, 3-rd Edition, Academic Press, New York (2004).