OFFSET
1,5
COMMENTS
T(n,k) is the number of permutations of {1..n} with k inversions.
n-th row gives growth series for symmetric group S_n with respect to transpositions (1,2), (2,3), ..., (n-1,n).
T(n,k) is the number of permutations of (1,2,...,n) having disorder equal to k. The disorder of a permutation p of (1,2,...,n) is defined in the following manner. We scan p from left to right as often as necessary until all its elements are removed in increasing order, scoring one point for each occasion on which an element is passed over and not removed. The disorder of p is the number of points scored by the end of the scanning and removal process. For example, the disorder of (3,5,2,1,4) is 8, since on the first scan, 3,5,2 and 4 are passed over, on the second, 3,5 and 4 and on the third scan, 5 is once again not removed. - Emeric Deutsch, Jun 09 2004
T(n,k) is the number of permutations p=(p(1),...,p(n)) of {1..n} such that Sum_{i: p(i)>p(i+1)} = k (k is called the Major index of p). Example: T(3,0)=1, T(3,1)=2, T(3,2)=2, T(3,3)=1 because the major indices of the permutations (1,2,3), (2,1,3), (3,1,2), (1,3,2), (2,3,1) and (3,2,1) are 0,1,1,2,2 and 3, respectively. - Emeric Deutsch, Aug 17 2004
T(n,k) is the number of 2 X c matrices with column totals 1,2,3,...,n and row totals k and binomial(n+1,2) - k. - Mitch Harris, Jan 13 2006
T(n,k) is the number of permutations p of {1,2,...,n} for which den(p)=k. Here den is the Denert statistic, defined in the following way: let p=p(1)p(2)...p(n) be a permutation of {1,2,...,n}; if p(i)>i, then we say that i is an excedance of p; let i_1 < i_2 < ... < i_k be the excedances of p and let j_1 < j_2 < ... < j_{n-k} be the non-excedances of p; let Exc(p) = p(i_1)p(i_2)...p(i_k), Nexc(p)=p(j_1)p(j_2)...p(j_{n-k}); then, by definition den(p) = i_1 + i_2 + ... + i_k + inv(Exc(p)) + inv(Nexc(p)), where inv denotes "number of inversions". Example: T(4,5)=3 because we have 1342, 3241 and 4321. We show that den(4321)=5: the excedances are 1 and 2; Exc(4321)=43, Nexc(4321)=21; now den(4321) = 1 + 2 + inv(43) + inv(21) = 3+1+1 = 5. - Emeric Deutsch, Oct 29 2008
T(n,k) is the number of size k submultisets of the multiset {1,2,2,3,3,3,...,n-1} (which contains i copies of i for 0 < i < n).
The limit of products of the numbers of fixed necklaces of length n composed of beads of types N(n,b), n --> infinity, is the generating function for inversions (we must exclude one unimportant factor b^n/n!). The error is < (b^n/n!)*O(1/n^(1/2-epsilon)). See Gaichenkov link. - Mikhail Gaichenkov, Aug 27 2012
The number of ways to distribute k-1 indistinguishable balls into n-1 boxes of capacity 1,2,3,...,n-1. - Andrew Woods, Sep 26 2012
Partial sums of rows give triangle A161169. - András Salamon, Feb 16 2013
The number of permutations of n that require k pair swaps in the bubble sort to sort them into the natural 1,2,...,n order. - R. J. Mathar, May 04 2013
Also series coefficients of q-factorial [n]_q ! -- see Mathematica line. - Wouter Meeussen, Jul 12 2014
From Mikhail Gaichenkov, Aug 16 2016: (Start)
Following asymptotic expansions in the Central Limit Theorem developed by Valentin V. Petrov, the cumulative distribution function of these numbers, CDF_N(x), is equal to the CDF of the normal distribution - (0.06/sqrt(2*Pi))*exp(-x^2/2)(x^3-3x)*(6N^3+21N^2+31N+31)/(N(2N+5)^2(N-1)+O(1/N^2).
This can be written as: CDF of the normal distribution -(0.09/(N*sqrt(2*Pi)))*exp(-x^2/2)*He_3(x) + O(1/N^2), N > 1, natural numbers (Gaichenkov, private research).
According to B. H. Margolius, Permutations with inversions, J. Integ. Seqs. Vol. 4 (2001), #01.2.4, "the unimodal behavior of the inversion numbers suggests that the number of inversions in a random permutation may be asymptotically normal". See links.
Moreover, E. Ben-Naim (Theoretical Division and Center for Nonlinear Studies, Los Alamos National Laboratory), "On the Mixing of Diffusing Particles" (13 Oct 2010), states that the Mahonian Distribution becomes a function of a single variable for large numbers of element, i.e., the probability distribution function is normal. See links.
To be more precise the expansion of the distribution is presented for a finite number of elements (or particles in terms of E. Ben-Naim's article). The distribution tends to the normal distribution for an infinite numbers of elements.
(End)
T(n,k) statistic counts (labeled) permutation graphs with n vertices and k edges. - Mikhail Gaichenkov, Aug 20 2019
From Gus Wiseman, Aug 12 2020: (Start)
Number of divisors of A006939(n - 1) or A076954(n - 1) with k prime factors, counted with multiplicity, where A006939(n) = Product_{i = 1..n} prime(i)^(n - i + 1). For example, row n = 4 counts the following divisors:
1 2 4 8 24 72 360
3 6 12 36 120
5 9 18 40 180
10 20 60
15 30 90
45
Crossrefs:
A336420 is the case with distinct prime multiplicities.
A006939 lists superprimorials or Chernoff numbers.
A022915 counts permutations of prime indices of superprimorials.
A317829 counts factorizations of superprimorials.
A336941 counts divisor chains under superprimorials.
(End)
Named after the British mathematician Percy Alexander MacMahon (1854-1929). - Amiram Eldar, Jun 13 2021
Row maxima ~ n!/(sigma * sqrt(2*Pi)), sigma^2 = (2*n^3 + 9*n^2 + 7*n)/72 = variance of group type A_n (see also A161435). - Mikhail Gaichenkov, Feb 08 2023
REFERENCES
Miklós Bóna, Combinatorics of permutations, Chapman & Hall/CRC, Boca Raton, Florida, 2004 (p. 52).
Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 240.
Florence Nightingale David, Maurice George Kendall, and David Elliot Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 241.
Pierre de la Harpe, Topics in Geometric Group Theory, Univ. Chicago Press, 2000, p. 163, top display.
Eugen Netto, Lehrbuch der Combinatorik. 2nd ed., Teubner, Leipzig, 1927, p. 96.
Valentin V. Petrov, Sums of Independent Random Variables, Springer Berlin Heidelberg, 1975, p. 134.
Richard P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 1, 1999; see Corollary 1.3.10, p. 21.
LINKS
Alois P. Heinz, Rows n = 1..50, flattened (first 30 rows from Paul D. Hanna)
Ashleigh Adams, Jennifer Elder, Nadia Lafrenière, Erin McNicholas, Jessica Striker, and Amanda Welch, Cyclic sieving on permutations - an analysis of maps and statistics in the FindStat database, arXiv:2402.16251 [math.CO], 2024. See p. 7.
Dorin Andrica and Ovidiu Bagdasar, On some results concerning the polygonal polynomials, Carpathian Journal of Mathematics, Vol. 35, No. 1 (2019), pp. 1-11.
Hasan Arslan, A combinatorial interpretation of Mahonian numbers of type B, arXiv:2404.05099 [math.CO], 2024. See p. 3.
E. Ben-Naim, On the Mixing of Diffusing Particles, arXiv:1010.2563 [cond-mat.stat-mech], 2010.
David J. Benson, The cohomology of the nilCoxeter algebra, arXiv:2407.21175 [math.RA], 2024. See p. 4.
Sara C. Billey, Matjaž Konvalinka, and Joshua P. Swanson, Tableaux posets and the fake degrees of coinvariant algebras, arXiv:1809.07386 [math.CO], 2018.
Niclas Boehmer, Robert Bredereck, Piotr Faliszewski, and Rolf Niedermeier, On the Robustness of Winners: Counting Briberies in Elections, arXiv:2010.09678 [cs.GT], 2020.
Niclas Boehmer, Robert Bredereck, Piotr Faliszewski, Rolf Niedermeier, and Stanisław Szufa, Putting a Compass on the Map of Elections, arXiv:2105.07815 [cs.GT], 2021.
J. Bourget, Des permutations, Nouvelles annales de mathématiques, 2e série, tome 10 (1871), pp. 254-268.
Franc Brglez, Of n-dimensional Dice, Combinatorial Optimization, and Reproducible Research: An Introduction, Elektrotehniski Vestnik, Vol. 78, No. 4 (2011), pp. 181-192.
Agnieszka Bukietyńska, The test of inversion in the analysis of investment funds, Central and Eastern European Journal of Management and Economics, Vol. 5, No. 3 (September 2017), pp. 277-289.
L. Carlitz, q-Bernoulli numbers and polynomials, Duke Math. J., Vol. 15, No. 4 (1948), pp. 987-1000.
Luke Chamandy, Anvar Shukurov, and A. Russ Taylor, Statistical tests of galactic dynamo theory, arXiv:1609.05688 [astro-ph.GA], 2016.
Geoffrey Critzer, Combinatorics of Vector Spaces over Finite Fields, Master's thesis, Emporia State University, 2018.
Mariusz Czekała and Agnieszka Bukietyńska, Distribution of Inversions and the Power of the τ-Kendall's Test, in J. Świątek, Z. Wilimowska, L. Borzemski, A. Grzech (eds.), Information Systems Architecture and Technology: Proceedings of 37th International Conference on Information Systems Architecture and Technology - ISAT 2016 - Part III, pp. 175-185.
Mariusz Czekała, Agnieszka Bukietyńska, and Agnieszka Matylda Schlichtinger, Estimation of the Probability of Inversion in the Test of Variable Dependencies, Information Systems Architecture and Technology: Proceedings of 39th International Conference on Information Systems Architecture and Technology (ISAT 2018), Part III, 145-156.
F. N. David, M. G. Kendall, and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, pp. 241-242. (Annotated scanned copy)
Emeric Deutsch, Problem 10975: Enumeration of Permutations by Disorder, Amer. Math. Monthly, Vol. 111, No. 6 (2004), p. 541.
FindStat - Combinatorial Statistic Finder, The Denert index of a permutation, The major index of a permutation, The number of inversions of a permutation, The sorting index of a permutation.
Dominique Foata, Distributions eulériennes et mahoniennes sur le groupe des permutations, in: M. Aigner, editor, Higher Combinatorics, Reidel, Dordrecht, Holland, 1977, pp. 27-49.
Dominique Foata and Doron Zeilberger, Denert's permutation statistic is indeed Euler-Mahonian, Studies in Appl. Math., Vol. 83 (1990), pp. 31-59. [From Emeric Deutsch, Oct 29 2008]
Víctor Franco-Sánchez, Arnau Martí-Llobet, and Ramon Ferrer-i-Cancho, Swap distance minimization beyond entropy minimization in word order variation, arXiv:2404.14192 [cs.CL], 2024. See p. 34.
Mikhail Gaichenkov, Necklaces and the generating function for inversions, MathOverflow, 2012.
Mikhail Gaichenkov, Pros and cons of probability model for permutations, MathOverflow, 2014.
Amy Grady, Sorting index and Mahonian-Stirling pairs for labeled forests, Clemson University, July 10, 2014.
Oğuz Gürerk, Ümit Işlak, and Mehmet Akif Yıldız, A study on random permutation graphs, arXiv:1901.06678 [math.CO], 2019.
Richard K. Guy, Letter to N. J. A. Sloane with attachment, Mar 1988.
Guo-Niu Han, Une nouvelle bijection pour la statistique de Denert, C. R. Acad. Sci. Paris, Ser. I, Vol. 310 (1990), pp. 493-496.
Stuart A. Hannah, Sieved Enumeration of Interval Orders and Other Fishburn Structures, arXiv:1502.05340 [math.CO], (18-February-2015).
Yang-Hui He, Cyril Matti and Chuang Sun, The Scattering Variety, arXiv preprint arXiv:1403.6833 [hep-th], 2014.
Ekhine Irurozki, Sampling and learning distance-based probability models for permutation spaces, PhD Dissertation, Department of Computer Science and Artificial Intelligence of the University of the Basque Country, 2015.
Ekhine Irurozki, Borja Calvo and José A. Lozano, An R package for permutations, Mallows and Generalized Mallows models, 2014.
Ekhine Irurozki, Borja Calvo and José A. Lozano, PerMallows: An R Package for Mallows and Generalized Mallows Models, Journal of Statistical Software, Vol. 71, No. 12 (August 2016).
Milan Janjic, A Generating Function for Numbers of Insets, Journal of Integer Sequences, Vol. 17 (2014), Article 14.9.7.
Thomas Kahle and Christian Stump, Counting inversions and descents of random elements in finite Coxeter groups, arXiv:1802.01389 [math.CO], 2018-2019.
James A. Koziol, Sums of ranking differences and inversion numbers for method discrimination, Journal of Chemometrics, Vol. 27 (2013), pp. 165-169.
Barbara H. Margolius, Permutations with inversions, J. Integ. Seq., Vol. 4 (2001), Article 01.2.4.
Jeremy L. Martin and Jennifer D. Wagner, On the Spectra of Simplicial Rook Graphs, arXiv preprint arXiv:1209.3493 [math.CO], 2012. - From N. J. A. Sloane, Dec 27 2012
Anthony Mendes, A note on alternating permutations, Amer. Math. Monthly, Vol. 114, No. 5 (2007), pp. 437-440.
Vinicus de Morais Alves, Rafael Dowsley, Rafael Timateo de Sousa, and Anderson C.A. Nascimento, Information-Theoretically Secure String Commitments Based on Packet Reordering Channels, IEEE Access, Volume 9 (2021), pp. 139931-139936.
Roger H. Moritz and Robert C. Williams, A coin-tossing problem and some related combinatorics, Math. Mag., Vol. 61, No. 1 (1988), pp. 24-29.
Eugen Netto, Lehrbuch der Combinatorik, Chapter 4, annotated scanned copy of pages 92-99 only.
Eugen Netto, Lehrbuch der Combinatorik, Chapter 4, annotated scanned copy of pages 92-99 only.
Juan Miguel Nieto, Tailoring and Hexagon Form Factors, Spinning Strings and Correlation Functions in the AdS/CFT Correspondence, Springer Theses (Recognizing Outstanding Ph.D. Research), Springer, Cham, 2018.
Michal Opler, Major index distribution over permutation classes, arXiv:1505.07135 [math.CO], 2015.
Michael Penn, The Quantum Factorial is upon us., YouTube video, 2023.
Nikolay L. Poliakov, Note on level r consensus, arXiv preprint arXiv:1606.04816 [q-fin.EC], 2016.
Svetlana Poznanovic, The sorting index and equidistribution of set-valued statistics over restricted permutations, Journal of Combinatorial Theory, Series A, Vol. 125 (2014), pp. 254-272.
Richard P. Stanley, Binomial posets, Moebius inversion and permutation enumeration, J. Combinat. Theory, Series A, Vol. 20, No. 3 (1976), pp. 336-356.
A. Waksman, On the complexity of inversions, IEEE Trans. Computers, Vol. 19 (1970), pp. 1225-1226. See Table II.
Eric Weisstein's World of Mathematics, Necklace.
Eric Weisstein's World of Mathematics, Irreducible Polynomial.
Thomas Wieder, Comments on A008302.
Wikipedia, Major index
FORMULA
Bourget, Comtet and Moritz-Williams give recurrences.
Mendes and Stanley give g.f.'s.
G.f.: Product_{j=1..n} (1-x^j)/(1-x) = Sum_{k=0..M} T{n, k} x^k, where M = n*(n-1)/2.
From Andrew Woods, Sep 26 2012, corrected by Peter Kagey, Mar 18 2021: (Start)
T(1, 0) = 1,
T(n, k) = 0 for n < 0, k < 0 or k > n*(n-1)/2.
T(n, k) = Sum_{j=0..n-1} T(n-1, k-j),
T(n, k) = T(n, k-1) + T(n-1, k) - T(n-1, k-n). (End)
E.g.f. satisfies: A(x,q) = 1 + Integral (A(x,q) - q*A(q*x,q))/(1-q) dx, where A(x,q) = Sum_{n>=0} x^n/n! * Sum_{k=0..n*(n-1)/2} T(n,k)*q^k, when T(0,0) = 1 is included. - Paul D. Hanna, Dec 31 2016
EXAMPLE
1; 1+x; (1+x)*(1+x+x^2) = 1+2*x+2*x^2+x^3; etc.
Triangle begins:
n\k| 0 1 2 3 4 5 6 7 8 9 10
---+--------------------------------------------------------------
1 | 1;
2 | 1, 1;
3 | 1, 2, 2, 1;
4 | 1, 3, 5, 6, 5, 3, 1;
5 | 1, 4, 9, 15, 20, 22, 20, 15, 9, 4, 1;
6 | 1, 5, 14, 29, 49, 71, 90, 101, 101, 90, 71, ...
7 | 1, 6, 20, 49, 98, 169, 259, 359, 455, 531, 573, ...
8 | 1, 7, 27, 76, 174, 343, 602, 961, 1415, 1940, 2493, ...
9 | 1, 8, 35, 111, 285, 628, 1230, 2191, 3606, 5545, 8031, ...
10 | 1, 9, 44, 155, 440, 1068, 2298, 4489, 8095, 13640, 21670, ...
From Gus Wiseman, Aug 12 2020: (Start)
Row n = 4 counts the following submultisets of {1,1,1,2,2,3}:
{} {1} {11} {111} {1112} {11122} {111223}
{2} {12} {112} {1122} {11123}
{3} {22} {122} {1113} {11223}
{13} {113} {1123}
{23} {123} {1223}
{223}
(End)
MAPLE
g := proc(n, k) option remember; if k=0 then return(1) else if (n=1 and k=1) then return(0) else if (k<0 or k>binomial(n, 2)) then return(0) else g(n-1, k)+g(n, k-1)-g(n-1, k-n) end if end if end if end proc; # Barbara Haas Margolius (margolius(AT)math.csuohio.edu), May 31 2001
BB:=j->1+sum(t^i, i=1..j): for n from 1 to 8 do Z[n]:=sort(expand(simplify(product(BB(j), j=0..n-2)))) od: for n from 1 to 8 do seq(coeff(Z[n], t, j), j=0..(n-1)*(n-2)/2) od; # Zerinvary Lajos, Apr 13 2007
# alternative Maple program:
b:= proc(u, o) option remember; expand(`if`(u+o=0, 1,
add(b(u+j-1, o-j)*x^(u+j-1), j=1..o)+
add(b(u-j, o+j-1)*x^(u-j), j=1..u)))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
seq(T(n), n=1..10); # Alois P. Heinz, May 02 2017
MATHEMATICA
f[n_] := CoefficientList[ Expand@ Product[ Sum[x^i, {i, 0, j}], {j, n}], x]; Flatten[Array[f, 8, 0]]
(* Second program: *)
T[0, 0] := 1; T[-1, k_] := 0;
T[n_, k_] := T[n, k] = If[0 <= k <= n*(n - 1)/2, T[n, k - 1] + T[n - 1, k] - T[n - 1, k - n], 0]; (* Peter Kagey, Mar 18 2021; corrected the program by Mats Granvik and Roger L. Bagula, Jun 19 2011 *)
alternatively (versions 7 and up):
Table[CoefficientList[Series[QFactorial[n, q], {q, 0, n(n-1)/2}], q], {n, 9}] (* Wouter Meeussen, Jul 12 2014 *)
PROG
(Sage)
from sage.combinat.q_analogues import q_factorial
for n in (1..6): print(q_factorial(n).list()) # Peter Luschny, Jul 18 2016
(PARI) {T(n, k) = my(A=1+x); for(i=1, n, A = 1 + intformal(A - q*subst(A, x, q*x +x^2*O(x^n)))/(1-q)); polcoeff(n!*polcoeff(A, n, x), k, q)}
for(n=1, 10, for(k=0, n*(n-1)/2, print1(T(n, k), ", ")); print("")) \\ Paul D. Hanna, Dec 31 2016
(PARI) for(n=1, 10, print(Vec(prod(k=1, n, (1-q^k)/(1-q))))); \\ Joerg Arndt, Apr 13 2019
CROSSREFS
Diagonals: A000707 (k=n-1), A001892 (k=n-2), A001893 (k=n-3), A001894 (k=n-4), A005283 (k=n-5), A005284 (k=n-6), A005285 (k=n-7).
Rows: A161435 (n=4), A161436 (n=5), A161437 (n=6), A161438 (n=7), A161439 (n=8), A161456 (n=9), A161457 (n=10).
A001809 gives total Denert index of all permutations.
A357611 gives a refinement.
KEYWORD
AUTHOR
EXTENSIONS
There were some mistaken edits to this entry (inclusion of an initial 1, etc.) which I undid. - N. J. A. Sloane, Nov 30 2009
Added mention of "major index" to definition. - N. J. A. Sloane, Feb 10 2019
STATUS
approved