Page 1

DOI: 10.1007/s00453-001-0047-1

Algorithmica (2001) 31: 413–432

Algorithmica

© 2001 Springer-Verlag New York Inc.

Exact Largest and Smallest Size of Components1

D. Panario2and B. Richmond3

Abstract.

equal to k. They give explicit expressions on ranges n/(i + 1) < k ≤ n/i for i = 1,2,..., derive a general

recurrence for the number of permutations of size n with largest cycle length equal to k, and provide the

contribution of the ranges (n/(i + 1),n/i] for i = 1,2,..., to the expected length of the largest cycle.

Weviewacycleofapermutationasacomponent.Weprovideexactcountsforthenumberofdecomposable

combinatorial structures with largest and smallest components of a given size. These structures include per-

mutations, polynomials over finite fields, and graphs among many others (in both the labelled and unlabelled

cases). The contribution of the ranges (n/(i +1),n/i] for i = 1,2,..., to the expected length of the smallest

and largest component is also studied.

Golomb and Gaal [15] study the number of permutations on n objects with largest cycle length

KeyWords.

class.

Largestandsmallestcomponents,Randomdecomposablecombinatorialstructures,Exponential

1. Introduction.

with finding the largest or smallest “prime” component. The algorithms we have in mind

here are structurally similar to the school method of decomposing a number into primes.

For instance, the factorization of polynomials over finite fields can be performed by

finding irreducible factors of degree 1,2,..., the so-called distinct-degree factoriza-

tion. This process halts when the irreducible factor of largest degree is found (see [12,

Chapter 14] and [13] for up-to-date accounts on factorization algorithms). The average-

case analysis of this algorithm involves the study of the expected largest degree among

the irreducible factors of a random polynomial (see [6]).

The same algebraic property used in the distinct-degree factorization stage of the

factoring process can be used to derive a fast algorithm for finding irreducible poly-

nomials over finite fields (see [1] and [12, Chapter 14]). This is an important problem

when implementing extension fields (a crucial step for cryptographical applications).

For the analysis of this algorithm one should find the expected smallest degree among

the irreducible factors of a random polynomial (see [20]).

We would like to have a better understanding of how often these large and small

degreeirreduciblefactorsappear.Inaddition,wehavesituationswherenoconcentration

results occur, and thus, average-case analysis may not provide an accurate picture of

Some algebraic algorithms have stopping conditions that are related

1The work of the first author was done while he was with the Department of Computer Science, University

of Toronto.

2School of Mathematics and Statistics, Carleton University, 1125 Colonel By Drive, Ottawa, Canada K1S

5B6. daniel@math.carleton.ca.

3Department of Combinatorics and Optimization, University of Waterloo, Waterloo, Canada N2L 3G1.

lbrichmond@watdragon.uwaterloo.ca.

Received June 27, 2000; revised October 8, 2000. Communicated by R. Kemp and H. Prodinger.

Online publication August 9, 2001.

Page 2

414D. Panario and B. Richmond

the behaviour of the algorithm. For instance, the expected smallest degree in a random

polynomial is c1logn but its variance is c2n, for constants c1,c2. Therefore, the exact

number of polynomials over finite fields of degree n with largest or smallest irreducible

factor of degree k provides additional interesting information.

The similar problem of counting permutations on n objects with largest cycle length

equal to k was analysed by Golomb and Gaal [15]. They provide:

• explicit expressions for the number of permutations on n objects with largest cycle

length equal to k on the ranges n/(i + 1) < k ≤ n/i for i = 1,2,...;

• ageneralrecurrenceforthenumberofpermutationsofsizen withlargestcyclelength

equal to k; and

• the contribution of the ranges (n/(i +1),n/i] for i = 1,2,..., to the expected length

of the largest cycle.

In this paper we generalize Golomb and Gaal’s work to provide exact extremal prop-

erties in random decomposable combinatorial structures. We have in mind objects that

decompose into “primes”. Typical examples are the decomposition of permutations into

a set of cycles, of polynomials over finite fields into a multiset of irreducible factors, of

graphsintoasetofconnectedcomponents,etc.Weareinterestedinthesamekindofprop-

ertiesasGolombandGaalbutforthenumberofobjectsofsizen withlargestsizeofcom-

ponents exactly equal to k. We also derive equivalent results for the smallest component.

Unfortunately, our motivation in the case of polynomials over finite fields does not

seem to apply to other decomposable structures like permutations and graphs. There are

efficient methods for decomposing a permutation into cycles or a graph into connected

components that do not involve a similar process to the one in factoring a number into

its primes. In any case, the problem of exact counting extremal properties for these

decomposable structures deserves to be studied for its intrinsic interest.

We now comment on the contents of the paper. Section 2 briefly introduces the

exponential class that covers a large number of combinatorial structures of interest. Our

studyoflabelledstructuresisinSection3.Westateexplicitexpressionsforthenumberof

labelledobjectsofsizen withlargest(andsmallest)sizeofcomponentsexactlyequaltok

fortherangesn/(i+1) < k ≤ n/i,i = 1,2,....Thenwederiveageneralrecurrencefor

the number of labelled objects of size n with largest (and smallest) size of components

exactly equal to k in terms of smaller (respectively larger) sizes. Similar results for

unlabelled objects are obtained in Section 4. The application of our theorems to several

combinatorial structures included in the exponential class is presented in Section 5. We

also provide the contribution of the ranges (n/(i + 1),n/i] for i = 1,2,..., to the

expected size of the largest and smallest component for both labelled and unlabelled

structures. These contributions give useful information related to how often the largest

and smallest components occur.

We finish this section by fixing the notation that we use throughout the paper. The

generating functions of objects with largest irreducible component of size k are denoted

by L?

[zn]L?

weuse Ls

Moreover, for labelled structures we use exponential generating functions while for

unlabelled structures we use ordinary generating functions.

k(z) and U?

k(z) = L?

