ASYMPTOTICS OF THE STIRLING NUMBERS
OF THE SECOND KIND

Bruno Salvy & John Shackell

January 1998

We show how computer algebra can be used to compute automatically the asymptotics of the Bell numbers and of the average value and variance of the number of parts in a partition. This worksheet details the computations involved in Section 3 of our article Symbolic Asymptotics: Multiseries of Inverse Functions , available as INRIA Research Report #3264, 1997. The starting point for all these asymptotic expansions is the bivariate generating function of the Stirling numbers of the second kind:

> F:=exp(u*(exp(x)-1));

[Maple Math]

> series(F,x);

[Maple Math]
[Maple Math]

The coefficient of [Maple Math] in this series is the Stirling number of the second kind [Maple Math] divided by [Maple Math] . These numbers count the number of partitions of the set {1,..., [Maple Math] } in [Maple Math] parts.

For functions with a fast growth at infinity, like many functions related to [Maple Math] , the asymptotic behaviour of the Taylor coefficients can be computed by the saddle-point method. This method relies on using an integral along a closed contour in the complex plane chosen in such a way as to pass through a special point called the saddle-point. The integral is concentrated in the neighborhood of the saddle-point and good asymptotic estimates are obtained from a local expansion there. However, in these applications, the saddle-point is defined implicitly by an equation and only an asymptotic expansion of it is available. This introduces technical difficulties in the manipulation of the expansions. This worksheet explores how our algorithm for asymptotic inversion applies in such circumstances.

We first load our experimental implementation

> read `/export/salvy/Alcom/97/asympt_inv/load.mpl`;

Sufficient conditions for deriving an asymptotic expansion by the saddle-point method have been given by Harris and Schoenfeld. These conditions are satisfied by all the generating functions we consider in this worksheet. The following procedure (which can be skipped in a first reading) takes as input a function [Maple Math] , the associated saddle-point equation, an asymptotic scale (see below) and computes the asymptotic expansion of the [Maple Math] th Taylor coefficient of [Maple Math] as [Maple Math] tends to infinity in terms of the saddle-point.

> harris_schoenfeld:=proc(f,x,R,nofR,nbterms,scale)local A, B, Bb, Cc, F, i, m, u, compo;A:=diff(log(f),x);for i to 2*nbterms do B[i]:=normal(x^i/i!*diff(A,[x$(i-1)])) od;Bb:=x*diff(B[1],x)/2;for i to 2*nbterms-2 do Cc[i]:=normal(-(B[i+2]+(-1)^i/(i+2)*B[1])/Bb) od;F[0]:=1;for i to nbterms-1 do F[i]:=(-1)^i/sqrt(Pi)*add(GAMMA(m+i+1/2)/m!*add(mul(Cc[u],u=compo),compo=combinat[composition](2*i,m)),m=1..2*i)od;tower(subs([x=R,n=nofR],f/2/sqrt(Pi)/sqrt(Bb)/x^n*add(normal(F[i]/Bb^i),i=0..nbterms-1)),scale)end:

Asymptotics of the Bell numbers

The Bell numbers [Maple Math] are the sum over k of the Stirling numbers [Maple Math] . Their generating function is

> f:=subs(u=1,F);

[Maple Math]

Alternatively, since these numbers count the number of partitions of a set, this generating function and the numbers can be obtained using combstruct :

> G:={P=Set(Set(Atom,card>0))}:

> combstruct[gfsolve](G,labelled,x);

[Maple Math]

Here are the first numbers:

> series(f,x,20);

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

or, using combstruct

> seq(combstruct[count]([P,G,labelled],size=i),i=0..19);

[Maple Math]
[Maple Math]

the factor 1/ [Maple Math] being due to the use of exponential generating functions.

The saddle-point equation we use is

> speq:=subs(x=R,diff(log(f),x)*x)-1=n;

[Maple Math]

Then the asymptotic analysis of the Bell numbers is classically based on the asymptotic behaviour of the saddle-point [Maple Math] viewed as a function of [Maple Math] as [Maple Math] tends to infinity.

From the above equation our algorithm produces the asymptotic expansion of the saddle-point in two stages: first a sequence of ``exact'' information is computed by the procedure Invert which also creates the scale scaleR necessary for the expansions of functions of R :

> r1:=Invert(lhs(speq),R,'scaleR');

[Maple Math]
[Maple Math]

The last argument has been assigned the corresponding asymptotic scale:

> scaleR[list];

[Maple Math]

In a second stage, asymptotic information is extracted from the exact result r1 and the scale necessary for the expansions of functions of n is created

> exp1:=multiseriesinverse([r1],scaleR,0,2,n,3,'scalen');

[Maple Math]

Here again the variable scalen holds the asymptotic scale related to the variable n :

> scalen[list];

[Maple Math]

The procedure harris_schoenfeld written above is then able to compute the expansion of the Bell numbers in terms of the saddle-point R in the scale scaleR which has been obtained above

> d1:=harris_schoenfeld(f,x,R,lhs(speq),3,scaleR);

[Maple Math]
[Maple Math]
[Maple Math]

The result follows upon substitution of R by its asymptotic expansion in terms of n ( exp1 above). Since the logarithm of this expansion is easier to handle, we first compute it:

> d2:=`tower/ln`(d1,scaleR):

> multiseries(d2,scaleR,0,3,nops(scaleR[list]),3);

[Maple Math]

Hence the result by substituting the expansion of [Maple Math] in terms of [Maple Math] in this last expansion:

> substitute(d2,scaleR,exp1,scalen,3);

