Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

1183-PDF File-1262-1-10-20120117

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

When are subset sums equidistributed modulo m?

Stan Wagon1
Macalester College, St. Paul, MN 55105 (wagon@macalstr.edu)
and
Herbert S. Wilf 2
University of Pennsylvania, Philadelphia, PA 19104 (wilf@central.cis.upenn.edu)

January 30, 1994

Abstract. For a triple (n, t, m) of positive integers, we attach to each t-subset S =


{a1 , . . . , at } ⊆ {1, . . . , n}
¡ ¢the sum f (S) = a1 + · · · + at (modulo m). We ask: for which
triples (n, t, m) are the nt values of f (S) uniformly distributed in the residue classes mod
¡n¢
m? The obvious necessary condition, that m divides t , is not sufficient, but a q-analogue
of that condition is both necessary and sufficient, namely:
µ ¶
qm − 1 n
divides the Gaussian polynomial .
q−1 t q

We show that this condition is equivalent to: for each divisor d > 1 of m, we have t mod d >
n mod d. Two proofs are given, one by generating functions and another via a bijection.
We study the analogous question on the full power set of [n]: given (n, m); when are the
2n subset sums modulo m equidistributed into the residue classes? Finally we obtain some
asymptotic information about the distribution when it is not uniform, and discuss some
open questions.

1
Until July, 1994: P. O. Box 1782, Silverthorne, CO 80498 (71043.3326@compuserve.com)
2
Supported by the Office of Naval Research
the electronic journal of combinatorics 1 (1994), #R3 2

1. Introduction
While working on a problem related to lotteries, Larry Carter, of IBM, and the first
author were led to the question of the title. Positive integers n, t, and m are given. By a
t-ticket we mean a subset of {1, 2, . . . , n} of size t. The value of a t-ticket is the modulo-
m sum of its entries. Our question is: for which triples (n, t, m) are the values of the
t-tickets equally distributed among the m residue classes? Let us call a triple uniform if
equidistribution holds. ¡ ¢
There is an obvious necessary condition, namely that nt be divisible by m, but this
is not sufficient, as the example (n, t, m) = (5, 2, 2) shows. A special case of this question
was considered by Snevily [4].
In this paper we will describe some of the experimentation that went into formulation
of a conjecture about the necessary and sufficient condition. We then will prove that the
conjecture is true, using the method of generating functions. Then we will give a bijective
proof of the fact that (n, t, m) is uniform when the conditions of the theorem hold.
The following recurrence was used in our computations. For nonnegative integers
(n, t, m), and for residue classes i modulo m, let f (i, n, t, m) be the number of t-tickets
from {1, 2, . . . , n} whose value is congruent to i mod m. Then we have

f (i, n, t, m) = f (i, n − 1, t, m) + f (i − n, n − 1, t − 1, m). (1)

The proof is immediate, by considering separately those t-tickets that contain n and those
that do not.
From this formula and suitable initial values it is easy to generate images of the uniform
triples (we used Mathematica), by fixing m and varying t and n. Figure 1 shows twelve
cases (moduli), where each plotted point indicates a uniform triple. The data suggest some
definite patterns, but the statement that covers all cases does not immediately leap out.
Larry Carter made the observation from these data that the cases in which uniformity
holds can be summarized by a succinct arithmetical condition (condition 3 in the theorem
below).

Theorem. The following properties of a triple (n, t, m) of positive integers are equivalent:
1. (n, t, m) is uniform;
¡n¢
2. (q m − 1)/(q − 1) divides the Gaussian polynomial t q;

3. For all d > 1 that divide m, we have t mod d > n mod d (here a mod b denotes
the least nonnegative residue).
the electronic journal of combinatorics 1 (1994), #R3 3

t t t
8 12 14
7 12
6 9 10
5
8
4 6
6
3
2 3 4
1 2
0 0 0
n 0 1 2 3 4 5 6 7 8 n 0 3 6 9 12 n 0 2 4 6 8 10 12 14

Mod 2 Mod 3 Mod 4


t t t
15 18

15
14
10 12

5 6 7

0 0 0
n 0 5 10 15 n 0 3 6 9 12 15 18 n 0 7 14

Mod 5 Mod 6 Mod 7


t t
18 18 t
16 9
15
14
12 12 7
10
9
8
6 6
3
4
3
2 1
0 0
n 0 2 4 6 8 10 12 14 16 18 n 0 3 6 9 12 15 18 n 10 12 16 18

Mod 8 Mod 9 Mod 10

t t t
13 15
11
13
11
11
9
7 9
7
5
5 5
3 3
1 1 1