k(z),Us

k(z), for the labelled and unlabelled case, respectively, with coefficients

k,nand [zn]U?

k(z), Ls

k(z) = U?

k,nandUs

k,n. For smallest irreducible components of size k

k,n,againforlabelledandunlabelledcases,respectively.

Page 3

Exact Largest and Smallest Size of Components415

2. Exponential Class.

intoirreduciblecomponents.Forinstance,polynomialsoverfinitefieldsdecomposeinto

irreduciblefactors,permutationsintocycles,graphsintoconnectedcomponents,etc.We

consider these problems for labelled and unlabelled objects.

We consider exponential generating functions when the structures are labelled, and

thus we have for the components C(z) =?

?

Then the exponential generating function of objects formed with components of size at

most k is

?

i=1

We immediately obtain the exponential generating function for the objects formed with

components of largest size exactly equal to k:

?

i=1

?k−1

i=1

In the same way we can obtain the exponential generating function of objects formed

with components of size at least k:

??

The exponential generating function for the objects formed with components of smallest

size exactly equal to k is then

??

??

When the structures are unlabelled, using ordinary generating functions, we have for

the components C(z) =?

?

In many situations combinatorial objects decompose uniquely

kckzk/k!. It is well known [10] that the

exponential generating function L(z) for the labelled objects satisfies

L(z) =

n

?n

zn

n!= exp(C(z)).

(1)

exp

k ?

cizi/i!

?

.

L?

k(z) = exp

k ?

?

cizi/i!

?

??

− exp

?k−1

i=1

?

cizi/i!

?

(2)

= exp

cizi/i!

eckzk/k!− 1

?

.

exp

i≥k

cizi/i!

?

.

Ls

k(z) = exp

i≥k

cizi/i!

?

??

− exp

??

i≥k+1

cizi/i!

?

(3)

= exp

i≥k

cizi/i!

1 − e−ckzk/k!?

.

kckzk. In this case, it is also well known (see for instance

[21]) that the ordinary generating function U(z) for the unlabelled objects satisfies

?

U(z) =

n

unzn= exp

C(z) +C(z2)

2

+C(z3)

3

+ ···

?

.

(4)

Page 4

416D. Panario and B. Richmond

Another expression for the ordinary generating function of unlabelled objects is well

known to be

?

In the same vein, the ordinary generating function of objects formed with components

of size at most k is

?

The generating function for the objects formed with components of largest size exactly

equal to k is

U(z) =

∞

i=1

?

1

1 − zi

?ci

.

k ?

i=1

1

1 − zi

?ci

.

U?

k(z) =

k ?

∞

?

i=1

?

?

1

1 − zi

1

1 − zi

?ci

?ci ?

−

k−1

?

i=1

?

?

1

1 − zi

1

1 − zi

?ci

?−ci

=

k ?

(1 − (1 − zk)ck).

i=1

?

1

1 − zi

?ci

(1 − (1 − zk)ck)

(5)

=

i=1

i≥k+1

The ordinary generating function of objects formed with components of smallest size

exactly equal to k is

?

?

When no component is allowed to repeat and Q(z) denotes the ordinary generating

function, we obtain

?

We note that the objects we are considering in both the labelled and unlabelled case

have generating functions that can be expressed in terms of the exponential function.

Thus, we now define the exponential class for generating functions.

Us

k(z) =

?

i≥k

1

1 − zi

1

1 − zi

?ci

?ci

−

?

i≥k+1

?

1

1 − zi

?ci

(6)

=

i≥k

?

(1 − (1 − zk)ck).

Q(z) =

?

n

unzn= exp

C(z) −C(z2)

2

+C(z3)

3

− ···

?

.

(7)

DEFINITION 1.

irreducible components. If one of (1), (4) or (7) holds, then the objects are said to be in

the exponential class.

Let C(z) be the (ordinary or exponential) generating function for the

Many authors give definitions for classes of combinatorial objects. Flajolet and Soria

[10] define a similar combinatorial class, the exp-log class. The main difference with

our definition is that they are interested in making explicit the type of singularity of

the generating function of the components in order to use asymptotic techniques like

Page 5

Exact Largest and Smallest Size of Components417

singularity analysis (see [8]). On the other hand, we are not concerned with singularities

in this paper since our focus is on exact combinatorial counting rather than asymptotic

analysis; thus, we drop the logarithmic type of the components. However, since our

results also apply to the exp-log class, several examples of configurations in that class

are studied in Section 5.

The same authors also define the alg-log class (see [11]). Other authors presenting

settingsinwhichgeneratingfunctionsoftheform A(C(z))arise,withC(z)thegenerating

function for the irreducible components, are Cameron [4] (see also [3]) and Labelle and

Leroux [19]. In this paper we only consider the exponential class as defined above.

3. Labelled Objects.

fore all generating functions are of exponential type. The connection between objects

and components given in (1) is used extensively.

In this section we concentrate on labelled structures and there-

3.1. Largest Labelled Case

THEOREM 2.

size n having largest size of irreducible components equal to k. Then if n/2 < k ≤ n we

have

Let L?

k(z) be the exponential generating function for labelled objects of

n![zn]L?

k(z) =

?n

k

?

ck?n−k;

(8)

in the range n/3 < k ≤ n/2 we have

n![zn]L?

k(z) = n!ck

k!

?

?n−k

(n − k)!−

ck

2k!

?n−2k

(n − 2k)!−

n−k

?

i=k+1

ci

i!

?n−k−i

(n − k − i)!

?

;

(9)

in the range n/4 < k ≤ n/3 we have

n![zn]L?

k(z) = n!ck

k!

?

?n−k

(n − k)!−

n−k

?

+1

2

i=2k

ck

2k!

?n−2k

(n − 2k)!−

c2

k

3(k!)2

?n−3k

(n − 3k)!

(10)

−

i=k+1

n−k

?

ci

i!

