Closed expressions for averages of set partition statistics

In studying the enumerative theory of super characters' of the group of upper triangular matrices over a finite field we found that the moments (mean, variance and higher moments) of novel statistics on set partitions have simple closed expressions as linear combinations of shifted bell numbers. It is shown here that families of other statistics have similar moments. The coefficients in the linear combinations are polynomials in $n$. This allows exact enumeration of the moments for small $n$ to determine exact formulae for all $n$.


Introduction
The set partitions of [n] = {1, 2, · · · , n} (denoted Π(n)) are a classical object of combinatorics. In studying the character theory of upper-triangular matrices (see Section 3 for background) we were led to some unusual statistics on set partitions. For a set partition λ of n, consider the dimension exponent The right hand sides of these formulae are linear combinations of Bell numbers with polynomial coefficients. Dividing by B n and using asymptotitcs for Bell numbers (see Section 5.3) in terms of α n , the positive real solution of ue u = n + 1 (so α n = log(n) − log log(n) + · · · ) gives E(d(λ)) = α n − 2 α 2 n n 2 + O n α n VAR(d(λ)) = α 2 n − 7α n + 17 α 3 n (α n + 1) This paper gives a large family of statistics that admit similar formulae for all moments. These include classical statistics such as the number of blocks and number of blocks of size i. It also includes many novel statistics such as d(λ) and c k (λ), the number of k-crossings.
The number of 2-crossings appears as the intertwining exponent of super characters. Careful definitions and statements of our main results are in Section 2. Section 3 reviews the enumerative and probabilistic theory of set partitions, finite groups and super-characters. Section 4 gives computational results; determining the coefficients in shifted Bell expressions involves summing over all set partitions for small n. For some statistics, a fast new algorithm speeds things up. Proofs of the main theorems are in Sections 5 and 6. Section 7 gives a collection of examples-moments of order up to six for d(λ) and further numerical data. In a companion paper [14], the asymptotic limiting normality of d(λ), c 2 (λ), and some other statistics is shown.

Statement of the main results
Let Π(n) be the set partitions of [n] = {1, 2, · · · , n} (so |Π(n)| = B n , the nth Bell number). A variety of codings are described in Section 3. In this section λ ∈ Π(n) is described as . Write i ∼ λ j if i and j are in the same block of λ. It is notationally convenient to think of each block as being ordered. Let First(λ) be the set of elements of [n] which appear first in their block and Last(λ) be the set of elements of [n] which occur last in their block. Finally, let Arc(λ) be the set of distinct pairs of integers (i, j) which occur in the same block of λ such that j is the smallest element of the block greater than i. As usual, λ may be pictured as a graph with vertex set [n] and edge set Arc(λ).

