In every row of a grid $100 \times n$ is written a permutation of the numbers $1,2 \ldots, 100$. In one move you can choose a row and swap two non-adjacent numbers with difference $1$. Find the largest possible $n$, such that at any moment, no matter the operations made, no two rows may have the same permutations.
Problem
Source: All-Russian MO 2023 Final stage 11.3
Tags: combinatorics
23.04.2023 16:58
The answer is 2^99. So the ideas is rather than moving the numbers, we fix them, and move their places in the row.
23.04.2023 19:19
For $a, b \in \mathbb R$, we define $s(a,b)=-1$ if $a<b$ and $s(a,b)=1$ if $a>b$. The key observation is that: two permutations $(a_1,\cdots,a_n)$ and $(b_1,\cdots,b_n)$ can be made equal if and only if $s(a_i,a_{i+1})=s(b_i,b_{i+1})$ for all $i=1,2,\cdots,n-1$. The proof is not hard.
23.04.2023 19:37
Either I'm missing something, or is it trivial that since we are performing the switching operation on each interval between rows, there must be a maximum of $2^{100-1}=2^{99}$ permutations?
24.04.2023 10:11
Here's an sketch: Consider $99$ pairs $i,i+1$ for $99 \geq i \geq 1$.Now consider the initial form of any permutation.Some of the $99$ pairs can be switched and some of them cannot which makes it $2^{99}$ possibilities. But clearly permutations with the same set of switchable pairs can be transformed to each other so we can't have more than $2^{99}$ permutations. And the construction can be easily made inductively.
31.05.2023 14:11
Sorry but I may be confused, why is it that "permutations with the same set of switchable pairs can be transformed to each other"? For example, 125634 and 213465 both have switchable pairs (2,3) and (4,5), but 1is fixed on its position, which means these two cannot be transformed to each other.
18.06.2023 15:53
Here is a sketch of my solution. The answer is $2^{n-1}$ Notice that if one can make several operations that turns one permutation $\sigma$ into $\pi$, one can also turn $\pi$ into $\sigma$, therefore this so called operation actually defines an equivalence relation $\sim$ on the symmetric group $S_n$. Define a mapping $\Psi:S_n\to \{+1,-1\}^n$, for any permutation $\sigma \in S_n$, $ \Psi (\sigma )=(\textbf{sgn}(\sigma (1)-\sigma(2)),\dots ,\textbf{sgn}(\sigma(n-1)-\sigma (n))$. The key observation is that the operation does not change the output of $\Psi$, i.e. if $\sigma \sim \pi$, then $\Psi(\sigma)=\Psi(\pi)$, thus there are at least $2^{n-1}$ equivalence classes. It is a bit trickier to prove that if two permutations have the same output in $\Psi$, they must be equivalent. Here is a hint (it makes the solution more intuitive), consider the reverse permutations and the operation one can make on them. Now the rule becomes to swap two adjacent numbers with difference larger than 1. Try to swap 1 to as in the front as possible, then you would notice that a nice induction kills the problem.
04.10.2023 20:08
very nice problem solved with Mr Kanav
04.10.2023 21:34
The answer is $2^{99}$. We are clearly being asked to find the number of equivalence classes under the (reversible) operation of repeated swapping. To prove that there are at least $2^{99}$ equivalence classes, note that any swap on $a_1,\ldots,a_{100}$ preserves the values of $\mathrm{sgn}(a_i-a_{i+1})$ for all $1 \leq i \leq 99$. There are $2^{99}$ possibilities for these values, hence at least this many classes. To prove that there are at most $2^{99}$ classes, take an arbitrary permutation and successively perform swaps that decrease its lexicographic order. This eventually terminates, and when this occurs, we must have $a_i+1 \in \{a_{i-1},a_{i+1},a_{i+2},\ldots,a_{100}\}$ for all $i$ with $a_i \neq 100$. In particular, starting from the end, the sequence should have the form $k_1,k_1+1,\ldots,100$ for some $k_1$. The next term is $k_2<k_1$, and then the terms $k_2,k_2+1,\ldots,k_1-1$ are uniquely determined, and so on. In general we should get (viewing from left to right) an ascending sequence of "down-slopes". It is clear that the choice of ending points on these "down-slopes" uniquely determines them, and there are $2^{99}$ such choices (since the last term must be an endpoint), so we're done. $\blacksquare$ For explicitness: if we replace $100$ by $6$, then the permutation formed by choosing endpoints of "down-slopes" at $2,3,6$ is $2,1,3,6,5,4$ (formed by constructing in reverse, starting from the end).