?i−k

j=k

?n−k−i

(n − k − i)!−

?

n−2k

?

?

(n − k − i)!

i=k+1

ci

i!

ck

2k!

?n−2k−i

(n − 2k − i)!

?

cj

j!

ci−j

(i − j)!

?n−k−i

;

and so on, where cnand ?nare the coefficients of znin n!C(z) and n! L(z), respectively.

For the coefficients of L?

k(z), we have the recurrence

L?

k,n=

?n/k?

?

i=1

ci

i!

k

n!

(k!)i(n − ki)!

min{k−1,n−ki}

?

j=1

L?

j,n−ki,

(11)

for k > 1, with L?

1,n= cn

1.

Page 6

418D. Panario and B. Richmond

PROOF. Recall (2). Using (1) we obtain

L?

k(z) = exp

?

∞

?

i=1

cizi/i! −

?

i=k

∞

?

∞

?

i=k

cizi/i!

??

eckzk/k!− 1

?

= L(z)exp

−

∞

?

cizi/i!

??

eckzk/k!− 1

?

= exp

?

−

i=k

cizi/i!

??

eckzk/k!− 1

???

j≥0

?j

zj

j!

?

.

Consider first the range n/2 < k ≤ n. Extracting coefficients we obtain

k(z) = [zn]ckzk

[zn]L?

k!

?

j≥0

?j

zj

j!=ck

k!

?n−k

(n − k)!.

Since we have an exponential generating function, we finally have

n![zn]L?

k(z) =

?n

k

?

ck?n−k,

with the obvious interpretation as an irreducible component of size k and an object of

size n − k. This proves (8).

We now consider the range n/3 < k ≤ n/2. Extraction of coefficients provides

??

i≥k

ck

k!2(k!)2

[zn]L?

k(z) = [zn]1 −

?

cizi/i!

??ckzk

k!

+c2

kz2k

2(k!)2

??

ck

k!

j≥0

?j

zj

j!

?

=

?n−k

(n − k)!+

c2

k

?n−2k

(n − 2k)!−

n−k

?

i=k

ci

i!

?n−k−i

(n − k − i)!.

We conclude that in this range

n![zn]L?

k(z) = n!ck

k!

?

?n−k

(n − k)!−

ck

2k!

?n−2k

(n − 2k)!−

n−k

?

i=k+1

ci

i!

?n−k−i

(n − k − i)!

?

.

This expression can be interpreted as an inclusion–exclusion formula when n/3 < k <

n/2. Indeed, the number of objects of size n with largest irreducible component of size

k with n/3 < k < n/2 can be obtained by considering all objects with an irreducible

component of size k (first term) minus all objects with another irreducible component

with size from k up to n − k (the other two terms). In the case k = n/2, this formula

is not an inclusion–exclusion formula due to the possibility of two components of size

n/2. We have proven (9).

We consider one more range, that is a k such that n/4 < k ≤ n/3. Extracting

coefficients we obtain

i≥k

[zn]L?

k(z) = [zn]

1 −

?

cizi/i! +1

2

??

i≥k

cizi/i!

?2

Page 7

Exact Largest and Smallest Size of Components419

×

?ckzk

k!

+c2

kz2k

2(k!)2+c3

kz3k

6(k!)3

??

c2

k

3(k!)2

j≥0

?j

zj

j!

?

=

ck

k!

?

?n−k

(n − k)!−

n−k

?

+1

2

i=2k

ck

2k!

?n−2k

(n − 2k)!−

?n−3k

(n − 3k)!

−

i=k+1

n−k

?

ci

i!

?i−k

j=k

?n−k−i

(n − k − i)!−

?

ck

2k!

?

n−2k

?

?n−k−i

(n − k − i)!

i=k+1

ci

i!

?n−2k−i

(n − 2k − i)!

?

cj

j!

ci−j

(i − j)!

.

Equation (10) follows after multiplying the last expression by n!.

Asweadvanceoni andconsiderrangesn/(i+1) < k ≤ n/i theinclusion–exclusion

formulas get more and more involved. Therefore, we derive a recurrence relation for

L?

components of largest size equal to k, and consider first the case k = 1. Since the largest

componenthassize1,theobjectisformedbyn componentseachofsize1.Inourgeneral

context, the number of such objects is given by

?n

since we have to choose the n fixed points, for each one we have c1possibilities, and we

have to divide by n! due to the fact of being labelled objects. Therefore, L?

usefultobearinmindthepermutations.Inthatcase,wewantthenumberofpermutations

with all points fixed; clearly, c1= 1 and that quantity is 1.

For the case k > 1, we can have i components of size k, 1 ≤ i ≤ ?n/k?. The number

of objects is

k,n, 1 ≤ k ≤ n. Recall that L?

k,ndenote the number of labelled objects of size n with

cn

n!

1

1

??n − 1

1

?

···

?1

1

?

,

1,n= cn

1. It is

ci

i!

k

?n

k

??n − k

k

?

···

?n − ki + k

k

?

=ci

k

i!

n!

(k!)i(n − ki)!.

We combine this last expression with the number of objects with the remaining n − ki

elements not considered in the i components of size k. For that we use largest size j

with j = min{k − 1,n − ki}. This proves (11).

3.2. Smallest Labelled Case.

structures.

We focus now on the exact smallest size of labelled

THEOREM 3.

size n having smallest size of irreducible components equal to k. Then if n/2 < k ≤ n

we have

?

0

Let Ls

k(z) be the exponential generating function for labelled objects of

n![zn]Ls

k(z) =

ck

if

if

k = n;

n/2 < k < n;

(12)

Page 8

420D. Panario and B. Richmond

in the range n/3 < k ≤ n/2 we have

n![zn]Ls

k(z) =

?1

2

?n

?n

k

k

?c2

k

if

if

n = 2k;

n/3 < k < n/2;

?cn−kck

(13)

in the range n/4 < k ≤ n/3 we have