n 12 16 18 22 n 14 16 18 22 24 26 n 16 18 20 22 24 26 28 30

Mod 12 Mod 14 Mod 16

Figure 1. Dots indicate that t-subset sums from [n] are equidistributed
modulo m. By fixing m and varying t and n, various patterns are revealed.
For example there is an m-periodicity in both the t- and the n-directions;
thus for the moduli 10, 12, 14 and 16, we show only a fundamental region.
the electronic journal of combinatorics 1 (1994), #R3 4

t t
15 15

13 13

11 11

9 9

7 7

5 5

3 3

1 1

n 15 17 19 21 23 25 27 29 n 15 17 19 21 23 25 27 29
Mod 15 Mod 15

Figure 2. The uniform pairs (n, t) for modulus m = 15 arise from those for m = 3 and
m = 5. The left chart shows the uniform pairs for 3 (gray triangles) and 5 (black triangles).
A pair (n, t) is uniform modulo 15 iff it is uniform modulo 3 and 5 and t mod 15 > n mod
15, as in chart on right.

2. A proof by generating functions


To prove the theorem, we start with the following lemma.
Lemma 1. Let h(q) denote the tth elementary symmetric function of the n quantities
q, q 2 , . . . , q n . Then the subset sums are equidistributed modulo m if and only if h(q) is
divisible by (q m − 1)/(q − 1).
Proof. First, for each i = 0, 1, 2, . . ., let ai be the number of these sums that are equal to
i. Then clearly the tth elementary symmetric function of the n quantities q, q 2 , . . . , q n is
X X X
q i1 q i2 · · · q it = q i1 +i2 +···+it = ai q i . (2)
1≤i1 <i2 <···<it ≤n 1≤i1 <i2 <···<it ≤n i

As before, let f (i, n, t, m) denote the number of these sums that fall into residue class i
P
mod m, and note that h(q) is the sum in (2) above. Then m−1 i
i=0 f(i, n, t, m)q is equal to
h(q) modulo (q m − 1).
¡n¢ Moreover, if for all i, the f (i, n, t, m) are equal, then what they are equal to must be
t /m, so we must then have

X µ ¶ m−1 µ ¶
1 n X i
m−1
1 n qm − 1
f (i, n, t, m)q =i
q = = h(q) mod (q m − 1).
m t i=0 m t q−1
i=0

Hence in this case µ ¶


1 n qm − 1
h(q) = Q(q)(q m
− 1) +
m t q−1
the electronic journal of combinatorics 1 (1994), #R3 5

and therefore h(q) must be divisible by (q m − 1)/(q − 1).


Conversely, if
qm − 1
h(q) = p(q)
q−1
¡n ¢ ¡ ¢
for polynomial p, then h(1) = t = p(1)m implies that p(1) = nt /m. Thus
µ ¶
qm − 1 qm − 1 1 n qm − 1
h(q) = p(q) = (p(1) + (q − 1)Q(q)) = Q(q)(q − 1) +
m
.
q−1 q−1 m t q−1

Hence h(q) modulo (q m − 1) has its coefficients all equal, and the sums are equidistributed
modulo m.
Lemma 2. Let g(q) be the rational function

(1 − q a1 ) · · · (1 − q at )
,
(1 − q b1 ) · · · (1 − q bm )

in which all of the a’s and b’s are positive integers. Define, for every integer k ≥ 1, e(k) to
be the excess of the number of multiples of k that occur among the ai ’s over the number
that occur among the bi ’s. Then in order that the rational function g(q) be a polynomial,
it is necessary and sufficient that e(k) ≥ 0 for every positive integer k.
Q
Proof. Write each expression 1 − q s as d\s Fd (q), where the F ’s are the cyclotomic
polynomials. If we imagine replacing each factor in (4) by its cyclotomic factorization,
then since the cyclotomic polynomials are irreducible, the quantity in (4) is a polynomial
iff each fixed cyclotomic polynomial Fk (q) appears there with a nonnegative exponent. But
the exponent with which a given Fk (q) appears is the excess of the number of multiples of
k that appear among the a’s over the number that appear among the b’s.

To prove the theorem, we need, by Lemma 1, to describe the conditions under which
h(q) is divisible by (q m − 1)/(q − 1). But h(q) is the tthQelementary symmetric function
of q, q 2 , . . . , q n , and is therefore the coefficient of yt in nl=1 (1 + yq l ) (this statement is
identical with the recurrence Qn(1) above).
However, the product l=1 (1+yq l )¡is¢well known in combinatorics to be the generating
function for the Gaussian polynomials nj . Precisely, we have
q