Figure 1. An example partition λ = 1356|27|4
A statistic on λ is defined by counting the number of occurrences of patterns. This requires some notation. such that (1) x 1 < x 2 < · · · < x k .
(2) x i ∼ λ x j if and only if i ∼ P j.
Write s ∈ P λ if s is an occurrence of P in λ. (iii) A simple statistic is defined by a pattern P of length k and Q ∈ Z[y 1 , · · · , y k , m]. If λ ∈ Π(n) and s = (x 1 , · · · , x k ) ∈ P λ, write Q(s) = Q | y i =x i ,m=n . Let Let the degree of a simple statistic f P,Q be the sum of the length of P and the degree of Q. (iv) A statistic is a finite Q-linear combination of simple statistics. The degree of a statistic is defined to be the minimum over such representations of the maximum degree of any appearing simple statistic.
Remark. In the notation above, F(P ) is the set of firsts elements, L(P ) is the set of lasts, A is the arc set of the pattern, and C(P ) is the set of consecutive elements. Examples.
(1) Number of Blocks in λ: x is smallest element in its block
Partitions with cr 2 (λ) = 0 are in bijection with Dyck paths and so are counted by the Catalan numbers C n = 1 n+1 2n n (see Stanley's second volume on enumerative combinatorics [63]). Partitions without crossings have proved themselves to be very interesting. Crossing seems to have been introduced by Krewaras [42]. See Simion's [58] for an extensive survey and Chen, Deng, Du, and Stanley [13] and Marberg [48] for more recent appearances of this statistic. The statistic cr 2 (λ) appears as the intersection exponent in Section 3.3 below. (4) Dimension Exponent: The dimension exponent described in the introduction is a linear combination of the number of blocks (a simple statistic of degree 1), the last elements of the blocks (a simple statistic of degree 2), and the first elements of the blocks (a simple statistic of degree 2). Precisely, define f f irsts (λ) := f P ,Q (λ) where P is the pattern of length 1, with F(P ) = {1}, L(P ) = A(P ) = C(P ) = ∅ and Q(y, m) = y. Similarly, let f lasts (λ) := f P ,Q (λ) where P is the pattern of length 1, with L(P ) = {1}, F(P ) = A(P ) = C(P ) = ∅ and Q(y, m) = y. Then (5) Levels: The number of levels in λ , denoted f levels (λ), (see page 383 of [45] or Shattuck [57]) is the number of i such that i and i + 1 appear in the same block of λ. We have where P is a pattern of length 2 with C(P ) = A(P ) = {(1, 2)} and A(P ) = F(P ) = ∅. (6) The maximum block size of a partition is not a statistic in this notation. The set of all statistics on ∪ ∞ n=0 Π(n) → Q is a filtered algebra. Theorem 2.2. Let S be the set of all set partition statistics thought of as functions f : n Π(n) → Q. Then S is closed under the operations of pointwise scaling, addition and multiplication. In particular, if f 1 , f 2 ∈ S and a ∈ Q, then there exist partition statistics g a , g + , g * so that for all set partitions λ, In particular, S is a filtered Q-algebra under these operations.
Remark. Properties of this algebra remain to be discovered. Definition 2.3. A shifted Bell polynomial is any function R : N → Q given by it is a finite sum of polynomials multiplied by shifted Bell numbers. Call K the upper shift degree of R and I the lower shift degree of R.
Our first main theorem shows that the aggregate of a statistic is a shifted Bell polynomial. f (λ) = R(n).

Moreover,
(1) the upper shift index of R is at most N and the lower shift index is bounded below by −k, where k is the size of the pattern associated f . (2) the degree of the polynomial coefficient of B n+N −j in R is bounded by j for j ≤ N and by j − 1 for j > N.
The following collects the shifted Bell polynomials for the aggregates of the statistics given above. Examples.
(1) Number of blocks in λ: This is elementary and is established in Proposition 3.1 below. (2) Number of blocks of size i: This is also elementary and is established in Proposition 3.1 below.
Remark. Chapter 8 of Mansour's book [45] and the research papers [34,46,39] contain many other examples of statistics which have shifted Bell polynomial aggregates. We believe that each of these statistics is covered by our class of statistics.

Set Partitions, Enumerative Group Theory and Super-characters
This section presents background and a literature review of set partitions, probabilistic and enumerative group theory and super-character theory for the upper triangular group over a finite field. Some sharpenings of our general theory are given.
These unify many combinatorial identities, going back to Faa de Bruno's formula for the Taylor series of the composition of two power series. There is a healthy algebraic theory of set partitions. The partition algebra of [31] is based on a natural product on Π(n) which first arose in diagonalizing the transfer matrix for the Potts model of statistical physics. The set of all set partitions n Π(n) has a Hopf algebra structure which is a general object of study in [3].
As explained in Section 3.3 below, crossings arise in a group theoretic context and are covered by our main theorem. Nestings are also a statistic. This crossing and nesting literature develops a parallel theory for crossings and nestings of perfect matchings (set partitions with all blocks of size 2). Preliminary works suggest that our main theorem carry over to matchings with B n reduced to (2n)!/2 n n!.
Turn next to the probabilistic side: What does a 'typical' set partition 'look like' ? For example, under the uniform distribution on Π(n) • What is the expected number of blocks?
• How many singletons (or blocks of size i) are there?
• What is the size of the largest block?
The Bell polynomials can be used to get moments. For example: be the number of singleton blocks, then m(X 1 ; n) =nB n−1 m(X 2 1 ; n) =nB n−1 + n(n − 1)B n−2 In accordance with our general theorem, the right hand sides of (i), (ii) are shifted Bell polynomials. To make contact with results above, there is a direct proof of these classical formulae.
Proof. Specializing the variables in the generating function (3.1) gives a two variable generating functions for ℓ: S(n, ℓ)y ℓ x n n! = e y(e x −1) .
Differentiating with respect to y and setting y = 1 shows that m(ℓ; n) is the coefficient of Differentiation with respect to y and settings y = 1 readily yields the claimed results.
The moment method may be used to derive limit theorems. An easier, more systematic method is due to Fristedt [27]. He interprets the factorization of the generating function B(t) in (3.1) as a conditional independence result and uses "dePoissonization" to get results for finite n. Let X i (λ) be the number of blocks of size i. Roughly, his results say that are asymptotically independent and of size (log(n)) i /i!. More precisely, let α n satisfy α n e αn = n + 1 (so x −∞ e −u 2 /2 du. Fristdt also has a description of the joint distribution of the largest blocks. Remark. It is typical to expand the asymptotics in terms of u n where u n e un = n. In this notation u n and α n differ by O(1/n).
The number of blocks ℓ(λ) is asymptotically normal when standardized by its mean µ n ∼ n log(n) and variance σ 2 n ∼ n log 2 (n) . These are precisely given by Proposition 3.1 above. Refining this, Hwang [32] shows Stam [60] has introduced a clever algorithm for random uniform sampling of set partitions in Π(n). He uses this to show that if W (i) is the size of the block containing i, 1 ≤ i ≤ k, then for k finite and n large W (i) are asymptotically independent and normal with mean and variance asymptotic to α n . In [14] we use Stam's algorithm to prove the asymptotic normality of d(λ) and cr 2 (λ).
Any of the codings above lead to distribution questions. The upper-triangular representation leads to the study of the dimension and crossing statistics, the arc representation suggests crossings, nestings and even the number of arcs, i.e. n − ℓ(λ). Restricted growth sequences suggest the number of zeros, the number of leading zeros, largest entry. See Mansour [45] for this and much more. Semi-labelled trees suggest the number of leaves, length of the longest path from root to leaf and various measures of tree shape (eg. max degree). Further probabilistic aspects of uniform set partitions can be found in [52,53].

3.2.
Probabilistic Group Theory. One way to study a finite group G is to ask what 'typical' elements 'look like'. This program was actively begun by Erdös and Turan [19,20,21,22,23,24,25] who focused on the symmetric group S n . Pick a permutation σ of n at random and ask the following: • How many cycles in σ? (about log n) • What is the length of the longest cycle? (about 0.61n) • How many fixed points in σ? (about 1) • What is the order of σ? (roughly e (log n) 2 /2 ) In these and many other cases the questions are answered with much more precise limit theorems. A variety of other classes of groups have been studied. For finite groups of Lie type see [28] for a survey and [15] for wide-ranging applications. For p-groups see [51].
One can also ask questions about 'typical' representations. For example, fix a conjugacy class C (e.g. transpositions in the symmetric group), what is the distribution of χ ρ (C) as ρ ranges over irreducible representations [28,37,64]. Here, two probability distributions are natural, the uniform distribution on ρ and the Plancherel measure (Pr(ρ) = d 2 ρ /|G| with d ρ the dimension of ρ). Indeed, the behavior of the 'shape' of a random partition of n under the Plancherel measure for S n is one of the most celebrated results in modern combinatorics. See Stanley's [61] for a survey with references to the work of Kerov-Vershik [38], Logan-Shepp [43], Baik-Deift-Johansson [10] and many others.
The above discussion focuses on finite groups. The questions make sense for compact groups. For example, pick a random matrix from Haar measure on the unitary group U n and ask: What is the distribution of its eigenvalues? This leads to the very active subject of random matrix theory. We point to the wonderful monographs of Anderson-Guionnet-Zietouni [5] and Forrester [26] which have extensive surveys.
3.3. Super-character theory. Let G n (q) be the group of n × n matrices which are upper triangular with ones on the diagonal. The group G n (q) is the Sylow p-subgroup of GL n (F q ) for q = p a . Describing the irreducible characters of G n (q) is a well-known wild problem. However, certain unions of conjugacy classes, called superclasses, and certain characters, called supercharacters, have an elegant theory. In fact, the theory is rich enough to provide enough understanding of the Fourier analysis on the group to solve certain problems, see the work of Arias-Castro, Diaconis, and Stanley [9]. These superclasses and supercharacters were developed by Carlos André [6,7,8] and Ning Yan [65]. Supercharacter theory is a growing subject. See [2,1,16,17,47,48] and their references.
For the groups G n (q) the supercharacters are determined by a set partition of [n] and a map from the set partition to the group F * q . In the analysis of these characters there are two important statistics, each of which only depends on the set partition. The dimension exponent is denoted d(λ) and the intertwining exponent is denoted i(λ).
While d(λ) and i(λ) were originally defined in terms of the upper triangular representation (for example, d(λ) is the sum of the horizontal distance from the 'ones' to the super diagonal) their definitions can be given in terms of blocks or arcs: and Remark. Notice that i(λ) = cr 2 (λ) is the number of 2-crossings which were introduced in the previous sections.
Our main theorem shows that there are explicit formulae for every moment of these statistics. The following represents a sharpening using special properties of the dimension exponent.
For example, Remark. See Section 7 for the moments with k ≤ 6 and see [54] for the moments with k ≤ 22.
The first moment may be deduced easily from results of Bergeron and Thiem [11]. Note, they seem to have an index which differs by one from ours.
Remark. Theorem 3.2 is stronger than what is obtained directly from Theorem 2.4. For example, the lower shift index is 0, while the best that can be obtained from Theorem 2.4 is a lower shift index of −k. This theorem is proved by working directly with the generating function for a generalized statistic on "marked set partitions". These set partitions are introduced in Section 4.
Asymptotics for the Bell numbers yield the following asymptotics for the moments. The following result gives some asymptotic information about these moments.
Analogous to these results for the dimension exponent are the following results for the intertwining exponent.
where each Q k,2k−j is a polynomial with rational coefficients. Moreover, the degree of Q k,2k−j is bounded by j. For example, Remark. The expression for M(i; n) = M(cr 2 ; n) was established first by Kasraoui (Theorem 2.3 of [34]).
Remark. Theorem 3.4 is deduced directly from Theorem 2.4. The shifted Bell polynomials for M(i k ; n) for k ≤ 5 are given in Section 7 and see [54] for the aggregates with k ≤ 12.
In analogy with Theorem 3.3 there is the following asymptotic result.
Theorem 3.5. With α n as above, Theorems 3.2 and 3.4 show that there will be closed formulae for all of the moments of these statistics. Moreover, these theorems give bounds for the number of terms in the summand and the degree of each of the polynomials. Therefore, to compute the formulae it is enough to compute enough values for M(d k ; n) or M(i k ; n) and then to do linear algebra to solve for the coefficients of the polynomials. For example, M(d; n) needs P 1,2 (n) which has degree at most 0, P 1,1 (n) which has degree at most 1, and P 1,0 (n) which has degree at most 0. Hence, there are 4 unknowns, and so only M(d; n) for n = 1, 2, 3, 4 are needed to derive the formula for the expected value of the dimension exponent.

Computational Results
Enumerating set partitions and calculating these statistics would take time O(B n ) (see Knuth's volume [41] for discussion of how to generate all set partitions of fixed size, the book of Wilf and Nijenhuis [50], or the website [56] of Ruskey). This section introduces a recursion for computing the number of set partitions of n with a given dimension or intertwining exponent in time O(n 4 ). The recursion follows by introducing a notion of "marked" set partitions. This generalization seems useful in general when computing statistics which depend on the internal structure of a set partition. The results may then be used with Theorems 3.2 and 3.4 to find exact formulae for the moments. Proofs are given in Section 5. . The open blocks are those that will become larger upon adding more elements of this larger set, while the closed blocks are those that will not.) With this notation define the dimension of λ with blocks B 1 , B 2 , · · · by It is clear that if o(λ) = 0, then λ may be thought of as a usual 'unmarked' set partition and d(λ) = d(λ) is the dimension exponent of λ. Define Therefore, to find the number of partitions of [n] with dimension exponent equal to k, it suffices to compute f (n, 0, k) for k and n. Figure 2 gives the histograms of the dimension exponent when n = 20 and n = 100. With increasing n, these distributions tend to normal with mean and variance given in Theorem 3.3. This approximation is already apparent for n = 20. It is not necessary to compute the entire distribution of the dimension index to compute the moment formulae for the dimension exponent. Namely, it is better to implement the following recursion for the moments.
To  4.3. With the notation above, the following recursion holds This recursion allows the distribution to be computed rapidly. Figure 3 gives the histograms of the intertwining exponent when n = 20 and n = 100. Again, for increasing n the distribution tends to normal with mean and variance from Theorem 3.5. The skewness is apparent for n = 20.  Function for f (n, A, B). This section studies the generating function for f (n, A, B) and deduces Theorem 3.2. Let

The Generating
be the three variable generating function. Theorem 4.1 implies that where F Y denotes ∂ ∂Y F . Then F (X, 0, Z) is the generating function for the distribution of d(λ), i.e.
Thus, the generating function for the kth moment is So F k (X, 0) = M(d k ; n) X n n! . Lemma 5.1. In the notation above, Hence solving for F n gives (5.4) Throughout the remainder Y = e α − 1. Abusing notation, let The following lemma gives an expression for G k (X, α) in terms of a differential operators. Define the operators where a e α has been commuted through. Then Since G k (0, α) = 0 for k > 0, for some constants C k a,b,c . The next lemma evaluates the terms in the summation of Lemma 5.2, thus yielding a generating function for G k (X, Y ) which resembles that for the Bell numbers.
Proof. It is easy to see by induction on ℓ that T ℓ 1 is a polynomial in e X+α . Thus Hence From this, it is easy to see that Theorem 3.2 needs some further constraints on the degrees of terms in this polynomial. The following lemma yields the claimed bounds for the degrees.
Lemma 5.5. In the notation above, C k a,b,c = 0 unless all of the following hold: Proof. Let H a,b,c (X, α) = S a T b X c 1. Using Equation (5.6), write C k a,b,c in terms of the C ℓ a,b,c for ℓ < k. To do this requires understanding As a first claim: if a = 0, then the above is simply 1 c+1 H 0,b,c+1 . This is seen easily from the fact that R commutes with T . For a = 0, it is easy to see that this is a linear combination of the H a,b,c ′ over c ′ ≤ c, and of H 0,b ′ ,0 over b ′ ≤ b.
The desired properties can now be proved by induction on k. It is clear that they all hold for k = 0. For larger k, assume that they hold for all k − ℓ, and use Equation 5.6 to prove them for k.
Thus, by Equation (5.6), G k is a linear combination of H a,b,c 's with b ≤ 2k. This proves property 3. Finally, consider the contribution to G k coming from each of the G k−ℓ terms. For ℓ = 1, Thus, the contribution of these terms to G k is a linear combination of H a,b,c 's with 3c − b ≤ k and 3c − b ≤ k − 3 if a = 0. This proves properties 4 and 5.
This completes the induction and proves the Lemma.

Asymptotic Analysis.
This section presents some asymptotic analysis of the Bell numbers and ratios of Bell numbers. These results yield Theorems 3.3 and 3.5. Similar analysis can be found in [41]. Then n,k exp (e αn − (n + k + 1) log(α n )) 1 + O e −αn .
More precisely, for T ≥ 0 n,k exp (e αn − (n + k + 1) log(α n )) where R m,k are rational functions. In particular Proof. The proof is very similar to the traditional saddle-point method for approximating B n . The idea is to evaluate at the saddle point for B n rather than for B n+k . We follow the proof in Chapter 6 of [18]. By Cauchy's formula, The the real part has maxima around y = 2πm for each integer m, but using log (1 + y 2 α −2 n ) > 1 2 y 2 α −2 n for π < y < α n and 1 + y 2 α −2 n > 2yα −1 n for y > α n as in [18] gives ∞ −∞ exp (ψ n,k (y)) dy = π −π exp (ψ n,k (y)) dy + O exp − e αn α n .
Lemma 6.2. Fix k, let Q ∈ Z[y 1 , · · · , y k , m] and r = {r 0 , r 1 , · · · , r k } be a sequence of rational numbers. As defined above, M(k, Q, r, n, x) is a rational linear combination of terms of the form Proof. The proof is by induction on k. If k = 0 then definitionally, M(k, Q, r, n, x) = Q(n)(x + r 0 ) n , providing a base case for our result. Assume that the lemma holds for k one smaller. For this, fix the values of x 1 , . . . , x k−1 in the sum and consider the resulting sum over x k . Then Consider the inner sum over x k : If r k−1 = r k , then the product of the last two terms is always (x + r k ) n−x k−1 −2 , and thus the sum is some polynomial in x 1 , . . . , x k−1 , n times (x + r k ) n−x k−1 −2 . The remaining sum over x 1 , . . . , x k−1 is exactly of the form M(k − 1, Q ′ , r ′ , n − 1, x), for some polynomial Q ′ , and thus, by the inductive hypothesis, of the correct form.
If r k−1 = r k the sum is over pairs of non-negative integers a = x k − x k−1 − 1 and b = n − x k − 1 summing to n − x k−1 − 2 of some polynomial, Q ′ in a and n and the other x i times (x + r k−1 ) a (x + r k ) b . Letting y = (x + r k−1 ) and z = (x + r k ), this is a sum of Q ′ (x i , n, a)y a z b . Let d be the a-degree of Q ′ . Multiplying this sum by (y − z) d+1 , yields, by standard results, a polynomial in y and z of degree n − x k−1 − 2 + (d + 1) in which all terms have either y-exponent or z-exponent at least n − x k−1 − 1. Thus this inner sum over x k when multiplied by the non-zero constant (r k−1 − r k ) d+1 yields the sum of a polynomial in x, n, x 1 , . . . , x k−1 times (x + r k−1 ) n−x k−1 −2 plus another such polynomial times (x + r k−1 ) n−x k−1 −2 . Thus, M(k, Q, r, n, x) can be written as a linear combination of terms of the form G(x)M(k − 1, Q ′ , r ′ , n, x). The inductive hypothesis is now enough to complete the proof.
Turn next to the proof of Theorem 2.4.
Proof of Theorem 2.4. It suffices to prove this Theorem for simple statistics. Thus, it suffices to prove that for any pattern P and polynomial Q that is given by a shifted Bell polynomial in n. As a first step, interchange the order of summation over s and λ above. Hence To deal with the sum over λ above, first consider only the blocks of λ that contain some element of s. Equivalently, let λ ′ be obtained from λ by replacing all of the blocks of λ that are disjoint from s by their union. To clarify this notation, let Π ′ (n) denote the set of all set partitions of [n] with at most 1 marked block. For λ ′ ∈ Π ′ (n) say that s ∈ P λ ′ if s in an occurrence of P in λ ′ as a regular set partition so that additionally the non-marked blocks of λ ′ are exactly the blocks of λ ′ that contain some element of s. For λ ′ ∈ Π ′ (n) and λ ∈ Π(n), say that λ is a refinement of λ ′ if the unmarked blocks in λ ′ are all parts in λ, or equivalently, if λ can be obtained from λ ′ by further partitioning the marked block. Denote λ being a refinement of λ ′ as λ ⊢ λ ′ . Thus, in the above computation of M(f P,Q ; n), letting λ ′ be the marked partition obtained by replacing the blocks in λ disjoint from s by their union:

1.
Note that the λ in the final sum above correspond exactly to the set partitions of the marked block of λ ′ . For λ ′ ∈ Π ′ (n), let |λ ′ | be the size of the marked block of λ ′ . Thus, Remark. This is valid even when the marked block is empty.
Dealing directly with the Bell numbers above will prove challenging, so instead compute the generating function After computing this, extract the coefficients of M(P, Q, n, x) and multiply them by the appropriate Bell numbers.
To compute M(P, Q, n, x), begin by computing the value of the inner sum in terms of s = (x 1 < x 2 < . . . < x k ) that preserve the consecutivity relations of P (namely those in C(P )). Denote the equivalence classes in P by 1, 2, . . . , ℓ. Let z i be a representative of this i th equivalence class. Then an element λ ′ ∈ Π ′ (n) so that s ∈ P λ ′ can be thought of as a set partition of [n] into labeled equivalence classes 0, 1, . . . , ℓ, where the 0 th class is the marked block, and the i th class is the block containing x z i . Thus think of the set of such λ ′ as the set of maps g : [n] → {0, 1, . . . , ℓ} so that: ( and j, j ′ are in the i th equivalence class It is possible that no such g will exist if one of the latter three properties must be violated by some x = x h . If this is the case, this is a property of the pattern P , and not the occurrence s, and thus, M(f P,Q ; n) = 0 for all n. Otherwise, in order to specify g, assign the given values to g(x i ) and each other g(x) may be independently assigned values from the set of possibilities that does not violate any of the other properties. It should be noted that 0 is always in this set, and that furthermore, this set depends only which of the x i our given x is between. Thus, there are some sets S 0 , S 1 , . . . , S k ⊆ {0, 1, . . . , ℓ}, depending only on s, so that g is determined by picking functions Thus the sum over such λ ′ of x |λ ′ | is easily seen to be For such a sequence, r of rational numbers define (6.2) M(k, Q, r, n, x, C(P )) := where, as in Lemma 6.2, using the notation x 0 = 0, x k+1 = n + 1.
Note that the sum is empty if C(P ) contains nonconsecutive elements. We will henceforth assume that this is not the case. We call j a follower if either (j − 1, j) or (j, j − 1) are in C(P ). Clearly the values of all x i are determined only by those x i where i is not a follower. Furthermore, Q is a polynomial in these values and n. If j is the index of the ith non-follower then let y i = x j − j + i. Now, sequences of x i satisfying the necessary conditions correspond exactly to those sequences with 1 ≤ y 1 < y 2 < · · · < y k−f ≤ n − f where f is the total number of followers. Thus, M(k, Q, r, n, x, C(P )) = where the r i are modified versions of the r i to account for the change from {x j } to {y i }. In particular, if x j is the (i + 1) st non-follower, then r i = r j−1 .
By Lemma 6.2, M(k − f, Q, r, n − f, x) is a linear combination of terms of the form F (n)G(x)(x + r i ) n−k for polynomials F ∈ Q[n] and G ∈ Q[x]. Thus, M(f P,Q ; n) can be written as a linear combination of terms of the form g r,d,ℓ,s (n) where ℓ is the number of equivalence classes in P and r, d, s are non-negative integers. Therefore, by Lemma 6.1 M(f P,Q ; n) is a shifted Bell polynomial.
The bound for the upper shift index follows from the fact that M(f P,Q ; n) = O(n N B n ) and by (5.7) each term n α B n+β is of an asymptotically distinct size. To complete the proof of the result it is sufficient to bound the lower shift index of the Bell polynomial. By (6.2) it is clear the largest power of x in each term is (n − k). Thus, from Lemma 6.1, the resulting shift Bell polynomials can be written with minimum lower shift index −k. This completes the proof.
Next turn to the proof of Theorem 2.2. To this end, introduce some notation. Definition 6.3. Given three patterns P 1 , P 2 , P 3 , of lengths k 1 , k 2 , k 3 , say that a merge of P 1 and P 2 onto P 3 is a pair of strictly increasing functions m 1 : (2) m 1 (i) ∼ P 3 m 1 (j) if and only if i ∼ P 1 j, and m 2 (i) ∼ P 3 m 2 (j) if and only if i ∼ P 2 j (3) i ∈ F(P 3 ) if and only if there exists either a j ∈ F(P 1 ) so that i = m 1 (j) or a j ∈ F(P 2 ) so that i = m 2 (j) (4) i ∈ L(P 3 ) if and only if there exists either a j ∈ L(P 1 ) so that i = m 1 (j) or a j ∈ L(P 2 ) so that i = m 2 (j) if and only if there exists either a (j, j ′ ) ∈ C(P 1 ) so that i = m 1 (j) and i ′ = m 1 (j ′ ) or a (j, j ′ ) ∈ C(P 2 ) so that i = m 2 (j) and i ′ = m 2 (j ′ ) Such a merge is denoted as m 1 , m 2 : P 1 , P 2 → P 3 .
Note that the last four properties above imply that given P 1 and P 2 , a merge (including a pattern P 3 ) is uniquely defined by maps m 1 , m 2 and an equivalence relation ∼ P 3 satisfying (1) and (2) above. Lemma 6.4. Let P 1 and P 2 be patterns. For any λ there is a one-to-one correspondence: Moreover, under this correspondence Proof. Begin by demonstrating the bijection defined by Equation (6.3). On the one hand, given s 3 ∈ P 3 λ given by z 1 < z 2 < . . . < z k 3 and m 1 , m 2 : P 1 , P 2 → P 3 , define s 1 and s 2 by the sequences z m 1 (1) < z m 1 (2) < . . . < z m 1 (k 1 ) and z m 2 (1) < z m 2 (2) < . . . < z m 2 (k 2 ) . It is easy to verify that these are occurrences of the patterns P 1 and P 2 and furthermore that equation (6.4) holds for this mapping.
This mapping has a unique inverse: Given s 1 and s 2 , note that s 3 must equal the union s 1 ∪ s 2 . Furthermore, the maps m a , for a = 1, 2, must be given by the unique function so that m a (i) = j if and only if the i th smallest element of s a equals the j th smallest element of s 3 . Note that the union of these images must be all of [k 3 ]. In order for s 3 to be an occurrence of P 3 the equivalence relation ∼ P 3 must be that i ∼ P 3 j if and only if the i th and j th elements of s 3 are equivalent under λ. Note that since S 1 and S 2 were occurrences of P 1 and P 2 , that this must satisfy condition (2) for a merge. The rest of the data associated to P 3 (namely F(P 3 ), L(P 3 ), A(P 3 ), and C(P 3 )) is now uniquely determined by m 1 , m 2 , P 1 , P 2 and the fact that P 3 is a merge of P 1 and P 2 under these maps. To show that s 3 is an occurrence of P 3 first note that by construction the equivalence relations induced by λ and P 3 agree. If i ∈ F(P 3 ), then there is a j ∈ F(P a ) with i = m a (j) for some a, j. Since s a is an occurrence of P a , this means that the j th smallest element of s a in in First(λ). On the other hand, by the construction of m a , this element is exactly z ma(j) = z i . This if i ∈ F(P 3 ), z i ∈ First(λ). The remaining properties necessary to verify that S 3 is an occurrence of P 3 follow similarly. Thus, having shown that the above map has a unique inverse, the proof of the lemma is complete.
Recall, the number of singleton blocks is denoted X 1 and it is a simple statistic. To illustrate this lemma return to the example of X 2 1 discussed prior to the lemma. Let P 1 = P 2 be the pattern of length 1 with A(P 1 ) = φ, F(P 1 ) = L(P 1 ) = 1. Then there are five possible merges of P 1 and P 2 into some pattern P 3 . The first choice of P 3 is P 1 itself. In which case m 1 (1) = m 2 (1) = 1. The latter choices of P 3 is the pattern of length 2 with F(P 3 ) = L(P 3 ) = {1, 2}, A(P 3 ) = ∅. The equivalence relation on P 3 could be either the trivial one or the one that relates 1 and 2 (though in the latter case the pattern P 3 will never have any occurrences in any set partition). In either of these cases, there is a merge with m 1 (1) = 1 and m 2 (1) = 2 and a second merge with m 1 (1) = 2 and m 2 (1) = 1. As a result, Proof of Theorem 2.2. The fact that statistics are closed under pointwise addition and scaling follows immediately from the definition. Similarly, the desired degree bounds for these operations also follow easily. Thus only closure and degree bounds for multiplication must be proved. Since every statistic may be written as a linear combination of simple statistics of no greater degree, and since statistics are closed under linear combination, it suffices to prove this theorem for a product of two simple statistics. Thus let f i be the simple statistic defined by a pattern P i of size k i and a polynomial Q i . It must be shown that f 1 (λ)f 2 (λ) is given by a statistic of degree at most k 1 + k 2 + deg(Q 1 ) + deg(Q 2 ).
For any λ f 1 (λ)f 2 (λ) = Simplify this equation using Lemma 6.4, writing this as a sum over occurrences of only a single pattern in λ. Applying Lemma 6.4, Thus, the product of f 1 and f 2 is a sum of simple characters. Note that the quantity is a polynomial of s 3 which is denoted Q m 1 ,m 2 ,Q 1 ,Q 2 (s 3 ). Finally, each pattern P 3 has size at most k 1 + k 2 and each polynomial Q m 1 ,m 2 ,Q 1 ,Q 2 has degree at most deg(Q 1 ) + deg(Q 2 ). Thus the degree of the product is at most the sum of the degrees.

More Data
This section contains some data for the dimension and intertwining exponent statistics. The moment formulae of Theorem 3.2 for k ≤ 22 and the moment formulae for the intertwining exponent for k ≤ 12 have been computed and are available at [54]. Moreover, the values f (n, 0, B) for n ≤ 238 and f (i) (n, 0, B) for n ≤ 146 are available. These sequences can also be found on Sloane's Online Encyclopedia of integer sequences [59].
The remainder of this section contains a small amount of data and observations regarding the distributions f (n, 0, B) and f (i) (n, 0, B) and regarding the shifted Bell polynomials of Theorems 3.2 and 3.4.

Dimension Index.
A couple of easy observations: It is clear that f (n, 0, 0) = 2 n−1 .
That is the number of set partitions of [n] with dimension exponent 0 is 2 n−1 . Set partitions of [n] that have dimension exponent 0 must have n appearing in a singleton set or it must  appear in a set with n − 1, thus the result is obtained by recursion. Additionally, the number of set partitions of [n] with dimension exponent equal to 1 is n2 n−1 , that is f (n, 0, 1) = n2 n−1 .
These formulae exhibit a number of properties. Here is a list of some of them.
(1) Using the fact that B n+k ≈ n k B n , each moment M(d k ; n) has a number of terms with asymptotic of size equal to n 2k B n , up to powers of log(n) (or α n ). Call these terms the leading powers of n. The leading 'power' of n contribution is equal to where T is the operator given by T B m = B m+1 . For example the leading order n contributions for the average is nB n+1 − 2B n+2 and the leading order contribution for the second moment is Structure of this sort is necessary because of the asymptotic normality of the dimension exponent (see the forthcoming work [14]). The next remark also concerns this sort of structure. (2) The next order n terms of M(d k ; n) have size roughly n 2k−1 B n and have the shape j≥0 C j (−1) j+1 k j n k−j T k+j−1 B n where the constants C j are C j = 2 j−3 (17 − j)j.
(3) The generating function for the polynomials P 0,k (n) seems to be k≥0 P 0,k (n) X k k! = exp (e X − 1 − X)n .
We do not have a proof of this observation. Remark. These asymptotics support the claim that the dimension exponent is normally distributed with mean asymptotic to n 2 log(n) and standard deviation n 3 log(n) 2 . This result will be established in forthcoming work [14]. 7.2. Intertwining Index. Table 5 contains the distribution for of the intertwining exponent for the first few n.
In the notation of Theorem 3.4 these are some values of the first few moments of i(λ) = cr 2 (λ).