n![zn]Ls

(14)

and so on, where cnand ?nare the coefficients of znin n!C(z) and n! L(z), respectively.

For the coefficients of Ls

?

i!

(k!)i(n − ki)!

where the notation [S] means 1 if S is integral and 0 otherwise.

k(z)

?

?

=

n!

c3

n/3

6((n/3)!)3+

cn/3

(n/3)!

c2n/3

(2n/3)!

?

ifn = 3k;

n!

cn−k

(n − k)!

ck

k!+1

2

ck

k!

n−2k

?

j=k+1

cj

j!

cn−k−j

(n − k − j)!

?

ifn/4 < k < n/3;

k(z), we have the recurrence

Ls

k,n=

?n/k?

?

i=1

ci

k

n!

n−ki

?

j=k+1

Ls

j,n−ki

?

+ [n/k]

cn/k

k

(n/k)!

n!

(k!)n/k,

(15)

PROOF. Consider (3). In the range n/2 < k ≤ n we have

??

i≥k

Since we have an exponential generating function, we finally have, for k = n,

n![zn]Ls

[zn]Ls

k(z) = [zn]1 +

?

ci

zi

i!

??ckzk

k!

??

=

?

ck/k!

0

if

if

k = n;

n/2 < k < n.

k(z) = n!cn

n!= cn,

that is, the number of objects of size n with smallest size of component equal to n is cn.

Note that we cannot have objects of size n with smallest size of irreducible component

equal to k in the range n/2 < k < n, and thus the number of these objects should be

zero. This proves (12).

We now consider the range n/3 < k ≤ n/2. Extracting coefficients we obtain

??

i≥k

Aftermultiplicationbyn!weobtain(13).Theseexpressionscanbeinterpretedasfollows.

For an object of size n with smallest irreducible component of size k, n/3 < k < n/2,

[zn]Ls

k(z) = [zn]1 +

?

cizi/i!

??ckzk

k!

−c2

kz2k

2(k!)2

??

=

c2

k

2(k!)2

cn−k

(n − k)!

if

n = 2k;

n/3 < k < n/2.

ck

k!

if

Page 9

Exact Largest and Smallest Size of Components421

the only possibility is to be formed by two irreducible components, one of size k and

the other of size n − k. On the other hand, if the smallest size is k = n/2, it can only

be formed by two irreducible components of size n/2, and since we are double counting

we have to divide by two.

We consider one more range, that is a k such that n/4 < k ≤ n/3. Extracting

coefficients we obtain

i≥k

?ckzk

where we have collected appropriate terms. The interpretation of this last formula is

clear: an object of size n with smallest component of size k, n/4 < k ≤ n/3, can be

formed by one component of size k and another of size n −k, or by three components at

least one of them having size k and the other two with a compound size of n −k and no

one with size smaller than k. Equation (14) follows after multiplying the last expression

by n!.

We now derive a recurrence relation for Ls

number of labelled objects of size n with components of smallest size equal to k. Then,

in a similar way to (11), we have

?

i!

(k!)i(n − ki)!

where the notation [n/k] means 1 if n is a multiple of k and 0 otherwise. The basis in

this case is when k = n, where we obtain Ls

[zn]Ls

k(z) = [zn]

1 +

?

cizi/i! +1

2

??

i≥k

cizi/i!

?2

×

k!

−c2

kz2k

2(k!)2+c3

kz3k

6(k!)3

?

=

c3

n/3

6((n/3)!)3+

cn−k

(n − k)!

cn/3

(n/3)!

ck

k!

c2n/3

(2n/3)!

n−2k

?

if

n = 3k;

ck

k!+1

2

j=k+1

cj

j!

cn−k−j

(n − k − j)!

if

n/4 < k < n/3,

k,n, 1 ≤ k ≤ n. Recall that Ls

k,ndenote the

Ls

k,n=

?n/k?

?

i=1

ci

k

n!

n−ki

?

j=k+1

Ls

j,n−ki

?

+ [n/k]

cn/k

k

(n/k)!

n!

(k!)n/k,

n,n= cn, as expected.

4. Unlabelled Objects.

dinary generating functions. We recall that U?

atingfunctionsforunlabelledobjectswithlargestandsmallestirreduciblecomponentof

size k, respectively. Consider (5) and (6) for the generating functions U?

respectively.

We concentrate now on unlabelled structures so we have or-

k(z) and Us

k(z) denote the ordinary gener-

k(z) and Us

k(z),

4.1. Largest Unlabelled Case

THEOREM 4.

size n having largest size of irreducible components equal to k. Then if n/2 < k ≤ n

Let U?

k(z) be the ordinary generating function for unlabelled objects of

Page 10

422 D. Panario and B. Richmond

we have

[zn]U?

k(z) = ckun−k;

(16)

in the range n/3 < k ≤ n/2 we have

[zn]U?

k(z) = ckun−k−

?ck

2

?

un−2k− ck

n−k

?

i=k+1

ciun−k−i;

(17)

in the range n/4 < k ≤ n/3 we have

[zn]U?

k(z) = ckun−k−

?ck

2

?

un−2k− ck

n−k

?

i=k+1

ciun−k−i+

?ck

3

?

un−3k

(18)

+

?ck

2

?n−2k

?

?

i=k+1

n−k

ciun−2k−i−ck

?i−(k+1)

j=k+1

2

?

?(n−k)/2?

?

i=k+1

ciun−k−2i

+ck

2

i=2k+2

?

cjci−j

un−k−i;

and so on, where cnand unare the coefficients of znin C(z) and U(z), respectively.

PROOF.

of (5), we obtain

Recall (5). Using (4) for the restricted range i ≥ k + 1 in the second product

U?

k(z) = U(z)exp

?

−

?

i≥k+1

cizi−1

2

?

i≥k+1

ciz2i− ···

?

(1 − (1 − zk)ck).