Y
n X
n µ ¶
l (j+1
j) n
(1 + yq ) = y q 2 .
j q
l=1 j=0

Thus we see that the coefficient of yt is


µ ¶
) n = q (t+1
t+1 (1 − q n )(1 − q n−1 ) · · · (1 − q n−t+1 )
h(q) = q ( 2 2 ) .
t q (1 − q)(1 − q 2 ) · · · (1 − q t )
the electronic journal of combinatorics 1 (1994), #R3 6

Thus necessary and sufficient for equidistribution is that

(1 − q n )(1 − q n−1 ) · · · (1 − q n−t+1 )


(1 − q m )(1 − q 2 ) · · · (1 − q t )

be a polynomial.
To determine when this is a polynomial we use Lemma 2. Let e(k) denote the excess
that must be nonnegative, according to the statement of Lemma 2.
Fix some k ≥ 1. Then e(k) in (4) is the number of multiples of k in [n − t + 1, n]
minus the number of multiples of k in [2, t] minus one more if k divides m. If we write
n = αk + β and t = γk + δ, with 0 ≤ β, δ < k, then e(k) is exactly
jnk ¹ º ¹ º ¹ º
n−t t 1
− − + − τ (k\m) = τ (β < δ) + τ (k = 1) − τ (k\m),
k k k k

(τ (· · ·) is the truth value of the statement “· · ·”) which must be nonnegative for all k ≥ 1.
If β < δ or k = 1 or k does not divide m, this is surely nonnegative. If k > 1 and k divides
m then we must require that β < δ, i.e., that n mod k < t mod k for every k > 1 that
divides m.
We remark that the proof shows that whether or not the conditions of the theorem
hold, we always have

X
m−1 µ ¶
def n
r(q) = i
f (i, n, t, m)q = q t(t+1)/2
modulo (q m − 1). (3)
i=0
t q

This makes it easy to compute the numbers of subset sums in each residue class mod
m whether or not the tickets are equidistributed, by looking at the remainder of the
division of q t(t+1)/2 times the Gaussian polynomial by ¡(q m ¢ − 1).16 For example the triple
(n, t, m) = (17, 10, 16) is not uniform. After dividing q 10 q by q −1 we find a remainder
55 17

of

1212 + 1219 q + 1212 q 2 + 1219 q 3 + 1212 q 4 + 1219 q 5 + 1212 q 6 + 1219 q 7


+ 1212 q 8 + 1219 q 9 + 1212 q 10 + 1219 q 11 + 1212 q 12 + 1219 q 13 + 1212 q 14 + 1219 q 15 ,

in which the coefficient of each q i is f (i, 17, 10, 16).


¡n¢following [2], that the factorization of 1 − q into cyclotomic polynomials
i
We note,
means that t q is the product of precisely those cyclotomic polynomials Fd (q) for which
the number of multiples of d in [n − t + 1, n] is greater than the number in [1, t]. But
this excess is bn/dc − b(n − t)/dc − bt/dc, which is 0 unless t̄ > n̄† , when it is 1. We can
restate this as a relationship between the cyclotomic factors of the Gaussian polynomial
and uniform triples, which at the same time gives a nice way of computing the Gaussian
polynomials, as follows.

We use the abbreviation t̄ (mod d) for the least nonnegative residue of t mod d.
the electronic journal of combinatorics 1 (1994), #R3 7
¡ ¢
Proposition. The Gaussian polynomial nt q is the product of exactly those cyclotomic
polynomials Fj (q) for which the triple (n, t, j) is uniform.
We can express the distribution function r(q), of (3) explicitly in terms of the values
of the Gaussian polynomials at the roots of unity. Indeed (3) implies that
µ ¶
n
q t(t+1)/2
= (q m − 1)Q(q) + r(q)
t q

for some quotient¡ ¢ polynomial Q(q). If ω m = 1, let q = ω in the above, to find that
r(ω) = ω t(t+1)/2 nt ω at every mth root of unity ω. Hence by Lagrange interpolation,
µ ¶
1 X q m − 1 1+t(t+1)/2 n
r(q) = ω . (4)
m ω m =1 q − ω t ω
¡ ¢
Note that the single term ω = 1 has the value nt and that, by (3), this actually accounts
for all of r(q) precisely when the
¡n¢ conditions of our theorem hold, for then and only then is
it true that all f (i, n, t, m) = t /m.
By matching coefficients of powers of q on both sides of (4) we obtain the following
formula for the occupancies of each residue class:
µ ¶
1 X t(t+1)/2−j n
f (j, n, t, m) = ω .
m ωm =1 t ω

Hence the frequency vector is essentially the Fourier transform of the vector of values of
the Gaussian polynomials at the roots of unity. This last formula is a nice way to compute
the occupancy numbers, and in fact the images in Figure 3 below were found in a few
seconds by this method.

+18.1 +10.3 +6680

100791.9 104152.7 48141450


0 5 10 15 20 25 30 0 5 10 15 20 25 29 0 5 10 15 20 25 30 35 40 47

-9.7
-19.9 -6680

Figure 3. The first two panels show two frequency vectors for 9-tuples from [26]. The
modulus in the first is 31, with a down-and-up pattern characteristic of primes. In the
second panel the modulus is 30, and the vector’s behavior is more complex. The frequencies
in the third panel are from the triple (36, 13, 48).
the electronic journal of combinatorics 1 (1994), #R3 8

3. A bijective proof

In this section we attack the problem using elementary combinatorial arguments. We


present a bijective proof of the positive direction of the theorem ((3) ⇒ (1)). The method
also yields the negative, nonuniform, direction of the theorem ((1) ⇒ (3)) if m is a prime
power. As a bonus we get some formulas for the residue frequencies as well as an elementary
proof of the m-periodicity that is so striking in Figure 1. We begin with the general proof
of the positive direction, in which we recursively construct a bijection.

Proof of the positive direction. Fix n and t and suppose m satisfies the hypothesis of
the theorem: t̄ > n̄ (mod d), for each d > 1 that divides m. The proof will be by induction
on m. To this end, note that the hypothesis is satisfied for triples (n, t, d) if d divides m;
more important, it is satisfied for any triple (n0 , t0 , d) where n0 ≡ n and t0 ≡ t (mod d).
Now let km be the largest multiple of m with km ≤ n; call numbers in [km] small.
Let w be the number of small entries in a ticket T , and let d = gcd(w, m). We will call d
the type of T . Our hypothesis tells us that d < m. For suppose otherwise. Then m divides
w, which implies that t− w = t̄ (mod m), since t − w, being the number of nonsmall entries
in T , is at most n − km, which is less than m by definition of k. But also t − w ≤ n̄ (mod
m) because t − w ≤ n − km. Therefore t̄ ≤ n̄ (mod m), contradicting the hypothesis.
We claim that within the family of tickets of type d there is equidistribution among
values modulo d. This claim suffices, for if ci is the frequency of the residue class i within
type d, then the claim implies, for each j ≤ d − 1:

c0 + cd + c2d + · · · + c( md −1)d = cj + cj+d + · · · + cj+d( md −1) . (5)

We can now construct a bijection showing that cj = cj+id as follows. If T is a ticket


of value j and type d, let w be the number of small entries in T ; write w as Ld where
gcd(L, m) = 1. Then add iL−1 (the inverse is modulo m) to each of the small entries
of T (reducing modulo km and using km for 0). This adds wiL−1 = LdiL−1 = di to
the mod-m value, as desired. These bijections, together with (5), imply that each c0 m/d
equals cj m/d, and so c0 = cj . This is true within each type d, proving uniformity.
It remains to prove the claim. We will show here a remarkable fact. If S is some fixed
set of small elements, consider the collection of all tickets whose set of small elements is
exactly S. We claim that within this collection, the modulo d frequencies are all equal.
Indeed, for tickets T in such a family the mod-d frequencies are a translation of the mod-d
frequencies of T ∩ [km + 1, n]. But these intersections are all possible (t − w)-subsets from
[km + 1, n]. Since d divides m, as far as mod-d values are concerned such a subset may
be viewed as a (t − w)-subset of [n̄ mod m]. But d < m, so we can invoke induction to
get uniformity, provided we verify the hypothesis for the triple (n̄ mod m, t − w, d). But,
modulo d, n̄ mod m is congruent to n. Since t − w ≡ t (mod d), the observation at the
beginning of the proof shows that the hypothesis is preserved and induction yields the
desired uniformity. The base case is m = 1, which is trivial.
If m is a prime p then the bijection in the previous proof is easy to describe. Any
ticket has w elements in [kp], the largest multiple of p less than or equal to n, where w is
the electronic journal of combinatorics 1 (1994), #R3 9

not divisible by p Let u be the mod-p inverse of w and add uj to each small entry of T ,
reducing modulo kp, and using kp for 0. This changes a ticket of value 0 to one of value j.
For the negative direction, our argument succeeds only for prime power moduli. A
ticket is said to be k-good if |T ∩ [km]| is not a multiple of m (m will be clear from the
context).
Proof of the negative direction, (1) ⇒ (3), for prime power moduli. Suppose
that, for m = pr the hypothesis fails for (n, t). Let q = pr−1 . If the hypothesis fails for
the modulus q, then by induction the tickets are nonuniform modulo q and so nonuniform
modulo pr . So we may assume uniformity modulo q, which implies

c0 + cq + c2q + · · · + c(p−1)q = cj + cj+q + · · · + cj+(p−1)q .

As in the proof of the positive direction, the k-good tickets for k ≤ n/pr are equidistributed.
If, for every k ≤ n/pr , T fails to be k-good, then each interval [1, pr ], [pr + 1, 2pr ], [2pr +
1, 3pr ], and so on, either contains or is disjoint from T . If p 6= 2 the effect of these parts of
T on T ’s value is 0, since pr divides pr (pr + 1)/2; if p = 2 each interval contributes 2r−1
and the net contribution is 0 if bt/2r c is even and 2r−1 otherwise. Thus the value of T
is primarily determined by its intersection with the last interval, [bn/pr cpr + 1, n]. But
this remainder has the same value as the corresponding t̄ ticket from [n̄] (note that ¡our ¢
assumptions imply that t̄ ≤ n̄), and these are nonuniform because pr does not divide n̄t̄ .
[Proof: Use the well-known formula for the power of a prime in a factorial; then observe
that if 1 ≤ b ≤ r − 1 then
¹ º ¹ º ¹ º
n̄ t̄ (n̄ − t̄)
− b − ≤ 1,
pb p pb

but when b ≥ r each of the three terms is 0.]


The preceding proof yields some useful formulas. First define
½
m/2, if m is even and bt/mc is odd;
h = h(t, m) =
0, otherwise,
¡bn/mc¢
and write s = bt/mc
. Then if m = p is prime we have
¡n¢ ¡ ¢
− s n̄t̄
f(i, n, t, p) = f (i − h, n̄, t̄, p)s + t
. (6)
p

The first summand gives the contribution for tickets that are not k-good for any k; the
second is an equal share of the remainder (the number of bad ticket is subtracted from the
total). This formula shows that the frequency vector for (n, t) is a translation of a scalar
multiple of that for (n̄, t̄); thus its shape is the same.
There is an analogous formula in the prime power case. If (n, t, pr−1 ) is uniform then
the formula is identical with that of the prime case
¡n ¢ ¡n̄¢
− s
f (i, n, t, m) = f (i − h, n̄, t̄, m)s + t t̄
.
m
the electronic journal of combinatorics 1 (1994), #R3 10

If (n, t, pr−1 ) is not uniform then the tickets fall into two classes, those that are k-good
for some appropriate k (call these simply good) and those that are not (call them bad).
As before, the number of bad tickets with value i is f (i − h, n̄, t̄, m)s. The good tickets,
on the other hand, have modulo-m values that are equidistributed among the p classes
i, i + q, . . . , i + (p − 1)q, where q = pr−1 . The number of all tickets that have such values is
f (i, n, t, q). We can therefore subtract the number of bad ones and divide by p, obtaining
Pp−i
f (i, n, t, m/p) − s z=0 f (i + zq − h, n̄, t̄, m)
f (i, n, t, m) = f (i − h, n̄, t̄, m)s + .
p

This formula is, like (1), a recurrence, but it is much faster for computation since the
arguments go down through the powers of p.

4. Multisets and power sets

Aside from the case of t-subsets of an n-set, there are other contexts in which the
uniform distribution of sums arises naturally. We mention two of these in this section. Then
we study the asymptotics of the distribution into residue classes when that distribution is
not uniform, in the case of the full power set. Our aim is shed some light on the question
of how nonuniform the distribution can be.
First we allow repetition P in the t-subsets, and we consider t-multisets: sets consisting
of a1 1’s, . . ., an n’s, where ai = t. The criterion for uniformity turns out to be virtually
unchanged. P
The sum of a multiset is i iai . Let g(i, n, t) (resp. f (i, n, t)) be the number of
t-multisets (resp. t-subsets) of [n] whose sum is i.
Multiset Theorem. The triple (n, ¡ ¢ t, m) is uniform for multisets iff (n + t − 1, t, m) is
uniform. In fact, g(i, n, t) = f(i + 2t , n + t − 1, t).
Proof. The first assertion follows from the second. A t-multiset from [n] may be viewed as
an (n − 1)-subset of [n + t − 1] by the usual “stars and bars” argument: Consider n + t − 1
blanks and fill in n − 1 of them with markers (“stars”). Then place 1’s in the blanks
that precede the first marker, 2’s in the next string of consecutive blanks, and so on. If
{b1 , . . . , bn−1 } is the set of marker positions then the corresponding multiset has sum

X
n µ
¶ n−1
X µ ¶ X
n+1 t
i(bi − bi−1 − 1) = nbn − − bi = + B,
2 2
i=1 i=1

P
where B is the sum of the entries in B, the t-set of non marker positions.

Next we consider the question of equidistribution of all 2n of the subset sums of the
set [n], modulo m. This question is easier than the one previously treated, but here we
are able not only to get the equidistribution criterion, but also to discuss the asymptotics
of the distribution of subset sums when they are not uniform.
the electronic journal of combinatorics 1 (1994), #R3 11

Power Set Theorem. The 2n subset sums of [n] are equidistributed into the residue
classes modulo m iff m ≤ 2n and m is a power of 2.
Qn
To prove this we expand f (x) = j=1 (1 + xj ) as a polynomial,

Y
n X
(1 + xj ) = cr xr ,
j=1 r

then each cr is clearly the number of subsets of [n] whose sum is r. To reduce modulo m
we proceed as before: f (x) modulo (xm − 1) generates the number of subsets of [n] whose
mod m sum is r. If these sums are equidistributed then there are 2n /m in each residue
class (whence m must divide 2n ), so it must be true in this case that
Y
n
2n
(1 + xj ) modulo (xm − 1) = (1 + x + x2 + . . . + xm−1 ),
j=1
m

which is to say that


Y
n
2n xm − 1
(1 + xj ) = p(x)(xm − 1) +
m x−1
j=1

where p(x) is some polynomial of degree < m. If in this equation we let x be an mth root
of unity other than x = 1, then we see that the left side must vanish at x because the
right side does. But if the product vanishes it must be that there is a j, 1 ≤ j ≤ n, such
that xj = −1. Now x = exp (2πiµ/m), where 1 ≤ µ ≤ m − 1, so xj is exp (2πijµ/m), and
this must be equal to −1. Thus we must have 2jµ/m = 2k + 1. Hence, for each integer µ,
1 ≤ µ ≤ m − 1 there exists a j, 1 ≤ j ≤ n, such that 2jµ/m is an odd integer.
Suppose m > 2n. Then take µ = 1. We have 2jµ/m < 2jµ/2n = j/n ≤ 1. Hence
2jµ/m cannot be an odd integer, a contradiction. So m must be a power of 2 that is ≤ 2n.
Conversely, suppose m ≤ 2n and m is a power of 2. Choose µ, 1 ≤ µ ≤ m − 1. Then
we can choose j to be the largest power of 2 that is ≤ n, say j = 2b . With that choice
we have 2jµ/m = jµ/(m/2). But the denominator is a power of 2 that is ≤ n. Hence
j/(m/2) is an integer.
For the positive direction of this theorem, we can give a bijective proof: Use induction
on n. First suppose n is not a power of 2, say 2i < n < 2i+1 . Any subset of [n] is either
a subset of [n − 1] or is obtained from such a subset by adjoining n. By the induction
hypothesis, the subset-sums from [n − 1] are equidistributed modulo 2i+1 , and hence so
are the subset-sums from [n].
Now suppose we are dealing with subsets of [2i ]. The induction hypothesis tells us
that the subset-sums from [2i − 1] are equidistributed modulo 2i . If fj denotes the number
of subsets whose mod-2i+1 sum is j, then this means that

f0 + f2i = f1 + f1+2i = f2 + f2+2i = · · · = f2i −1 + f2i+1 −1 .

Now consider the function that takes a subset of [2i ] and deletes 2i if 2i is in the subset,
and adjoins 2i otherwise. This is a bijection and its effect on the mod-2i+1 value of the
the electronic journal of combinatorics 1 (1994), #R3 12

sum of a set is to add ±2i , which is the same as adding 2i . This bijection therefore shows
that each fj = fj+2i , which combines with the equations above to yield equidistribution.

5. Asymptotics of the distribution for the power set

We work out an exact and an asymptotic expression for the standard deviation,
σ(n, m), of the occupancies of the residue classes modulo m in the power set case. It
shows that the ratio of standard deviation to mean goes to zero exponentially, for fixed
m, as n → ∞, at least in the case where n goes to ∞ through multiples of m. The rate
at which the ratio approaches zero depends on the smallest odd prime factor of m, which
refines the fact, discussed in the previous section, that for equidistribution m must be a
power of 2.

Theorem. Fix an integer m > 0.


(a) If m is a power of 2, then σ(n, m) = 0 if n is a multiple of m.
(b) If m is not a power of 2, and the odd part of m, say m00 , is prime, then when n is
a multiple of m we have

σ(n, m) m00 − 1
= n(1−1/m00 ) .
mean(n, m) 2

(c) If m is not a power of 2, and the odd part of m, say m00 , is composite, then
asymptotically, as n → ∞ through multiples of m, we have
σ(n, m)
∼ 2−n(1−1/p2 ) ,
mean(n, m)
where p2 is the smallest odd prime factor of m.

For n, m fixed, let c(n, m, j) be the number of subsets of [n] whose sum is j modulo
m. Then we know that

def
X
m−1 Y
n
fn,m (q) = c(n, m, j)q =j
(1 + q j ) (modulo q m − 1),
j=0 j=1

which means that

def Y
n
gn (q) = (1 + q j ) = p(q)(q m − 1) + fn,m (q),
j=1

for some polynomial p. Now it is well known and easy to check that if f (q) is any real
polynomial of degree m − 1, then the sum of the squares of the coefficients of f is equal to
1 X
|f (ω)|2 .
m ω m =1
the electronic journal of combinatorics 1 (1994), #R3 13

Hence
X
m−1
1 X
c(n, m, j)2 = |gn (ω)|2 .
m ω m =1
j=0

Now we will suppose that n is a multiple of m, say n = km. Then, if ω = e2πir/m is


a fixed mth root of unity, the sequence {ωj }j≥0 is periodic in j of period m. Hence

Y
n
¡Y
m
¢k ¡Y
m
πrj ¢k
|gn (ω)| = |(1 + ω )| =
j
|(1 + ω )|
j
= |2 cos | .
m
j=1 j=1 j=1

Suppose (r, m) = 1. Then in the last product above, rj runs through a complete
system of residues modulo m, so in that case

Y
m
πrj Ym
πj n
2 if m is odd;
|2 cos |= |2 cos | =
m m 0 if m is even.
j=1 j=1

If, on the other hand, (r, m) = d ≥ 1, then put m0 = m/d, r0 = r/d, and find
¯ mY0 ¯d ½
Y
m−1
¡ πjr0 ¢ ¯ −1 πj ¯ d
if m0 is odd;
|gn (ω)| = | 2 cos 0 | = ¯¯ (2 cos 0 )¯¯ = 2
j=0
m j=0
m 0 if m0 is even.

Now for the variance of the occupancy numbers, when n = km, we have

1 X 1 X
m−1 m−1
σ 2 (km, m) = |g (ω
n r )| 2
= |gm (ωr )|2k
m2 r=1 m2 r=1
m −1 00 (7)
1 X
m−1
1 X k2a+1 gcd(m00 ,r00 )
2k gcd(m,r)
= 2 2 = 2 2 ,
m r=1
m 00
r =1
m/(m,r) odd

where m = 2a m00 , m00 odd.


Now, as r00 runs through its range, in the last displayed sum, the largest possible value
that the gcd can take is m00 /p2 , where p2 is the smallest prime factor of m00 , unless m00 is
itself prime. In the former case, m00 is the odd part of m, so p2 = p2 (m) is the smallest odd
prime factor of m. In the case where m00 is prime, the last member of (7) above is exactly
00
(m00 − 1)22n/m /m2 .
Suppose the odd part of m is not prime. Then asymptotically, as k → ∞, n = km,
we have
1 a+1 00 22mk/p2 22n/p2
σ2 (km, m) ∼ 2 2k2 m /p2 = = .
m m2 m2
Since the mean occupancy of a residue class is 2n /m, we have

σ(km, m)
∼ 2−n(1−1/p2 ) ,
mean(km, m)
the electronic journal of combinatorics 1 (1994), #R3 14

as claimed.
If the odd part of m is prime then we have an exact evaluation, as stated in the
theorem above.

6. Questions

1. Can the negative direction of the theorem, i.e. that (3) ⇒ (1), be given an elementary
proof?
2. We have shown that for the full power set, the standard deviation of the distribution is
an asymptotically vanishing fraction of the mean, on certain subsequences of n → ∞. Is
the same true in the case of t-subsets of [n]?
3. THE PRIME MODULUS CONJECTURE. Let f(n, t, m) denote the entire sequence
of frequencies {f(i, n, t, m)}m−1
i=0 . For an odd prime modulus p, computations suggest that
f (n, t, m) is a unimodal sequence, provided we shift to start at the minimum frequency.
This means that the frequencies would then go from a minimum to a maximum and
then back to the minimum, with no direction changes except at the maximum. We will
henceforth use the term d-wave for a sequence of d integers that is unimodal after a shift.
Note that if p > t(n − t), then the mod-p reduction disappears from the problem and
this conjecture is a consequence of the classical unimodality result about the Gaussian
polynomials (see [7]).
4. Given (n, t, m) and a divisor d of m with d > 1. Say that d is good if t̄ > n̄ (mod
d); otherwise d is bad. This question and the following one are attempts to explain and
quantify the observed link between the shape of the frequency vector f(n, t, m) and the
shapes of f (n, t, d) for bad divisors d of m. First note that if there are no bad divisors,
then the main theorem applies and f (n, t, m) is constant.
Consider the case where m has a single bad divisor, d. Computations lead to the following
two conjectures:
(a) If d = m, then f (n, t, m) is an m-wave, as conjectured for prime moduli in
Question 3.
(b) f (n, t, m) = (d/m)f (n, t, d)∗, where ∗ denotes a periodic extension that turns the
d-vector into an m-vector.
At present the simple formula in (b) remains a conjecture. Statements (a) and (b) together
imply that the wave behavior for primes holds whenever there is only one bad divisor of m
(see the third panel of Figure 3 for an example of this situation with (n, t, m) = (36, 13, 48)
and the only bad divisor being 48).
5. We now formulate a general conjecture that attempts to explain the overall shape of
the frequency sequence f (n, t, m) by positing a Fourier-like decomposition of f(n, t, m)
into components (waves) corresponding to the bad divisors of m.
ˆ t, d), such
The General Conjecture. For every triple (n, t, d), there is a d−wave, f(n,
that, for every triple (n, t, m) (m > 1) we have
X
f (n, t, m) = ˆ t, d)∗,
Cd f(n,
d∈β(m)
the electronic journal of combinatorics 1 (1994), #R3 15

where the Cd ’s are rational, and “*” indicates that the d-wave is to be extended periodically
to an m-sequence, and β(m) is the set of bad divisors of m.
The idea behind this formulation is that fˆ(n, t, m) captures the essence of the mod-m
nonuniformities in f (n, t, m) caused by m, as opposed to those caused by bad divisors of
m. Note first that, if this conjecture is true and p is prime, then f (n, t, p) = Cp fˆ(n, t, p).
Thus f (n, t, p) has the shame shape as fˆ(n, t, p) and f (n, t, p) is a p-wave, which settles
the Prime Moduli Conjecture (Question 3). Moreover, if m has a single bad divisor then
f (n, t, m) is a periodic extension of a d-wave, as conjectured in Question 4.
As an illustration of the case of two bad divisors, consider (n, t, m) = (26, 9, 15); the bad
divisors are 3 and 15, and we can take

ˆ
f(26, 9, 3) = f(26, 9, 3) = {1041554, 1041498, 1041498},

fˆ(26, 9, 5) = f (26, 9, 5) = {624910, 624910, 624910, 624910, 624910}.


ˆ
In order to find f(26, 9, 15), we used trial and error to discover that 11/56 works as the
ˆ
constant C3 . In other words, f (26, 9, 15) − (11/56)f(26, 9, 3) turns out to be a 15-wave,
so we take it as the definition of fˆ(26, 9, 15); moreover, 11/56 appears to be the unique
constant that works in this case. To summarize,

ˆ 11 ˆ
f (26, 9, 15) = f(26, 9, 15) + f(26, 9, 3)
56

is a decomposition of the frequency vector into a 15-wave and a 3-wave. We have not been
able to identify any pattern in the coefficients that arise in such decompositions.

References
1. L. Comtet, Advanced Combinatorics, Dordrecht: D. Reidel, 1974.
2. D. E. Knuth and H. S. Wilf, The power of a prime that divides a binomial coefficient,
J. für die reine u. angew. Math. 396 (1989), 212-219.
3. G. Pólya and G. L. Alexanderson, Gaussian binomial coefficients, Elem. der Math.
26 (1971), 102-109.
4. H. Snevily, Subsets whose sums are congruent, Problem E3472, Amer. Math. Monthly
100 (1993), 503.
5. D. Zeilberger, Kathy O’Hara’s constructive proof of the unimodality of the Gaussian
coefficients, Amer. Math. Monthly 96 (1989), 590-602.

You might also like