Available online at www.sciencedirect.com
Electronic Notes in Discrete Mathematics 38 (2011) 291–296 www.elsevier.com/locate/endm
Permutations with few internal points Filippo Disantoa Enrica Duchib Simone Rinaldia Gilles Schaefferc 1 a Universit` a
´ di Siena, b Universit´e Paris 7, and c CNRS – Ecole Polytechnique
Abstract Let the records of a permutation σ be its left-right minima, right-left minima, leftright maxima and right-left maxima. Conversely let a point (i, j) with j = σ(i) be an internal point of σ if it is not a record. Permutations without internal points have recently attracted attention under the name square permutations. We consider here the enumeration of permutations with a fixed number of internal points. We show that for each fixed i the generating function of permutations with i internal points with respect to the size is algebraic of degree 2. More precisely it is a rational function in the Catalan generating function. Our approach is constructive, yielding a polynomial uniform random sampling algorithm, and it can be refined to enumerate permutations with respect to each of the four types of records. Keywords: permutation records; algebraic generating function; Catalan numbers Let S be a finite set of points in the plane. A point p of S is internal if each of the four standard quadrants at p contains at least another point of S, external otherwise (Fig 1). The set of external points of S (aka HV-hull) depends only on the relative orders of the abscissas and of the ordinates: this implies e.g. that the number of internal points of a random set of n points in a rectangle is equidistributed to that of (the diagram of) a random permutation of Sn . We shall be concerned with the “almost HV-convex” case of permutations with few internal points. 1
GS acknowledges the support of ERC under StG 208471 ExploreMaps
1571-0653/$ – see front matter © 2011 Elsevier B.V. All rights reserved. doi:10.1016/j.endm.2011.09.048
292
F. Disanto et al. / Electronic Notes in Discrete Mathematics 38 (2011) 291–296
Fig. 1. Quadrants around a left-right Fig. 2. A permutation with 3 internal points max, and around an internal point. and a square permutation with 1 double pt. Permutations without internal points, called square permutations (Fig 2), were first studied by Severini and Mansour [6], who proved a surprisingly simple formula for the number of such permutations of size n: 2(n + 2)4n−3 − 4(2n − 5)
2(n − 3) . n−3
Duchi and Poulalhon [5] obtained a generating tree for these permutations that yields a shorter derivation of this formula. Square permutations are also related to the permutation diagrams called convex permutominoes in [3], and were characterized as the permutations avoiding a certain set of 16 patterns of length 5 [1]. In this paper we present a generation algorithm for the set S (i) of permutations with i internal points, which extends the generating tree of [5]. Our construction yields a system of equations satisfied by the generating function (gf) with respect to the size of permutations having a fixed number of internal points. Theorem 0.1 For all i ≥ 0, the gf F (i) (t) = σ∈S (i) tn(σ) is algebraic of degree 2 and there exists a rational function R(i) (u) such that √ 2n n 1 − 1 − 4t 1 (i) (i) = t where C(t) = F (t) = R (C(t)), 2t n+1 n n≥0
(n(σ) denotes the size of σ). In particular for i = 1, 2, 3, we get the expressions R(i) (u) =
8(u − 1)3+i P (i) (u), u1+i (2 − u)4+4i
where P (1) (u) = 3u4 − 14u3 + 17u2 − 4u − 4, P (2) (u) = 5u8 − 21u7 − 22u6 + 246u5 − 433u4 + 291u3 − 26u2 − 60u + 24, and P (3) (u) = 7u12 + 16u11 − 498u10 + 2108u9 − 3255u8 − 284u7 + 6590u6 − 7756u5 + 3188u4 + 960u3 − 1856u2 + 960u − 192. The algebricity result extends to the refined gf w.r.t. the four types of records: F (i) (t; α, β, μ, ν) = σ∈S (i) tn(σ) αlrm(σ) β lrM (σ) μrlm(σ) ν rlM (σ) . While the enumeration of permutations w.r.t. two types of records is a standard textbook exercice, this is, to the best of our knowledge, the first general result for the enumeration of permutations with respect to the four types of records.
F. Disanto et al. / Electronic Notes in Discrete Mathematics 38 (2011) 291–296
1
293
A generating tree for permutations
1.1 How to define a generating tree: last inserted point, parents, children Given a permutation σ of size n and an index 1 ≤ i ≤ n the reduced permutation σ\i is the permutation obtained by removing column i and row σ(i) in the diagram ⎧ of the permutation: ⎧ σ\i (j) =
⎨ σ(j )
if σ(j ) < σ(i)
⎩ σ(j ) − 1 if σ(j ) > σ(i)
where j =
⎨j
if j < i
⎩ j + 1 if j ≥ i
A generating tree is a rooted tree whose vertices are the permutations, with the empty permutation at the root of the tree, and such that the parent of each permutation σ of size n is a permutation φ(σ) of size n − 1. It is a simple generating tree if each permutation is obtained from its parent by the insertion of one point in its diagram, or equivalently, if there exists for each permutation σ of size n > 0 a point (i, i ) with i ∈ {1, . . . , n} and i = σ(i) such that the parent of σ in the tree is σ\i . Conversely any mapping m such that m(σ) ∈ {1, . . . , n} for all σ of size n > 0 uniquely defines a simple generating tree with parent relation φ(σ) = σ\m(σ) , and m(σ) is called the last inserted entry of σ with respect to this generating tree. For instance, the usual way to grow permutations by insertion of a new rightmost entry corresponds to m(σ) = n. The resulting generating tree is very regular: each σ of size n − 1 has n children, so that, as expected, the number of permutations at depth n in the tree is n!. Moreover the evolution of the numbers of lr-min and lr-max can easily be tracked: any σ with k lrmin and lrmax generates one permutation with k + 1 lrmin and lrmax (taking σn = 1), one with k lrmin and + 1 lrmax (taking σn = n) and n − 2 with k lrmin and lrmax (taking 1 < σn < n). The number of rlmax and rlmin in the children of a permutation σ does not behave so good: it depends on the positions of the rlmax and rlmin in σ. Therefore, this generating tree does not allow to study internal points in permutations.
1.2 Our choice for the last inserted point, and the induced generating tree In order to circumvent the problem we grow permutations in a way that will ensure that the number⎧of internal points increases at most by one at each insertion. Let: m0 (σ) =
⎨ 1 if σ(1) < σ(2) , ⎩ 2 if σ(1) > σ(2)
and
μ0 (σ) = (i, σ(i)) with i = m0 (σ)
The point μ0 (σ) is the lowest of the two leftmost points of the diagram of σ. Removing μ0 (σ) from the diagram of σ might transform some internal points of σ into lrmin of σ\m0 (σ) . To identify and deal with this case, we have to consider the core of σ, that is, the set of points (i, j) of R2 such that {(h, k) : h < i, k < j} contains μ0 (σ) and no other external point of σ. Now, if the core of σ contains no internal points, we take m(σ) = m0 (σ), and then φ(σ) = σ\m(σ) has the same number of internal points as σ. Otherwise we take m(σ) to be the abscissa of the leftmost internal point in the core, so that φ(σ) = σ\m(σ) has one less internal point and the same records as σ (Fig. 3).
F. Disanto et al. / Electronic Notes in Discrete Mathematics 38 (2011) 291–296
294
Fig. 3. The successive parents of σ with our choice of m(σ) (dotted line shows core).
j0
j0 i0
Fig. 4. External active zone and the corresponding 4 children.
i0
Fig. 5. Internal active zone and the corresponding 4 children.
1.3 Analysis of the generating tree The analysis of φ shows that the children of a permutation σ are obtained by inserting a point in the diagram of σ in one of the following two sets of points: — external active zone (Fig. 4): points (i− 12 , j− 12 ) with i ∈ {1, 2} and j0 < j ≤ σ(1), where (i) j0 = σ(i0 ) with i0 ≡ i0 (σ) the leftmost lrmin of σ which is not [an rlmax different from n], if i0 exists and σ(i0 ) > 1; (ii) j0 = 0 otherwise. — internal active zone (Fig. 5): points (i − 12 , j − 12 ) that simultaneously: (i) belong to the core of σ, (ii) are on the left hand side of all [the internal points of σ that are in the core of σ], and (iii) have another point of σ in their upper right quadrant. Proposition 1.1 The set φ−1 (σ) of children of σ exactly consists of the permutations obtained from σ by inserting a point in one of the two active zones. In order to describe the regularities of the generating tree we are led to consider a partition C = {Adu , Bang , Bdc , Bau , Bac , Cdu , Ddc , Dau } of the set of permutations into eight classes, and six parameters describing the shape of the two active zones: k(σ), (σ), j(σ) describe the external active zone while p(σ), q(σ) and r(σ) describe the internal active zone (see the full paper [4] for a definition of the partition and of the parameters). The following proposition explains our interest in this classification. Proposition 1.2 The shape of the subtree of the generating tree rooted at a permutation σ depends only on the class and parameters (E; k, j, , p, q, r) of σ. In particular, the children of σ belong to classes and have parameters that are given explicitely in terms of (E; k, j, , p, q, r) in the tables of the full paper [4] Consider, e.g. a permutation σ of the class Ddc with parameters (k, j, , p, q, r): the table excerpt on the rhs indicates Class k j p q r range that such a σ has k − 1 children in Dac i j + 1 0 k − i + 1 k − i + 1 j i = 1..k − 1 Dac and gives their parameters.
F. Disanto et al. / Electronic Notes in Discrete Mathematics 38 (2011) 291–296
2
295
Recursive enumeration and random sampling
Let us associate a gf to each class E ∈ C and each fixed i ≥ 0, as follows: E (i) (t; u, v, w; x, y, z) = σ∈E (i) tn(σ) uk(σ) v j(σ) wl(σ) xp(σ) y q(σ) z r(σ) . It will be useful to use the following short hand notations: z¯ ≡ 1/z, and E(u, v, w) ≡ E(t; u, v, w; 1, 1, 1), and E[x, y, z] ≡ E(t; u, v, w; x, y, z). Proposition 2.1 The family of gfs {E (i) (t; u, v, w; x, y, z), E ∈ C}, satisfy a system of linear equations of the form E (0) [x, y, z] = tfE ({F (0) (u, v, w), F ∈ C}; x, y, z) + tuvδE=Adu + tδE=Bang and for i ≥ 1, E (i) [x, y, z] = tfE ({F (i) (u, v, w), F ∈ C}; x, y, z) + tuδE=Ed∗ v δE=Ea∗ Δ(E (i−1) [x, y, z]) where the fE are linear operators acting by linear combination with rational coefficients in the variables {u, v, w, x, y, z} of the series F (i) (u, v, w) and their specializations using combinations of the substitutions {u = uxy, v = vz, w = uxz, w = w¯ z , u = 1, v = 1, w = 1, x = 1, y = 1, z = 1}, and where the linear differential operator Δ acts by Δ(G[x, y, z]) =
z dx [xy¯ z , z, z] G[x, y, z]−G[xy¯ z dG z , z, 1] dy [x, y, z]−x¯ x dG z, z, z] dx [xy, 1, 1]−x¯ dx [xy¯ + + xy 2 z 1−z z−y (z − y)2 dG
dG
The operators {fE , E ∈ C} are explicitly given in [4]. Proof. The equation for a class E (i) is obtained directly from the tables in [4] upon summing over parent permutations the contribution of children that belong to E.2 These equations encode multivariate linear recurrences for the coefficients of the gfs that allow to compute first terms by iteration. Since the generating tree is controled by a finite number of parameters (k, j, , x, y, z, n) on a finite number of classes, the recursive method yields a polynomial time random generating algorithm.
3
Solving the system and the proof of Theorem 0.1
The equations for E (0) in Proposition 2.1 are refinements of the equations of [5]. They can be solved by repeated applications of the kernel method [2] and well chosen substitutions, to yield expression for the refined gf of square an explicit (0) [x, y, z] which specializes in P (0) (1, 1, 1) = E permutations P 0 [x, y, z] = E∈C 2(u−1)(u3 −u2 −3u+4) , in agreement with [5]. u(2−u)4 (i) E involves a first term which is the same as
F (0) (t) = R(0) (C(t)) with R(0) (u) =
in Observe that the equations for (0) (i−1) . Our the equation for E and a second term which depends only on the gfs F strategy consists in solving the equation E (i) [x, y, z] = tfE ({F (i) (u, v, w), F ∈ C}; x, y, z) + h(x, y, z) for a generic parameter function h(x, y, z). Although this operation involves heavy symbolic manipulations, it still requires only subtle substitutions and applications of the kernel method. We were able to perform it using Mapletm and this yields a new
296
F. Disanto et al. / Electronic Notes in Discrete Mathematics 38 (2011) 291–296
set of equations expressing directly the F (i) (x, y, z) in terms of the F (i−1) (x, y, z). These new equations involve derivatives and specializations but clearly preserve the algebraicity of the multivariate gfs and the rationality of the expression of the specialisation E (i) [1, 1, 1] in terms of the gf C(t), thus completing the proof of Theorem 0.1.
4
Extensions and conjecture
The generating tree above also allows to keep track of the numbers of records of each type (lrmin, lrmax, rlmin, rlmax) in the generated permutations. Introducing four further parameters in the gfs one can come up with a refined system of equations which can in principle be solved along the same lines to prove that the gfs remain algebraic at fixed i. However performing explicitly the computations with all 10 parameters involves formidable intermediary steps and we have not been able until now to obtain the minimal polynomial even for the case i = 0 of the gf of square permutations with respect to the size and four types of records. We have not been able either to find a general explicit formula for all i ≥ 0, or for the bivariate gf F (t, s) = i≥0 si F (i) (t), which is obviously non algebraic (F (t, 1) is the ordinary gf of permutations). We were instead able to formulate the following conjecture for all i ≥ 1: Conjecture 4.1 The number of permutations of size n with i internal points satis(i) fies |Sn | ∼n→∞ 2i+3i!(2i)! · n2i+1 · 4n .
Acknowledgements. We thank Herb Wilf for raising our interest in this problem via an interesting lecture in the meeting Enumerative and Probabilistic Methods in Combinatorics in june 2007 in Barcelona, and a referee for pointing out several inaccuracies in the first version of this abstract.
References [1] M. Albert, S. Linton, N. Ruskuc, S. Waton, On convex permutations, available on http://turnbull.mcs.st-and.ac.uk/~vince/publications/convex/ [2] C. Banderier, A. Denise, P. Flajolet, D. Gardy, D. Gouyou-Beauchamps, M. BousquetM´elou, Generating functions for generating trees, Discrete Math. 246 (2002) 29–55. [3] A. Bernini, F. Disanto, R. Pinzani, S. Rinaldi, Permutations defining convex permutominoes, Journal of Integer Sequences, 10 (2007) Article 07.9.7. [4] F. Disanto, E. Duchi, S. Rinaldi, G. Schaeffer, Permutations with few internal points, http://www.lix.polytechnique.fr/~schaeffe/PagesWeb/Permutations/. [5] E. Duchi, D. Poulalhon, On square permutations, Fifth Colloquium on Mathematics and Computer Science, DMTCS Proceedings (2008) 207-222. [6] T. Mansour, S. Severini, Grid polygons from permutations and their enumeration by the kernel method, 19th FPSAC Tianjin, (2007).