Consider first the range n/2 < k ≤ n. Extracting coefficients we obtain

[zn]U?

k(z) = ckun−k.

The interpretation here is: an object of size n with an irreducible component of size k,

n/2 < k ≤ n, is formed by an irreducible component of size k and an object of size

n − k. This proves (16).

We now consider the range n/3 < k ≤ n/2. Extraction of coefficients provides

??

i≥k+1

?ck

[zn]U?

k(z) = [zn]1 −

?

?

cizi

??

ckzk−

?ck

2

?

z2k

??

j≥0

ujzj

?

= ckun−k−

2

un−2k− ck

n−k

?

i=k+1

ciun−k−i.

We bring the attention of the reader to (1) and (4). The difference between labelled

and unlabelled structures given by the extra exponential terms results in expressions

somewhat simpler in the labelled cases. Indeed, we now show this effect in the first

Page 11

Exact Largest and Smallest Size of Components423

range where it appears. Extracting coefficients for the range n/4 < k ≤ n/3, we

obtain

[zn]U?

k(z) = [zn]

1 −

?

?

i≥k+1

cizi+1

2

??

?ck

i≥k+1

cizi

?2

−1

2

?

i≥k+1

ciz2i

×

ckzk−

?ck

2

?

z2k+

3

?

z3k

??

j≥0

ujzj

?

= ckun−k−

?ck

2

?

un−2k− ck

n−k

?

i=k+1

ciun−k−i+

?ck

3

un−3k

+

?ck

2

?n−2k

?

?

i=k+1

n−k

ciun−2k−i−ck

?i−(k+1)

j=k+1

2

?

?(n−k)/2?

?

i=k+1

ciun−k−2i

+ck

2

i=2k+2

?

cjci−j

un−k−i.

As in the largest labelled case, an inclusion–exclusion formula emerges. Indeed, the

numberofobjectsofsizen withlargestirreduciblecomponentofsizek,n/4 < k ≤ n/3,

can be computed by considering all objects with an irreducible component of size k, first

term in (18), minus the objects with two irreducible components, at least one of them

of size k, second and third terms, plus the objects with three irreducible components (at

least one of them of size k), the remaining terms in (18).

Note that in the term involving ciun−k−2i we have ci components of size i occur-

ring exactly twice. This is the essential difference between labelled and unlabelled

counting.

4.2. Smallest Unlabelled Case

THEOREM 5.

size n having smallest size of irreducible components equal to k. Then if n/2 < k ≤ n

we have

?

0

Let Us

k(z) be the ordinary generating function for unlabelled objects of

[zn]Us

k(z) =

ck

if

if

k = n;

n/2 < k < n;

(19)

in the range n/3 < k ≤ n/2 we have

[zn]Us

k(z) =

?ck+ 1

cn−kck

2

?

ifn = 2k;

n/3 < k < n/2;

if

(20)

Page 12

424D. Panario and B. Richmond

in the range n/4 < k ≤ n/3 we have

[zn]Us

k(z) =

cn/3c2n/3+

cn−kck+ck

?ck+ 2

n−2k

?

?ck

3

?

ifn = 3k;

2

j=k

cjcn−k−j

?

−cn−2k

2

+ck

2c(n−k)/2

ifn/4 < k < n/3;

(21)

and so on, where cnand unare the coefficients of znin C(z) and U(z), respectively, and

c(n−k)/2is zero if n − k is an odd integer.

PROOF. Again we start from (6). Using (4) for the restricted range i ≥ k, we obtain

??

Consider first the range n/2 < k ≤ n. Extracting coefficients we obtain

[zn]Us

0

Us

k(z) = exp

i≥k

cizi+1

2

?

i≥k

ciz2i+ ···

?

(1 − (1 − zk)ck).

k(z) =

?ck

if

if

k = n;

n/2 < k < n.

As we commented in the labelled case, we cannot have objects of size n with smallest

size of irreducible component equal to k in the range n/2 < k < n, and thus the number

of these objects should be zero. This proves (19).

We now consider the range n/3 < k ≤ n/2. Extraction of coefficients provides

??

i≥k

i≥k

?

cn−kck+ck

2

j=k

−cn−2k

2

[zn]Us

k(z) = [zn]1 +

?

cizi

??

ckzk−

?ck

2

?

z2k

??

=

?ck+ 1

cn−kck

2

?

if

n = 2k;

n/3 < k < n/2.

if

We consider the range n/4 < k ≤ n/3. Extracting coefficients we obtain

[zn]Us

k(z) = [zn]

1 +

?

cizi+1

2

??

i≥k

cizi

?2

+1

?

2

?

i≥k

ciz2i

×

ckzk−

?ck+ 2

n−2k

?

?ck

?ck

2

?

?

z2k+

?ck

3

?

z3k

=

cn/3c2n/3+

3

if

n = 3k;

cjcn−k−j

?

+ck

2c(n−k)/2

if

n/4 < k < n/3.

Page 13

Exact Largest and Smallest Size of Components 425

Here, c(n−k)/2is zero if n − k is an odd integer. Again, as in the largest unlabelled case,

the extra exponential terms in unlabelled situations start appearing in this range.

4.3. Recurrences for Unlabelled Objects.

currence relations for unlabelled objects using the labelled recurrences obtained in the

previous sections. We only do it for smallest components of size k.

In this section we show how to obtain re-

THEOREM 6.

belled objects of size n having smallest size of irreducible components equal to k, we

have the recurrence

?

i!

(k!)i(n − ki)!

For the coefficients of Us

k(z), the ordinary generating function for unla-

Us

k,n=

?n/k?

?

i=1

¯ ci

k

n!

n−ki

?

j=k+1

Us

j,n−ki

?

+ [n/k]

¯ cn/k

(n/k)!

k

n!

(k!)n/k,

(22)

where the notation [S] means 1 if S is integral and 0 otherwise, and

¯ ci= i!

?