[Maple Math]
[Maple Math]
[Maple Math]

The first part of this expansion is the classical expansion of [Maple Math] which can be found in (de Bruijn 1981, p. 108). The remaining parts reflect the use of multiseries, a recent tool which makes it possible to deal with indefinite cancellation in a simple way.

Average number of parts in a partition

The technique demonstrated above also applies to the average number of parts in a partition, where an indefinite cancellation occurs and this exemplifies the use of multiple scales. The generating function of [Maple Math] is

> g:=subs(u=1,diff(F,u));

[Maple Math]

The average number of parts in a partition of a set of size [Maple Math] is the [Maple Math] th Taylor coefficient of [Maple Math] divided by the [Maple Math] th coefficient of [Maple Math] whose asymptotics we have just computed. The saddle-point equation for [Maple Math] is:

> speq2:=normal(subs(x=R,diff(log(g),x)*x)-1)=n;

[Maple Math]

From this equation our algorithm produces the asymptotic expansion of the saddle-point in two stages as before:

> r2:=Invert(op(1,speq2),R):

> exp2:=multiseriesinverse([r2],scaleR,0,2,n,3,scalen);

[Maple Math]

This expansion of this new saddle-point is the same as that of the previous case. But this does not mean that both saddle-points are equal. The difference between their asymptotic behaviours can be obtained by working in a different scale. Here is a refined estimate for the first saddle-point:

> sp1:=multiseriesinverse([r1],scaleR,2,1,n,3,'scalezeta');

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

> alias(zeta=%1):

> sp1;

[Maple Math]

and here is an estimate for the second saddle-point refined similarly

> sp2:=multiseriesinverse([r2],scaleR,2,1,n,3,scalezeta);

[Maple Math]

Hence the difference can be computed at this level of the asymptotic scale

> `multiseries/expand`(x1-x2,[x1,x2],[sp1,sp2],scalezeta,3);

[Maple Math]

or in terms of [Maple Math]

> substitute(SERIEStoseries(",'polynom'),scalezeta,exp1,scalen,3);

[Maple Math]
[Maple Math]

Thus the saddle-points differ asymptotically by [Maple Math] / [Maple Math] , which could not be detected from the asymptotic expansion in the original scale.

In order to compute the average number of parts in a partition, we have to divide the estimate for the [Maple Math] th coefficient of [Maple Math] by the estimate for the [Maple Math] th coefficient of [Maple Math] . Since these estimates are given in terms of different saddle-points, the computation is more easily done by obtaining both estimates in the same scale, which involves [Maple Math] , and then substituting the estimate for [Maple Math] in terms of [Maple Math] .

> estden:=substitute(d1,scaleR,sp1,scalezeta,3);

[Maple Math]
[Maple Math]
[Maple Math]

> n1:=harris_schoenfeld(g,x,R,op(1,speq2),3,scaleR):

> estnum:=substitute(SERIEStoseries(multiseries(n1,scaleR,2,1,nops(scaleR[list]),3),'polynom'),scaleR,sp2,scalezeta,3);

[Maple Math]
[Maple Math]
[Maple Math]

Hence the ratio in [Maple Math] is

> ratio:=`multiseries/expand`(x2/x1,[x1,x2],[estden,estnum],scalezeta,3);

[Maple Math]

And here is the final result in [Maple Math] : the average number of parts in a partition of [Maple Math] elements:

> substitute(SERIEStoseries(ratio,'polynom'),scalezeta,exp1,scalen,3);

[Maple Math]

This result is classical. However, it is worth noting that classical references give at best the first term of the asymptotic behaviour (n/log n) and one of them is wrong by a factor of e=exp(1). This gives an idea of the difficulty of performing such computations by hand.

Variance

Computation of the variance leads to further cancellation. It is obtained from the generating function

> h:=subs(u=1,diff(u*diff(F,u),u));

[Maple Math]

The corresponding saddle-point equation is

> speq3:=subs(x=R,normal(diff(log(h),x)*x))-1=n;

[Maple Math]

The expansion of the saddle-point in terms of [Maple Math] is obtained as before

> r3:=Invert(op(1,speq3),R);

[Maple Math]
[Maple Math]

> sp3:=multiseriesinverse([r3],scaleR,2,1,n,3,scalezeta);

[Maple Math]

This leads to the following estimate for the [Maple Math] th coefficient of [Maple Math] , first in terms of R and then in terms of [Maple Math] by substituting R by its asymptotic expansion in terms of [Maple Math] :

> n2:=harris_schoenfeld(h,x,R,op(1,speq3),3,scaleR):

> estnum2:=substitute(SERIEStoseries(multiseries(n2,scaleR,2,1,nops(scaleR[list]),3),'polynom'),scaleR,sp3,scalezeta,3);

[Maple Math]
[Maple Math]
[Maple Math]

From there we get the variance in terms of [Maple Math]

> finalres:=`multiseries/expand`(x3/x1-(x2/x1)^2,[x1,x2,x3],[estden,estnum,estnum2],scalezeta,3);

[Maple Math]

and in terms of [Maple Math]

> substitute(SERIEStoseries(",'polynom'),scalezeta,exp1,scalen,3);

[Maple Math]

Again, only the first term is given in the literature. Our method can compute as many terms as desired, as well as the expansions of higher moments.

Conclusion

Multiseries are specially useful for saddle-point asymptotics that arise frequently in combinatorial applications. Delicate expansions (that lead to errors in the technical literature) can be handled automatically. Such a process is specially useful for moment computations that involve minute saddle-point perturbations.