Number of $n$-permutations with $r$ inversions modulo $k$

combinatoricsgenerating-functionspermutations

So I am reading "Introduction to Enumerative and Analytic Combinatorics" and there is the following problem:

27 on page 220:
Let $k \leq n-1$.
How many $n$-permutations are there for which the number of inversions is $r$ mod $k$.

The solution given in the book is as follows:
$n!/k$. To see this, one only has to consider the term $(1+x+…x^{k-1})$ of $I_n(x)$.

I'm confused as to why the solution in the textbook has us restricting our attention to just the $(1+x+…+x^{k-1})$ term.

Best Answer

We can consider polynomials with exponent "mod $k$". Then, your polynomial is

$$ I_n(x)=(1+x+\cdots+x^{k-1})P(x) $$

For all terms $c_sx^s$ of $P(x)$, the product $(1+x+\cdots+x^{k-1})(c_sx^s)$ is just $c_s(1+x+\cdots+x^{k-1})$, since remember the exponents are taken mod $k$. Therefore $I_n(x)$ is $S(1+x+\cdots+x^{k-1})$, where $S$ is the sum of the coefficients of $P$. Since all $k$ coefficients are equal, and they sum to $n!$ (as there are $n!$ permutations), each coefficient of $I_n(x)$ with exponents mod $k$ must be $n!/k$.

Related Question