Derangements, Dobiński's formula, and their combination
A couple of years ago, someone on a mailing list asked for a proof for their observation that
where
Actually, this appears to be the
The “symbolic method” of Flajolet and Sedgewick (from their book Analytic Combinatorics) gives a nice unifying framework that puts in perspective (1) the relation between permutations and derangements, (2) Dobinski’s formula, and (3) this result — when viewed from this lens, all these results feel very natural (IMO).
0. Background (EGFs and labelled products)
Suppose we have a combinatorial class
It makes sense to use EGFs when these objects are labelled, i.e. if an object is of size
Some trivial examples:
-
for the classes containing only a single element of size 0, thus having EGF . -
for the class containing only a single element of size , thus having EGF . -
for an “urn”, i.e. a set of elements: There is exactly one for every size, i.e. for all , and .
We can define the labelled product of two such combinatorial classes: put together an object from the first class and an object from the second, redistributing labels so that the relative order is consistent within each object. For two classes
Note that the binomial convolution
-
the combinatorial interpretation (to obtain an object of size
in , take an object of size from , and one of size from , choose in ways which labels of are given to the former, and re-label both accordingly), and -
the formal expression: the coefficient of
in , namely is got via products of the form for some .
With that quick background (explained more clearly in the book!), all three results have very short proofs.
1. Permutations and derangements
Let
Let
Comparing coefficients of
(BTW, the same “symbolic method” also gives us a couple of other ways of deriving the same expression for
2. Surjections and all functions (Dobiński’s formula)
Fix a set
Let
Let
Now, any such function is the labelled product of a surjection and set of “dummy” elements (in the co-domain but not in the range). So we have
Setting
which is known as Dobiński’s formula.
I had posted this online at some point, excuse the handwriting:
3. Putting them together
Above we’ve seen that
So
and for