Expected value of letters of permutations with a given number of -cycles
In this paper, we study permutations with exactly transpositions. In particular, we are interested in the expected value of when such permutations are chosen uniformly at random. When is even, this expected value is approximated closely by , with an error term that is related to the number isometries of the -dimensional hypercube that move every face. Furthermore, when , this construction generalizes to allow us to compute the expected value of for permutations with exactly -cycles. In this case, the expected value has an error term which is related instead to the number derangements of the generalized symmetric group .
When does not divide , the expected value of is precisely . Indirectly, this suggests the existence of a reversible algorithm to insert a letter into a permutation which preserves the number of -cycles, which we construct.
1 Background
In 2010, Mark Conger [3] proved that a permutation with descents has an expected first letter of , independent of . This paper has the same premise, but with a different permutation statistic: the number of -cycles of a permutation.
This section, (Section 1) provides an overview of where weβre headed, and includes an critical example that will hopefully spark the readerβs curiosity and motivate the remainder of the paper.
Section 2 establishes some recurrence relations for the number of permutations in with a given number of -cycles. It also contains a theorem that gives an explicit way to compute the expected value of the first letter based on these counts.
Section 3 describes an explicit correspondence between -cycles of permutations in and fixed points of elements of the generalized symmetric group . Using generating functions and results from the previous section, this shows that the expected value of of a permutation with a given number of -cycles is intimately connected to the number of derangements of a generalized symmetric group.
While Section 3 emphasizes the case of , Section 4 looks at where . Here, the expected value of is simply , which agrees with the expected value of the first letter of a uniformly chosen -letter permutation with no additional restrictions. This fact together with the main theorem from Section 2 implies the existence of a bijection that preserves the number of -cycles whenever . Section 4 constructs such a bijection explicitly, and proves that it has the desired properties.
1.1 Motivating Examples
In support of the first examples, we start by defining the first bit of notation.
Definition 1.1.
Let denote the number of permutations such that has exactly -cycles.
These theoremsβand many of the following lemmasβwere discovered by looking at examples such as the following, written in both one-line and cycle notation:
Example 1.2.
There are permutations in with no -cycles:
There are permutations in with exactly one -cycle:
And there are permutations in with exactly two -cycles,
By averaging the first letter over these examples, we can compute that
The table in Figure 1 gives the expected value of given that and has exactly -cycles in its cycle decomposition. Notice that when is odd, row has a constant value of . Also notice that the number in position has the same denominator as the number in position , and that these denominators increase with . The sequence of denominators begins
(1.1) |
which agrees with the type B derangement numbers, sequence A000354 in the On-Line Encyclopedia of Integer Sequences (OEIS) [6]. In other words, the denominators in the table appear to be related to the symmetries of the hypercube that move every facet.
2 Structure of permutations with -cycles
This section is about connecting the number of permutations with a given number of -cycles to the expected value of the first letter. Saying this, it is appropriate to start with a 1944 theorem of Goncharov that, by the principle of inclusion/exclusion, gives an explicit formula that counts the number of such permutations.
2.1 Counting permutations based on cycles
Theorem 2.1 ([5], [1]).
The number of permutations in with exactly -cycles is given by the following sum, via the principle inclusion/exclusion:
(2.1) |
Corollary 2.2.
For , there are exactly times as many permutations in with exactly -cycles than there are in . When , there is an explicit formula for the difference.
(2.2) | |||||
(2.3) |
Proof.
When , , so the bounds on the sums are identical and the result follows directly
(2.4) |
Otherwise, when , , so
(2.5) |
β
2.2 Permutations by first letter
In order to compute the expected value of the first letter of a permutation, it is useful to be able to compute the number of permutations that have a given number of -cycles and a given first letter.
Definition 2.3.
Let be the number of permutations that have exactly -cycles and .
The expected value of with a given number of -cycles is
(2.6) |
The following three lemmas compute from .
Proposition 2.4.
For all , the number of permutations in starting with and having -cycles is equal to the number of permutations in with -cycles:
(2.7) |
Proof.
The straightforward bijection from to given by deleting and relabeling preserves the number of -cycles for . β
Proposition 2.5.
For all , the number of permutations having -cycles and starting with are the same as the number of those starting with :
(2.8) |
Proof.
Since the permutations under consideration do not fix , conjugation by is an isomorphism which takes all words starting with to words starting with without changing the cycle structure. β
Lemma 2.6.
For all ,
(2.9) |
Proof.
Now, equipped with explicit formulas for and , we can compute the expected value of for with exactly -cycles.
2.3 Expected value of first letter
Theorem 2.7.
For , the expected value of the first letter of a permutation with -cycles is given by
(2.12) |
Proof.
Corollary 2.8.
When , by Equation 2.2, so
(2.18) |
Together with Theorem 2.1, this theorem and its corollary provides our first formula for the expected value of that performs exponentially better than brute force.
2.4 Identities for counting permutations with given cycle conditions
Both in practical terms (if computing the expected value of by hand or optimizing an algorithm) and in a theoretical sense, the following recurrence is simple and useful.
Lemma 2.9.
For or , . Otherwise, for all
(2.19) |
While this can be proven directly by the algebraic manipulation of the identity in Theorem 2.1, a bijective proof has been included here because it is natural and may be of interest.
Proof.
Let
(2.20) |
Then consider the two sets, whose cardinalities match the left- and right-hand sides of the equation above:
(2.21) | ||||
(2.22) |
The first set, , is constructed by taking a permutation in and choosing one of its -cycles to be distinguished, so .
In the second set, , the two parts of the tuple are independent. There are choices for the permutation and choices for the necklace . Thus .
Now, consider the map which removes the distinguished -cycle and relabels the remaining letters as , preserving the relative order:
(2.23) |
where is after relabeling.
By construction, has one fewer -cycle and fewer letters than .
The inverse map is similar. To recover , increment the letters of appropriately and add the necklace back in as the distinguished cycle. Thus is a bijection and . β
Example 2.10.
Suppose in cycle notation with distinguished. Then
(2.24) |
under the bijection , described in the proof of Lemma 2.9.
The recurrence in Lemma 2.9 suggests that understanding is related to understanding , the permutations of with no -cycles. On the other hand, Corollary 2.2 suggests that the case where has some of the most intricate structure. We can, of course, combine these two observations and analyze the case of , which has a particularly simple generating function, which will show up again in a different guise.
Lemma 2.11.
For ,
(2.25) |
Proof.
This section allowed for the practical computation of the expected value of with a given number of -cycles, but leaves the observation about Figure 1 unexplained. The following section will explain the connection between the expected values of and the facet-derangements of the hypercube.
3 Connection with the generalized symmetric group
This section explains the connection between the expected value of given that has exactly -cycles and the facet-derangements of the hypercube, by telling the more general story of derangements of the generalized symmetric group. Thus it is appropriate to start this section by defining both the generalized symmetric group and its derangements.
3.1 Derangements of the generalized symmetric group
Definition 3.1.
The generalized symmetric group is the wreath product , which in turn is a semidirect product .
A natural way of thinking about the symmetric group is by considering how the elements act on length- sequences by permuting the indices. Informally, we can think about the generalized symmetric group in an essentially similar way: each element consists of an ordered pair in , where gives information about what to add componentwise, and gives information about how to rearrange afterward.
Example 3.2.
Consider the generalized permutation
It acts on the sequence first by adding element-wise, and then permuting:
(3.1) |
When , the sequence is trivially the zero sequence, so . When , is the hyperoctahedral group that we brushed up against in Figure 1: the group of symmetries of the -dimensional hypercube. When , does not have such an immediate geometric interpretation, but it is precisely the right analog for the expected value of when has a given number of -cycles.
Definition 3.3.
A derangement or fixed-point-free element of the generalized symmetric group is an element such that for all , either or .
That is, when a derangement acts on a sequence in the manner described above, it changes the position or the value of every term in the sequence. When and , this recovers the usual sense of a derangement in : a permutation with no fixed points. In terms of the hyperoctahedral group, , a derangement is a symmetry of the -cube that moves each -dimensional face.
Example 3.4.
The element is a derangement because it increments the first term and swaps the second and third termsβthus changing the position or value for each term.
The number of derangements of the generalized symmetric group can be described by an explicit sum via the principle of inclusion/exclusion, and it has a particularly elegant exponential generating function.
Theorem 3.5 ([2]).
For , the number of derangements of the generalized symmetric group is
(3.2) |
which has exponential generating function
(3.3) |
Notice that this agrees identically with the generating function in Lemma 2.11, which is our first hint in explaining the connection between -cycles in permutations and fixed points in elements of the generalized symmetric group.
3.2 Permutation cycles and derangements
Lemma 3.6.
For , the number of permutations with letters and -cycles is
(3.4) |
Algebraic proof.
This will proceed by induction on . The base case is clear when , so suppose that the lemma is true up to , that is
(3.5) | ||||
(3.6) |
Rearranging Lemma 2.9,
(3.7) | ||||
(3.8) |
Now, notice there is a term in the numerator of Equation 3.6 and the denominator of Equation 3.8, so substituting and simplifying yields
(3.9) |
as desired. β
Combinatorial proof.
This lemma lends itself to a combinatorial proof. The left hand side of the equation counts the number of permutations in with exactly -cycles. The right hand side of the equation says that this is the number of ways to choose letters in the permutation that will not be in -cycles, and for each of these, there are ways to arrange these such that they have no -cycles. This leaves over letters, of which there are ways to write them as products of disjoint -cycles. β
The following lemma uses the above identities to establish that the proportion of permutations in the symmetric group with exactly -cycles is equal to the proportion of elements in the generalized symmetric group with exactly fixed points.
Lemma 3.7.
For ,
(3.10) |
Proof.
By solving for on the right hand side and substituting for , it is enough to show that the exponential generating function for (as shown in Theorem 3.5) is also the exponential generating function for
(3.11) |
By the identity in Lemma 3.6,
(3.12) | |||
(3.13) | |||
(3.14) | |||
(3.15) |
with the final equality being the identity in Lemma 2.11. β
3.3 Expected value of letters of permutations
We now have the ingredients we need to prove the pattern that we observed in Figure 1 that purported to show a relationship between permutations given number of -cycles and derangements of the hyperoctahedral group. These ingredients come together in the following theorem, which establishes the more general relationship between permutations with a given number of -cycles and derangements of the generalized symmetric group, .
Theorem 3.8.
The expected value of the first letter of a permutation with exactly -cycles, where and , is
(3.16) |
where is the number of derangements of the generalized symmetric group .
Proof.
Inverting the identity in Lemma 3.7, yields
(3.17) |
Multiplying through by to match the right hand side of Equation 3.16, together with some small manipulations yields
(3.18) |
Now adding and dividing by yields
(3.19) |
which gives the right hand side as desired. Since the numerator on the left hand side is equal to by Equation 2.2, the proof then follows from by Theorem 2.7. β
With the expected value of the first letter found, we can generalize this one more step to find the expected value of the -th letter of these permutations.
Corollary 3.9.
The expected value of the -th letter of a permutation in with exactly -cycles, where , , , and , is
Proof.
Denote by the number of permutations in with -cycles where is a fixed point; denote by the number of permutations in with -cycles where . Note that while and implicitly depend on , , and , does not depend on by Proposition 2.5.
Thus
(3.20) |
More generally, if we conjugate with then
(3.21) |
We can extend the function to a function where is not necessarily an integer. As can be seen in Equation 3.21, is affine function in . By Theorem 3.8, when ,
When yields
Because is affine in , it is enough to use linear interpolation and extrapolation to compute for arbitrary . This can be done by scaling the term by an affine function of which is when and which vanishes when , namely , as desired. β
Example 3.10.
For , , and the expected value of the first letter in a permutation in with no -cycles is , as shown in Example 1.2. This agrees with Theorem 3.8:
(3.22) |
since as illustrated in Figure 2.
While Theorem 2.7 gave us our first way to efficiently compute the expected value of the first letter of a permutation on letters with a given number of -cycles, we can also compute this efficiently with Theorem 3.8 by using the formulas for in Theorem 3.5. But this is not the only reason that Theorem 3.8 is of interest; because of the structure of the formula it provides, this theorem suggests other quantitative and qualitative insights.
Recall that when there are no restrictions on a permutation , the first letter is equally likely to take on any value, so . The first insight given by Theorem 3.8 is that the expected value of given some number of cycles differs from by at most , because for . Secondly, since increases as a function of , the expected value gets closer to as the number of -cycles decreases. Lastly, the numerator of in the second summand of Equation 3.16 shows that the expected value of the first letter is larger than if and only if and have the same parity.
4 A -cycle preserving bijection
Motivated by Equation 2.2, this section describes a family of bijections,
each of which preserves the number of -cycles when . Of course, there is no map that preserves the number of -cycles when . For example, a permutation in consisting entirely of -cycles contains -cycles, while a permutation in can contain at most -cycles by the pigeonhole principle.
Informally, these maps are defined by writing down a permutation in canonical cycle notation, incrementing all letters in that are greater than or equal to , inserting into the rightmost cycle, and then recursively moving letters into or out of subsequent cycles, whenever a -cycle is turned into a -cycle or a -cycle is turned into a -cycle.
4.1 Example of recursive structure
The definition of the map can look complicated, so itβs worthwhile to start with an example to give some sense of the overarching idea.
Example 4.1.
This example illustrates how the map inserts into the permutation while preserving the number of -cycles. The maps and are the result of moving letters according to the arrows and are applied from right-to-left. (This example uses the convention that .)
Again, it is worth reemphasizing that the following definitions will follow the convention that permutations are written in canonical cycle notation,
where cycle has letters. This means that the first letter in each cycle, , is the largest letter in that cycle, and that the cycles are ordered in increasing order by first letter when read from right-to-left: for all .
4.2 Formal definition and properties
Definition 4.2.
Define recursively as follows:
(4.1) |
and for , , and ,
(4.2) | |||||
(4.3) | |||||
(4.4) | |||||
otherwise. | (4.5) |
Here, depends on the auxillary function ,
(4.6) | |||||
(4.7) | |||||
(4.8) | |||||
otherwise, | (4.9) |
and in both functions, .
Note 4.3.
Strictly speaking, and have an additional implicit parameter , which indicates the size of permutation that these functions act on. Since the construction of these functions do not depend on , this is suppressed in the notation.
Theorem 4.4.
If , the number of -cycles of is equal to the number of -cycles in .
Proof.
By construction, the maps and change the rightmost cycle into a (different) -cycle if it was previously a -cycle, and they change non--cycles into non--cycles, except for the case where there is one cycle remaining with length (in the case of ) or length (in the case of ). These cases can only be achieved when , by the following lemma. β
Lemma 4.5.
The number of letters in in (recursive) applications of and are of congruent to and , respectively. Therefore, the only time that the input to can be a single cycle of length or the input to can be a single cycle of length is when .
Proof.
The proof proceeds by induction on the number of recursive iterations of and . The base case is clear: on the first application of a map is always , and the input permutation has letters by definition.
Now, either weβre finished, or we recurse (Equations 4.3, 4.4, 4.7, or 4.8), which we look at case-by-case.
-
Case 1.
In Equation 4.3, the map sets aside letters from the input, so the number of letters in the recursive input to is also congruent to .
-
Case 2.
In Equation 4.4, the map sets aside letters from the leftmost cycle of the input. Since the number of letters in the original permutation was congruent to , the number of letters in the permutation being input to is congruent to .
-
Case 3.
In Equation 4.7, the map sets aside letters from the leftmost cycle of the input. Since the number of letters in the original permutation was congruent to , the number of letters in the permutation being input to is congruent to .
-
Case 4.
In Equation 4.8, the map sets aside letters from the input, so the number of letters in the recursive input to is also congruent to .
β
The following lemma provides a certain βnicenessβ property of the map, which allows us to analyze it. In particular, all recursive inputs in both and are written in canonical cycle notation.
Lemma 4.6.
The output of is in canonical cycle notation.
Proof.
Canonical cycle notation is preserved by construction. In particular, moves the first letter in any cycle, and Equation 4.2 guards against inserting a number into a cycle that is bigger than the largest number already in the cycle. Similarly, only moves the first letter in the case of Equation 4.6, but in this case, the cycle only has one letter, so this is equivalent to deleting the cycle. β
4.3 Inverting the bijection
Lemma 4.7.
The maps and are inverse to one another.
Proof.
To prove this lemma, it suffices to show that by induction on the number of cycles of . This will simultaneously prove that , because and , both having elements, have the same cardinality.
When has no cycles, the base case is clear: .
Now there are five remaining cases to check, corresponding to each of the cases in the definition of
-
Case 1.
Assume , so that is evaluated via Equation 4.2:
(4.10) (4.11) (4.12) -
Case 2.
Assume , so that is evaluated via Equation 4.3:
(4.13) (4.14) - Case 3.
-
Case 4.
Assume that and , so that is evaluated via Equation 4.5:
(4.19) (4.20) (4.21) -
Case 5.
Assume that and , so that is evaluated via Equation 4.5:
(4.22) (4.23) (4.24)
β
In this section we constructed a recursively-defined map and its inverse to give a bijective proof that when . This is a novel, reversible algorithm for inserting a letters into a permutation that preserves the number of -cycles whenever possible.
5 Further directions
In the introduction, we mentioned Congerβs paper which analyzed how the number of descents of a permutation affects the expected value of the first letter of the permutation. And similarly in the following sections, we looked at how the number of -cycles affects the expected value of the first letter of the permutation. This section will principally look at the obvious generalization: given some permutation statistic , does the map
(5.1) |
have any interesting structure?
But notice that the first letter of a permutation is itself a statistic, so we can play a more general game. Given pairs of statistics , does the map
(5.2) |
have any interesting structure?
5.1 FindStat database
The result by Conger gives the expected value of given , and this paper gave the expected value of given the number of -cycles of . Of course, it would be interesting to do analogous analysis with other permutations. In particular, the FindStat permutation statistics database [7] contains over 370 different permutation statistics, and many of these appear to have some structure with respect to the expected value of the first letter of a permutation.
5.2 Mahonian statistics
In particular, the family of Mahonian statistics may be fruitful to investigate. Below, we have given conjectures about two: the major index and the inversion number. Mahonian statistics are maps that are equidistributed with the inversion number.[4] That is,
Naturally, all Mahonian statistics share the same generating function:
Because the expected value of the first letter is given by the weighted sum of the permutations with divided by the number of such permutations, has a denominator that is (a factor of) , the number of permutations of such that . For fixed , these satisfy a degree polynomial for all . Notably, in the cases of the major index and the inversion number, the numerators appear to satisfy degree and degree polynomials respectively.
Conjecture 5.1.
For fixed and , the expected value of the first letter of a permutation with a given number of inversions satisfies a rational function in given by
where , as above, is the number of permutations such that .
Conjecture 5.2.
For fixed and , satisfies a rational function in that is times the quotient of a monic degree- polynomial by a monic degree- polynomial. Specifically,
(5.3) | ||||
(5.4) | ||||
(5.5) | ||||
(5.6) |
Note that the denominator is given by an integer multiple of , a degree polynomial.
5.3 An elusive bijection
Let be the number of elements of the generalized symmetric group with fixed points, and recall that is the number of elements of with -cycles. Then for each pair of nonnegative integers with , then as Lemma 3.7 suggests, there exists a bijection of sets
(5.7) |
This bijection has proven to be elusive to construct outside of the special cases where or . Note that, the map cannot be a group automorphism of , because the identity of this group is in , so it cannot be preserved under this map.
It would be especially interesting if thereβs a way to use the embedding of into as the centralizer of an element that is the product of disjoint cycles.
6 Acknowledgments
A special thanks to my advisor, Sami Assaf, for sharing the spark that she found for this questions in a remark by Jim Pitman, and for her patient guidance. This paper benefitted from the feedback from my colleague, Sam Armon and his generosity, kindness, and sharp eye. It is unlikely that this paper would have been written if not for the On-Line Encyclopedia of Integer Sequences, which gave a several crucial hints, especially around the pattern in Figure 1.
References
- [1] Richard Arratia and Simon Tavare. The cycle structure of random permutations. The Annals of Probability, 20(3):1567β1591, 1992.
- [2] SamiΒ H Assaf. Cyclic derangements. The Electronic Journal of Combinatorics, 17(R163), 2010.
- [3] Mark Conger. A refinement of the Eulerian numbers, and the joint distribution of and in . Ars Combinatoria, 95, 04 2010.
- [4] Dominique Foata. Distributions euleriennes et mahoniennes sur le groupe des permutations. In Martin Aigner, editor, Higher Combinatorics, pages 27β49, Dordrecht, 1977. Springer Netherlands.
- [5] V.Β Goncharov. Du domaine de lβanalyse combinatoire. Izv. Akad. Nauk SSSR Ser. Mat., 8:3β48, 1944.
- [6] OEISΒ Foundation Inc. The On-Line Encyclopedia of Integer Sequences, 2021.
- [7] Martin Rubey, Christian Stump, etΒ al. FindStat - The combinatorial statistics database. http://www.FindStat.org. Accessed: .