j≥1

ci/j

j

,

with ci/j= 0 if j ? i.

PROOF.

irreducible components at least k is

The generating function of unlabelled objects of size n having smallest size of

exp

??

i≥k

cizi+1

2

?

i≥k

ciz2i+1

3

?

i≥k

ciz3i+ ···

?

.

This expression can be rewritten as

exp

??

i≥k

¯ cizi

i!

?

,

where

¯ ci= i!

?

k(z), that is,

?

??

j≥1

ci/j

j

,

with ci/j= 0 if j ? i. We are interested in Us

Us

k(z) = exp

??

??

i≥k

¯ cizi

i!

− exp

??

i≥k+1

¯ cizi

i!

?

= exp

i≥k

¯ cizi

i!

1 − e−¯ ck(zk/k!)?

.

Our recurrence for Ls

since their generating function then satisfies the same equation as Ls

k,ngiven in Theorem 3 holds for the Us

k,nwith cireplaced by ¯ ci

k(z).

Page 14

426D. Panario and B. Richmond

We note that a recurrence for the ¯ ci gives a recurrence for the ci. Indeed, if ¯ ci =

i!?

cj =

d|j

j≥1(ci/j/j), then

?

µ(d)

d

¯ cj/d

(j/d)!,

where µ is the well-known Moebius function.

5. Examples.

structures. We include a section about polynomials over finite fields. These data may be

of interest for practitioners in cryptography (see some possible applications for instance

in [6] and [20]).

This section exemplifies our results for several decomposable random

5.1. Labelled Structures in the exp-log Class.

exp-log class when studying the limit distributions of the number of components in

combinatorialstructures.Thisclassissimilartoourexponentialclasswiththeadditional

requirement that the generating function for the basic components have a singularity

of the logarithmic type. More precisely, we say that C(z) is of logarithmic type with

multiplicity constant a > 0 if

Flajolet and Soria [10] introduced the

C(z) = a log

?

1

1 − z/ρ

?

+ R(z),

where R(z) is analytic (see [21] for details).

The simplest possible example in this class is permutations viewed as a product of

cycles. The generating functions of permutations is well known to be

L(z) =

1

1 − z= exp

?

log

1

1 − z

?

.

Thus, L(z)isintheexponentialclass.Inthiscase,?k= k!andck= (k−1)!.Substituting

these quantities in our formulas of Theorem 2, we obtain the same results as in [15] for

the largest permutation.

In the following, we derive new results for permutations. If n/2 < k ≤ n we have

?

0

n![zn]Ls

k(z) =

(k − 1)! if

if

k = n;

n/2 < k < n;

in the range n/3 < k ≤ n/2 we have

n![zn]Ls

k(z) =

n!

2

1

(n/2)2

1

k(n − k)

if

n = 2k;

n!

if

n/3 < k < n/2;

Page 15

Exact Largest and Smallest Size of Components 427

in the range n/4 < k ≤ n/3 we have

The recurrence for the coefficients of Ls

n![zn]Ls

k(z) =

n!

?

?

1

6(n/3)3+

1

n/3

1

2n/3

?

k(z) is in this case

?

1

j

if

n = 3k;

n!

1

n − k

1

k+

1

2k

n−2k

j=k+1

1

n − k − j

?

if

n/4 < k < n/3.

Ls

k,n=

?n/k?

?

i=1

?

1

i!(k)i

n!

(n − ki)!

n−ki

?

j=k+1

Ls

j,n−ki

?

+ [n/k]

1

kn/k

n!

(n/k)!.

The expected value of the largest component is asymptotically λn, where λ =

0.62432965... is Golomb’s constant. This was proven for permutations by Golomb

[14]. Permutations are in the exp-log class with multiplicative constant a = 1. In his

thesis, Gourdon [16] generalized Golomb’s result. More precisely, he proved that the

expected largest component in the exp-log class with multiplicative constant a = 1 is

asymptotic to λn.

From Theorem 2, the contribution to λ from those components of size k in the range

n/2 < k ≤ n is

1

n?n

k=n/2+1

If the objects are in the exp-log class with multiplicative constant a = 1 and radius of

convergence ρ (see [21] for details), an application of singularity analysis [8] provides

n ?

k

?n

k

?

ck?n−k=

n!

n?n

n ?

k=n/2+1

kck

k!

?n−k

(n − k)!.

ck

k!∼

1

kρk,

?k

k!∼

1

ρk.

It implies that this contribution is asymptotic to

1

n?n

n ?

k=n/2+1

k

?n

k

?

ck?n−k∼1

n

n ?

k=n/2+1

k1

k=1

2.

This is exactly the asymptotic contribution Golomb and Gaal [15] got for the largest

cycle of a permutation.

Furthermore, if we consider components on the range n/3 < k ≤ n/2, our theorem

gives an asymptotic contribution to λ of

?

2k!

?

i=k+1

n!

1

n?n

n/2

?

k=n/3+1

∼1

n

kck

k!

?n−k

(n − k)!−

ck

?n−2k

(n − 2k)!−

?

n−k

?

i=k+1

ci

i!

?n−k−i

(n − k − i)!

?

n/2

?

k=n/3+1

1 −

1

2k−

n−k

?

1

i

.

Page 16

428D. Panario and B. Richmond

This also agrees with Golomb and Gaal for this range. Indeed, since we are simply

replacing Golomb and Gaal’s exact values (for the permutation case) by asymptotic

values, we get their asymptotic estimates for all configurations in the exp-log class with

multiplicative constant a = 1.

Itfollows,asGolombandGaalpointoutforpermutations,thattherangen/2 < k ≤ n

contributes 80.0859...% to λ, the range n/3 < k ≤ n/2 gives 17.6243...% of λ, the

range n/4 < k ≤ n/3 contributes with 2.1094...% to λ, leaving only 0.1804...% as

the total contribution of all components of size less than or equal to n/4. If i ≥ 4, the

