HMMT 二月 2026 · 团队赛 · 第 8 题
HMMT February 2026 — Team Round — Problem 8
题目详情
英文原题
- [50] Let n ≥ 2 be a positive integer and let ( a , . . . , a ) be a permutation of the numbers 1 , 2 , . . . , n .
1 n
Marin makes a single move on this permutation by performing the following steps:
• First, he chooses an integer 1 ≤ k ≤ ⌊ n/ 2 ⌋ . This integer can be different for different moves.
• Then, he picks two nonintersecting sets I = { i , i , . . . , i } and J = { j , j , . . . , j } such that
1 2 k 1 2 k
1 ≤ i < i < · · · < i ≤ n and 1 ≤ j < j < · · · < j ≤ n .
1 2 k 1 2 k
• Finally, he swaps the numbers a and a in the current permutation for all integers 1 ≤ s ≤ k .
i js s
Let f ( n ) denote the smallest positive integer such that it is possible for Marin to reach (1 , 2 , . . . , n )
from any starting permutation in at most f ( n ) moves. Prove that ⌈ log n ⌉ ≤ f ( n ) ≤ ⌈ log n ⌉ .
3 2
解析
英文解析
- [50] Let n ≥ 2 be a positive integer and let ( a , . . . , a ) be a permutation of the numbers 1 , 2 , . . . , n .
1 n
Marin makes a single move on this permutation by performing the following steps:
• First, he chooses an integer 1 ≤ k ≤ ⌊ n/ 2 ⌋ . This integer can be different for different moves.
• Then, he picks two nonintersecting sets I = { i , i , . . . , i } and J = { j , j , . . . , j } such that
1 2 k 1 2 k
1 ≤ i < i < · · · < i ≤ n and 1 ≤ j < j < · · · < j ≤ n .
1 2 k 1 2 k
• Finally, he swaps the numbers a and a in the current permutation for all integers 1 ≤ s ≤ k .
i js s
Let f ( n ) denote the smallest positive integer such that it is possible for Marin to reach (1 , 2 , . . . , n )
from any starting permutation in at most f ( n ) moves. Prove that ⌈ log n ⌉ ≤ f ( n ) ≤ ⌈ log n ⌉ .
3 2
Proposed by: Marin Hristov Hristov
Answer: N/A
Solution 1: Upper bound. We’ll prove that f ( n ) ≤ ⌈ log n ⌉ for all positive integers n ≥ 2 by stronginduction on n . The base cases f (2) = 1 and f (3) = 2 are trivial and can be checked directly. For the 2
©2026 HMMTinduction step, fix n > 3 , and let d = ⌊ n/ 2 ⌋ . For a permutation ( a , . . . , a ) of the numbers 1 , . . . , n ,
1 nwe define
I = { i | a > d, 1 ≤ i ≤ d } and J = { j | a ≤ d, d < j ≤ n } .
i j
Notice that |I| = |J | since if we define L = { ℓ | a ≤ d, 1 ≤ ℓ ≤ d } , then from the definition of I , Jℓand L it follows that these are pairwise nonintersecting sets. As a result, we get:
|I ∪ L| = |{ i | 1 ≤ i ≤ d }| = d = |{ i | a ≤ d }| = |J ∪ L| .
Therefore, |I| = d − |L| = |J | , and this will be our choice of k for the first move (if |I| = |J | = 0 , weisimply don’t make a move at this stage). Since I ∩ J = ∅ from above, this value of k is allowed.
′ ′ ′ ′ ′ ′
For the newly formed permutation ( a , a , . . . , a ) we have that ( a , a , . . . , a ) is a permutation of
1 2 n 1 2
′ ′d
{ 1 , 2 , . . . , d } and ( a , . . . , a ) is a permutation of { d + 1 , . . . , n } .
d +1 n
What remains is to notice that after this point, if we want to make a move ( k , I , J ) on a permutation
1 1 1
of the numbers 1 , . . . , d , and a move ( k , I , J ) on the numbers d + 1 , . . . , n (by interpreting
2 2 2
these numbers the same as 1 , . . . , n − d ), then we would be able to combine them into a singlemove ( k + k , I ∪ I , J ∪ J ) over the n -element permutation since the structural separation of the
1 2 1 2 1 2
two permutations from above. Therefore, we can use the induction hypothesis for d = ⌊ n/ 2 ⌋ andn − d = ⌈ n/ 2 ⌉ . In this way, we can always reach (1 , 2 , . . . , n ) using at most
1 + max { f ( d ) , f ( n − d ) } ≤ 1 + max {⌈ log ⌊ n/ 2 ⌋⌉ , ⌈ log ⌈ n/ 2 ⌉⌉} = ⌈ log n ⌉
2 2 2
moves. Thus, we have proven that f ( n ) ≤ ⌈ log n ⌉ for all integers n ≥ 2 , as desired.
Here is also an example of the above procedure for n = 8 . In every permutation, the elements of I are 2
bolded, and the elements of the corresponding J are underlined.
( 8 , 4 , 5 , 6 , 2 , 1 , 3 , 7) → (2 , 4 , 1 , 3 , 8 , 5 , 6 , 7) → ( 2 , 1 , 4 , 3 , 6 , 5 , 8 , 7) → (1 , 2 , 3 , 4 , 5 , 6 , 7 , 8) .
Lower bound. We will now prove that f ( n ) ≥ ⌈ log n ⌉ for all positive integers n > 1 .
Let us call a set of indices I troublesome , if a > a for all indices i < i ∈ I . Consider the starting 3
i i 1 2
1 2
permutation ( n, n − 1 , n − 2 , . . . , 2 , 1) and note that the set of all indices is troublesome. The keyobservation we will use is that if a permutation has a troublesome set T , then after any move, the
′
resulting permutation has a troublesome set of size | T | ≥ | T | / 3 .
Indeed, we can notice that T ∩ I , T ∩ J and T \ ( I ∪ J ) are nonintersecting troublesome subsets of
T . Therefore, at least one of them contains at least | T | elements. Therefore, the size of the largest 1
troublesome subset decreases by a factor of at most 3 after each move. Since (1 , 2 , . . . , n ) does not 3
contain a troublesome set with more than one element, we can conclude that f ( n ) ≥ ⌈ log n ⌉ for allintegers n > 1 , as desired.3
Solution 2: We first show the upper bound of ⌈ log n ⌉ . To sort the permutation, consider a recursiveroutine f ( L, R ) that sorts a , . . . , a . Let M = ⌊ ( L + R ) / 2 ⌋ be the midpoint of this subarray. Notice 2
L Rthat if k elements in a , . . . , a should have been in a , . . . , a after sorting, there are also k
L M M +1 Relements in a , . . . , a that should be in the first half after sorting.
M +1 R
So, we can just let f ( L, R ) swap the violating elements in the first half with the violating elements inthe last half, and recurse down on f ( L, M ) and f ( M + 1 , R ) . Notice that all the swaps on the samelevel can be done in one choice of I, J . This will complete in ⌈ log n ⌉ moves.
To show the lower bound of ⌈ log n ⌉ , denote L ( x ) for sequence of integers x to be the length of the 2
longest increasing subsequence (LIS) of x .3
Claim 1. If a, b, c are three sequences of not necessarily the same length, consider the set of allsequences S formed by interleaving them (keeping order within a, b, c the same.) Then, the max of
L ( x ) over x ∈ S is at most three times its minimum.
©2026 HMMT
Proof. This follows from noting that
L ( a ) + L ( b ) + L ( c ) max ( x )
x ∈ Smin ( x ) ≥ max( L ( a ) , L ( b ) , L ( c )) ≥ ≥ .
x ∈ S
3 3