In an article about combinatorics, to determine the number of permutations, we essentially used an arrangement of notebooks that differs from the otherwise commonly used arrangement. In this arrangement, the rank of two notebooks is compared by sequentially checking how many lower-ranked elements are preceded by the second, third, fourth, etc., ranked elements. The notebook is of higher rank in which, proceeding in the above order, we first find an element that precedes more lower-ranked elements.

For example, comparing the groups 4231 and 3214: the 2 in both groups precedes one element, the 3 in the first group precedes one element, and in the second group, it precedes two elements, so in this special arrangement, the second group is of higher rank. (In the article, we saw that the situation is reversed in the usual arrangement.)

a) Write down all permutations of the elements 1, 2, 3, 4 in this special arrangement!

b) What is the rank of the permutation 5341726 of the elements 1, 2, 3, 4, 5, 6, 7:

I. in this special arrangement?

II. in the usual arrangement?
a) We start from the groups 12 and 21. We insert the 3 in the third, second, and first positions respectively, yielding the following six groups:
123
132
312
213
231
321

Now, we insert the 4 in the fourth, third, second, and first positions respectively in each group:

| 1234 | 1324 | 3124 | 2134 | 2314 | 3214 |
| :--- | :--- | :--- | :--- | :--- | :--- |
| 1243 | 1342 | 3142 | 2143 | 2341 | 3241 |
| 1423 | 1432 | 3412 | 2413 | 2431 | 3421 |
| 4123 | 4132 | 4312 | 4123 | 4231 | 4321 |

b) I. Let there be a permutation book of the elements $1, 2, \ldots, n$. Denote by $k_{1}$ the number of elements that the 2 precedes (so $k_{1}=0$ or 1, depending on whether 2 does not precede the lower-ranked element, 1, or does precede it), $k_{2}$ denotes the number of elements that the 3 precedes $\left(0 \leq k_{2} \leq 2\right) \ldots$ and so on. $k_{n-1}$ denotes the number of elements that the $n$ precedes $\left(0 \leq k_{n-1} \leq n-1\right)$.

If $k_{1}=1$, then all the books where $k_{1}=0$ precede our book. The number of the latter (and the former as well) is clearly half of all permutations, i.e., $n!/2$. $k_{2}$ can be $0, 1, 2$. The number of books in each case is the same, i.e., a third of $n!$, and so on.

Therefore, if we have determined the numbers $k_{1}, k_{2}, \ldots, k_{n-1}$ that characterize our book, then the rank number of the book is

$$
N=k_{1} \frac{n!}{2}+k_{2} \cdot \frac{n!}{3}+k_{3} \frac{n!}{4}+\ldots+k_{n-1} \frac{n!}{n!}+1
$$

In our case,

$$
n=7 \quad \text{and} \quad k_{1}=0, k_{2}=2, k_{3}=2, k_{4}=4, k_{5}=0, k_{6}=2
$$

and thus

$$
\begin{aligned}
N= & 0 \cdot \frac{7!}{2!}+2 \cdot \frac{7!}{3!}+2 \frac{7!}{4!}+4 \frac{7!}{5!}+0 \cdot \frac{7!}{6!}+2 \frac{7!}{7!}+1= \\
& =2 \cdot 840+2 \cdot 210+4 \cdot 42+2+1=2271
\end{aligned}
$$

![](https://cdn.mathpix.com/cropped/2024_05_02_fcc01c6a4745b30ee25fg-1.jpg?height=51&width=1797&top_left_y=1449&top_left_x=153)
If the element in the $(n-1)$-th position precedes, then (L. IV. volume 2, p. 38)

$$
N=k_{1}(n-1)!+k_{2}(n-2)!+\ldots+k_{n-1} \cdot 1!+1
$$

In our case,

$$
n=7, k_{1}=4, k_{2}=2, k_{3}=2, k_{4}=0, k_{5}=2, k_{6}=0
$$

and thus

$$
\begin{gathered}
N=4 \cdot 6!+2 \cdot 5!+2 \cdot 4!+0 \cdot 3!+2 \cdot 2!+0 \cdot 1!+1= \\
=2880+240+48+4+1=3173
\end{gathered}
$$

László Németh (Gyula, Erkel F. v. IV. p. t.)