Last summer, Todd and I discussed a problem and its solution, and I had wondered if it was fit enough to be in the POW-series (on this blog) when he mentioned that the problem might be somewhat too easy for that purpose. Of course, I immediately saw that he was right. But, a few days back, I thought it wouldn’t be bad if we shared this cute problem and its solution over here, the motivation being that some of our readers may perhaps gain something out of it. What is more, an analysis of an egf solution to the problem lends itself naturally to a discussion of combinatorial species. Todd will talk more about it in the second half of this post. Anyway, let’s begin.
It turns out that finding a solution to the above problem is equivalent to counting the number of forests with nodes and height at most , which I found here (click only if you wish to see the answer!) at the Online Encyclopedia of Integer Sequences. If you haven’t clicked on that link yet and wish to solve the problem on your own, then please stop reading beyond this point.
SOLUTION: There are two small (and related) observations that need to be made. And, both are easy ones.
Lemma 1: has at least one fixed point.
Proof: Pick any and let , where . Then, using the idempotent property, we have , which implies . Therefore, is a fixed point, and this proves our lemma.
Lemma 2: The elements in that are not fixed points are mapped to fixed points of .
Proof: Suppose is not a fixed point such that . Then, using the idempotent property again, we immediately have , which implies , thereby establishing the fact that itself is a fixed point. Hence, (which is not a fixed point) is mapped to some fixed point of .
In both the lemmas above, the idempotent property “forces” everything.
Now, the solution is right before our eyes! Suppose has fixed points. Then there are ways of choosing them. And, each of the remaining elements of that are not fixed points are to be mapped to any one of the fixed points. And, there are a total of ways of doing that. So, summing over all , our final answer is .
Exponential Generating Function and Introduction to Species
Hi; Todd here. Vishal asked whether I would discuss this problem from the point of view of exponential generating functions (or egf’s), and also from a categorical point of view, using the concept of species of structure, which gives the basis for a categorical or structural approach to generatingfunctionology.
I’ll probably need to write a new post of my own to do any sort of justice to these topics, but maybe I can whet the reader’s appetite by talking a little about the underlying philosophy, followed by a quick but possibly cryptic wrap-up which I could come back to later for illustrative purposes.
Enumerative combinatorics studies the problem of counting the number of combinatorial structures of some type on an -element set, such as the number of idempotent functions on that set, or the number of equivalence relations, and so on. A powerful idea in enumerative combinatorics is the idea of a generating function, where we study the series by rolling them into a single analytic function, such as
(this the so-called “exponential” generating function of ). In many cases of interest, the function will be recognizable in terms of operations familiar from calculus (addition, multiplication, differentiation, composition, etc.), and this can then be used to extract information about the series , such as explicit formulas, asymptotics, and so on. If you’ve never seen this idea in action, you should definitely take a look at Wilf’s book generatingfunctionology, or at the book Concrete Mathematics by Graham, Knuth and Patashnik.
Each of the basic operations one performs on analytic functions (addition, multiplication, composition, etc.) will, it turns out, correspond to some set-theoretic operation directly at the level of combinatorial structures, and one of the trade secrets of generating function technology is to have very clear pictures of the combinatorial structures being counted, and how these pictures are built up using these basic structural operations.
In fact, why don’t we start right now, and figure out what some of these structural operations would be? In other words, let’s ask ourselves: if and are generating functions for counting combinatorial structures of type (or species) and , then what types of structures would the function “count”? How about ? Composition ?
The case of is easy: writing
and thinking of as counting structures of type on an -element set, and as counting structures of type , the quantity counts elements in the disjoint union of the sets of -structures and -structures.
In the categorical approach we will discuss later, we actually think of structure types (or species of structure) as functors, which take an -element set to the set of structures of type on . Here, we have to be a little bit careful about what categories we’re talking about, but the general idea is that if we have a bijection from one -element set to another, then it should always be possible to “transport” -structures on to -structures on , simply by relabeling points along the bijection . So, let us define a species to be a functor
where is the category of finite sets and bijections (not all functions, just bijections!), and is the category of sets. In enumerative combinatorics, the set is normally assumed to be finite, but in other applications of the notion of species, we actually allow a lot more latitude, and allow the functor to map into other categories , not just (“-valued species”). But if we stick for now just to set-valued species , , then we define the species by the functorial formula
where denotes disjoint union. So addition of generating functions will correspond to the concrete operation of taking disjoint unions of sets of combinatorial species.
More interesting is the case of multiplication. Let’s calculate the product of two egf’s:
The question is: what type of structure does the expression “count”? Look at the individual terms: the binomial coefficient describes the number of ways of decomposing an -element set into two disjoint subsets, one with elements and the other with , where and add to . Then, is the number of ways of putting an -structure on the -element part, and is the number of -structures on the -element part.
This suggests a new operation on structure types: given structure types or species , we define a new species according to the formula
(that is, a structure of type on a set is an ordered pair, consisting of an -structure on a subset of and a -structure on its complement). This functorial operation is usually called the “convolution product” of the combinatorial species : it is the concrete set-theoretic operation which corresponds to multiplication of generating functions.
Finally, let’s look at composition . Here we make the technical assumption that (no -structures on the empty set!), so that we won’t have divergence issues blowing up in our faces: we want to remain safely within the realm of finitary structures. Okay, then, what type of combinatorial structure does this egf count?
Perhaps not surprisingly, this is rather more challenging than the previous two examples. In analytic function language, we are trying here to give a meaning to the Taylor coefficients of a composite function in terms of the Taylor coefficients of the original functions — for this, there is a famous formula attributed to Faà di Bruno, which we then want to interpret combinatorially. If you don’t already know this but want to think about this on your own, then stop reading! But I’ll just give away the answer, and say no more for now about where it comes from, although there’s a good chance you can figure it out just by staring at it for a while, possibly with paper and pen in hand.
Definition: Let be species (functors from finite sets and bijections to finite sets), and assume . The substitution product is defined by the formula
This clearly requires some explanation. The sum here denotes disjoint union, and denotes the set of equivalence relations on the finite set . So here is an equivalence relation, which partitions into nonempty sets (-equivalence classes). And the quotient denotes the set of such equivalence classes (so we think of each class as a point of ). What this formula says is that a structure of type on consists of a partition of into a bunch of non-empty blobs, a -structure on each blob, and then an -structure on the set of blobs.
It’s high time for an example! So let’s look at Vishal’s problem, and see if we can picture it in terms of these operations. We’re going to need some basic functions (or functors!) to apply these operations to, and out of thin air I’ll pluck the two basic ones we’ll need:
The first is the generating function for the series . So for the species , there’s just one structure of type for each set (in categorical language, the functor is the terminal functor). We can just think of that structure as the set itself, if we like, with no other structure appended thereon.
For , we have unless , where . So is the species for the one-element set structure (meaning that unless has cardinality 1, in which case ).
Okay, on to Vishal’s example. He was counting the number of idempotent functions , and now, as promised, I want to determine the corresponding egf. You might be able to find it by looking at his formula, but obviously I want to use the ideas I’ve developed thus far, which focuses much more on the pictures. So, let’s picture , first as Vishal did, by thinking of the elements of as ‘nodes’, and then drawing a directed edge from node to node if . (Then, by idempotence of , will be a fixed point of . Let’s agree not to bother drawing an edge from to itself, if is already a fixed point.)
In this picture, we get a directed graph which consists of a disjoint union of “sprouts”: little bushes, each rooted at a fixed point of , whose only other nodes are “leaves” joined to the root by an edge. We can simplify the picture a little: if you put a circle around each sprout, you don’t need the edges at all: just mark one of the points inside as the root, and you know what to do.
So we arrive at a picture of an idempotent function on : a partition of into a collection of (nonempty) blobs, and inside each blob, one of the points is marked “root”. In terms of our operations, what does it mean to mark a point in a blob? It just means: break the blob into two pieces, where one piece is given the structure of “one-element set”, and the other piece is just itself. In terms of the ideas developed above, this means each blob carries a structure; we’ll suggestively write this structure type as .
In this picture of idempotent , there is no extra combinatorial structure imposed on the set of blobs, beyond the set itself. In other words, in this picture, the set of blobs carries merely an “-structure”, nothing more.
So, putting all this together, we picture an idempotent function on as a partition or equivalence relation on , together with an assignment of a marked point in each equivalence class. In the language of species operations, we may therefore identify the structure type of idempotent functions with
or more suggestively, . The exponential generating function is, of course, !
In summary, the theory of species is a functorial calculus which projects onto its better-known “shadow”, the functional calculus of generating functions. That is to say, we lift operations on enumeration sequences , as embodied in their generating functions, directly up to the level of the sets we’re counting, where the functorial operations become both richer and more concrete. The functorial analogue of the generating function itself is called the “analytic functor” attached to the species (the species itself being the concrete embodiment of the enumeration).
Much more could be said, of course. Instead, here’s a little exercise which can be solved by working through the ideas presented here: write down the egf for the number of ways a group of people can be split into pairs, and give an explicit formula for this number. Those of you who have studied quantum field theory may recognize this already (and certainly the egf is very suggestive!) ; in that case, you might find interesting the paper by Baez and Dolan, From Finite Sets to Feynman Diagrams, where the functorial point of view is used to shed light on, e.g., creation and annihilation operators in terms of simple combinatorial operations.
The literature on species (in all its guises) is enormous, but I’d strongly recommend reading the original paper on the subject:
- André Joyal, Une théorie combinatoire des séries formelles, Adv. Math. 42 (1981), 1-82.
which I’ve actually referred to before, in connection with a POW whose solution involves counting tree structures. Joyal could be considered to be a founding father of what I would call the “Montreal school of combinatorics”, of which a fine representative text would be
- F. Bergeron, G. Labelle, and P. Leroux, Combinatorial Species and Tree-like Structures, Encyclopedia of Mathematics and its Applications 67, 1998.
More to come, I hope!