contribution of the range n/(i + 1) < k ≤ n/i is so small that following Golomb and

Gaal we omit the details.

Other examples of combinatorial structures in the exp-log class are

• 2-regular graphs;

• random mappings (functional digraphs) [7];

• permutationswithparticularcharacteristics(e.g.permutationswithoutcyclesoflength

one);

• children’s yards [22], and so on.

Panario and Richmond [21] present an extensive list of problems in this class and the

relevant generating functions. We study, for instance, the largest component of 2-regular

graphs.Werecallthata2-regulargraphofsizen isasubgraphofthecompletegraphinn

vertices such that it contains n edges and each vertex has degree 2. Any 2-regular graph

is decomposable in its connected components. The exponential generating function for

2-regular graphs is (see p. 274 of [5])

?1

It is easy to check that L(z) is in the exp-log class with a =1

The exponential generating function for the components is

L(z) =e−z/2−z2/4

(1 − z)1/2= exp

2log

1

1 − z−z

2−z2

4

?

.

2.

C(z) =1

2log

1

1 − z−z

2−z2

4.

Extracting coefficients, we obtain c1= c2= 0 and

ci=(i − 1)!

2

,

i ≥ 3.

We can use equation 1.2.8 on page 9 of [17]:

?i

i!=ci

i!+1

i

i−1

?

k=1

kck

k!

?i−k

(i − k)!.

Using Maple, we can compute the first few values (see Table 1).

Plugging the values of ciand ?iin the formulas of Theorems 2 and 3 we obtain the

exact largest and smallest size of connected components in 2-regular graphs.

We focus now on the range contributions to the expected largest size of components

for objects in the exp-log class with multiplicative constanta =1

2, like 2-regular graphs.

Page 17

Exact Largest and Smallest Size of Components 429

Table 1. 2-Regular graphs on i vertices, 1 ≤ i ≤ 10.

i

123456789 10

ci

?i

0

0

0

0

1

1

3

3

12

12

60

70

360

465

2520

3507

20,160

30,016

181,400

286,884

Using singularity analysis we obtain

ck

k!∼

1

2kρk,

?k

k!∼

1

k1/2?(1

2)ρk.

We can use the asymptotic expression for ?n−kwhen n − k > w(n), for any function

w(n) tending to infinity; otherwise, ?n−kis bounded. For the range n/2 < k ≤ n, we

have

1

n?n

n ?

k=n/2+1

k

?n

k

?

ck?n−k ∼

1

n1/2

?n−w(n)

k=n/2+1

?

1

2√n − k+ O(w(n))

?

∼

1

√2.

The expected size of the largest component for objects in the exp-log class with mul-

tiplicative constant a =1

centage of Gourdon’s constant due to the range n/2 < k ≤ n is 1/√2 = 0.707107...

of 0.757823..., or 93.3077...%. This shows that the contribution of the range n/2 <

k ≤ n when the multiplicative constant is a =1

hope that the other ranges will be computed by someone else.

2is λ1/2n with λ1/2= 0.757823... (see [16]). Thus, the per-

2is rather different than when a = 1. We

5.2. Unlabelled Structures in the exp-log Class.

is the one of monic polynomials over a finite field Fq. In this case, uk= qkand ck= Ik

where Ikis the number of irreducible polynomials of degree k over the finite field Fq.

The following results are given in terms of Ikand qk. For asymptotic estimates one can

use the well-known approximation

The most useful unlabelled example

Ik=qk

k

+ O(qk/2),

which follows from the exact estimation of Ikgiven by the Moebius inversion formula

Ik=1

k

?

d|k

µ(d)qk/d.

Substituting these quantities in our formulas, we obtain for the largest degree irre-

ducible factor: if n/2 < k ≤ n, then

[zn]U?

k(z) = Ikqn−k;

Page 18

430D. Panario and B. Richmond

in the range n/3 < k ≤ n/2 we have

[zn]U?

k(z) = Ikqn−k−

?Ik

2

?

qn−2k− Ik

n−k

?

j=k+1

Ijqn−k−j;

in the range n/4 < k ≤ n/3 we have

[zn]U?

k(z) = Ikqn−k−

?Ik

2

?

qn−2k− Ik

n−k

?

j=k+1

Ijqn−k−j+

?Ik

3

?

qn−3k

+

?Ik

2

?n−2k

?

j=k+1

n−k

?

Ijqn−2k−j−Ik

?j−(k+1)

?=k+1

2

?

?(n−k)/2?

?

j=k+1

Ijqn−k−2j

+Ik

2

j=2k+2

?

I?Ij−?

qn−k−j.

Similarly, for the smallest degree irreducible factor we obtain: if n/2 < k ≤ n, then

?

0 if

[zn]Us

k(z) =

Ik

if

k = n;

n/2 < k < n;

in the range n/3 < k ≤ n/2 we have

[zn]Us

k(z) =

?Ik+ 1

In−kIk

2

?

if

n = 2k;

n/3 < k < n/2;

if

in the range n/4 < k ≤ n/3 we have

[zn]Us

k(z) =

In/3I2n/3+

In−kIk+Ik

?Ik+ 2

n−2k

?

?Ik

3

?

if

n = 3k;

2

j=k

IjIn−k−j

?

−In−2k

2

+Ik

2I(n−k)/2

if

n/4 < k < n/3.

Gourdon has also shown that the expected length of the largest component of un-

labelled objects in the exp-log class with multiplicative constant a = 1 is λn, with λ the

Golomb constant. We observe that the contributions to the expected length of the largest

component in the unlabelled case are asymptotically the same as in the labelled case.

Indeed, the contribution of the range n/2 < k ≤ n is, from Theorem 4,

1

nun

k=n/2+1

n ?

kckun−k.

Page 19

Exact Largest and Smallest Size of Components 431

In the unlabelled case, singularity analysis entails

ck∼

1

kρk,

