In a permutation $(x_1, x_2, \dots , x_n)$ of the set $1, 2, \dots , n$ we call a pair $(x_i, x_j )$ discordant if $i < j$ and $x_i > x_j$. Let $d(n, k)$ be the number of such permutations with exactly $k$ discordant pairs. Find $d(n, 2)$ and $d(n, 3).$
Problem
Source:
Tags: permutation, counting, IMO Shortlist, combinatorics, algebra, IMO Shortlist 1984
11.09.2010 21:17
Notice it is not important that the numbers are from the set $1,2,...,n$, it would be the same if they were any real numbers $a_1 < a_2 < ... < a_n$. With this in mind, let us define $a_n =$ number of permutations of a set of $n$ elements with exacly $1$ discordant pair $= d(n,1)$, $b_n = d(n,2)$, $c_n = d(n,3)$. It is trivial to verify that: $a_1 = b_1 = c_1 = 0$, $a_2 = 1, b_2 = c_2 = 0$, $a_3 = b_3 = 2, c_3 = 1$. Now we proceed inductively. Take $n \geq 3$ and suppose there is a permutation $(x_1,x_2,...,x_{n+1})$ of the set $\{1,2,...,n+1\}$ with exactly $1$ discordant pair. Hence $x_1 = 1$ or $x_1 = 2$ (otherwise there would be at least $2$ discordant pairs involving $x_1$). There are exactly $a_n$ of these permutations with $x_1 = 1$, and only one permutation with $x_1 = 2$ (that is, $2,1,3,...,n$). So we get the recurrence formula $a_{n+1} = a_n + 1$, which by using the values we already know gives $\boxed{a_n = n-1}$. Now suppose there is a permutation of $1,2,...,n+1$ with exactly $2$ discordant pairs. By reasoning in a similar fashion we get that $x_1 = 1,2,3$, and that $b_{n+1} = b_n + a_n + 1 = b_n + n$. Thus, $b_n = b_2 + 2 + 3 + ... + n-1$, $\boxed{b_n = \frac{n(n-1)}{2} - 1}$ (for $n \geq 3$). Finally, if there is a permutation of $1,2,...,n+1$ with exactly $3$ discordant pairs, then $x_1 = 1,2,3,4$, and $c_{n+1} = c_n + b_n + a_n + 1 = c_n + \frac{n(n-1)}{2} + n - 1 = c_n + \frac{n^2 + n - 2}{2}$. Thus, $c_n = c_3 + \frac{\sum_{k=3}^{n-1} k^2 + \sum_{k=3}^{n-1} k - 2 \sum_{k=3}^{n-1} 1}{2} =$ $=\frac{\frac{(n-1)(n)(2n-1)}{6} - 5 + \frac{n(n-1)}{2} - 3 - 2n + 6}{2}$, $\boxed{c_n = \frac{n^3 - 7n - 6}{6}}$ (for $n \geq 4$). Please reply if I did not make myself clear enough.