uk∼eK

ρk,

where K is a complex constant (see [21] for details). The eKfactor is common to all

terms in the summation and is cancelled by the term un. Theorem 4 shows that the

Golomb and Gaal estimates also hold for the largest unlabelled case (when a = 1). This

is a remarkable fact.

Other examples of unlabelled problems in the exp-log class are (see [21])

• random mappings patterns [7];

• squarefree polynomials over finite fields (without repeated irreducible factors); and

• arithmetical semigroups [18].

Finally,webrieflycommentonthecontributionoftherangestotheexpectedsmallest

sizeofcomponents(inboththelabelledandunlabelledcase).Theexpectedsmallestsize

has been studied by the authors in [21]. Although we could compute these contributions,

we do not do such an analysis since the ranges considered above provide an insignificant

amount of the length of the expected smallest component.

5.3. Graphs.

the exp-log class. Indeed, the radius of convergence of their generating functions is zero.

Let cnand ?ndenote the number of labelled connected graphs and labelled graphs with

n vertices. Harary and Palmer [17] derive for labelled graphs

Labelled and unlabelled graphs (including Eulerian graphs) are not in

∞

?

n=0

?nzn/n! = exp

?

∞

?

n=1

cnzn/n!

?

,

that is, 1+ L(z) = exp(C(z)). For unlabelled graphs, they derive the similar expression

?

Although in this case our exact results hold, the interesting asymptotic result is that

almost all graphs are connected. In fact, Bender’s results [2] show that this is true for

any configuration for which either cn/cn−1or ?n/?n−1tends to infinity.

1 + U(z) = exp

C(z) +C(z2)

2

+C(z3)

3

+ ···

?

.

5.4. Another Example.

last example is the decomposition of almost full tables into complete full tables in linear

probing hashing (see Section 2 of [9] for details).

The generality of our theorems should be clear by now. One

Acknowledgment.

and helpful suggestions. As far as we know, their comments eliminated all the errors,

and certainly improved the presentation of the paper.

We are indebted to two unknown referees for their careful reading

Page 20

432D. Panario and B. Richmond

References

[1]Ben-Or, M. Probabilistic algorithms in finite fields. In Proc. 22nd IEEE Symp. Foundations Computer

Science (1981), pp. 394–398.

Bender, E. An asymptotic expansion for the coefficients of some formal power series. J. London Math.

Soc. 9 (1975), 451–458.

Bender, E., Cameron, P., Odlyzko, A., and Richmond, L. B. Connectedness, classes, and cycle index.

Combin. Probab. Comput. 8 (1999), 31–44.

Cameron, P. On the probability of connectedness. Discrete Math. 167/168 (1997), 175–187.

Comtet, L. Advanced Combinatorics. Reidel, Dordrecht, 1974.

Flajolet,P.,Gourdon,X.,andPanario,D.Thecompleteanalysisofapolynomialfactorizationalgorithm

over finite fields. J. Algorithms 40 (2001), 37–81. (Extended abstract in Proc. 23rd ICALP Symp.,

vol. 1099 of Lecture Notes in Computer Science, Springer-Verlag, Berlin, pp. 232–243, 1996.)

Flajolet, P., and Odlyzko, A. Random mapping statistics. In Advances in Cryptology (1990), J.-J.

Quisquater and J. Vandewalle, eds., vol. 434 of Lecture Notes in Computer Science, Springer-Verlag,

Berlin, pp. 329–354.

Flajolet, P., and Odlyzko, A. Singularity analysis of generating functions. SIAM J. Discrete Math. 3(2)

(1990), 216–240.

Flajolet,P.,Poblete,P.,andViola,A.Ontheanalysisoflinearprobinghashing.Algorithmica22(1998),

490–515.

Flajolet,P.,andSoria,M.Gaussianlimitingdistributionsforthenumberofcomponentsincombinatorial

structures. J. Combin. Theory Ser. A 53 (1990), 165–182.

Flajolet, P., and Soria, M. General combinatorial schemas: Gaussian limiting distributions and expo-

nential tails. Discrete Math. 114 (1993), 159–180.

vonzurGathen,J.,andGerhard,J.ModernComputerAlgebra.CambridgeUniversityPress,Cambridge,

1999.

von zur Gathen, J., and Panario, D. Factoring polynomials over finite fields: a survey. J. Symbolic

Comput. 31 (2001), 3–17.

Golomb, S. Random permutations. Bull. Amer. Math. Soc. 70 (1964), 747.

Golomb, S., and Gaal, P. On the number of permutations of n objects with greatest cycle length k. Adv.

Appl. Math. 20 (1998), 98–107.

Gourdon, X. Combinatoire, algorithmique et g´ eom´ etrie des polynˆ omes. Ph.D. thesis,´Ecole Polytech-

nique, 1996.

Harary, F., and Palmer, E. Graphical Enumeration. Academic Press, New York, 1973.

Knopfmacher, J. Analytic Arithmetic of Algebraic Function Fields. Marcel Dekker, New York, 1979.

Labelle, G., and Leroux, P. An extension of the exponential formula in enumerative combinatorics.

Electron. J. Combin. 3(2) (1996), #R12.

Panario, D., and Richmond, B. Analysis of Ben-Or’s polynomial irreducibility test. Random Struct.

Algorithm. 13 (1998), 439–456.

Panario, D., and Richmond, B. Smallest components in decomposable structures: exp-log class. Algo-

rithmica 29 (2001), 205–226.

Stanley, R. Generating functions. In Studies in Combinatorics (1978), G.-C. Rota, ed., vol. 17 of MAA

Studies in Mathematics, Mathematical Association of America, Washington, DC, pp. 100–141.

[2]

[3]

[4]

[5]

[6]

[7]

[8]

[9]

[10]

[11]

[12]

[13]

[14]

[15]

[16]

[17]

[18]

[19]

[20]

[21]

[22]

Download full-text