Let σ be a permutation of the set { 1 , 2 , … , 9 9 9 } . What is the maximum value over all permutations, of 1 ≤ i ≤ 9 9 9 min ∣ σ ( i + 1 ) − σ ( i ) ∣ ?
Details and assumptions
σ ( i ) denotes the number in the i t h position and we interpret σ ( 1 0 0 0 ) = σ ( 1 ) .
If σ is the identity permutation, then ∣ σ ( i + 1 ) − σ ( i ) ∣ = ∣ ( i + 1 ) − i ∣ = 1 , hence 1 ≤ i ≤ 9 9 9 min ∣ σ ( i + 1 ) − σ ( i ) ∣ = 1 .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
To show that 4 9 9 is attainable, we can let σ ( 2 i − 1 ) = 5 0 1 − i . for i = 1 , 2 , … , 5 0 0 and σ ( 2 i ) = 1 0 0 0 − i for i = 1 , 2 , … , 4 9 9 . So ∣ σ ( 2 i + 1 ) − σ ( 2 i ) ∣ = 1 0 0 0 − i − 5 0 0 + i = 5 0 0 and ∣ σ ( 2 i ) − σ ( 2 i − 1 ) ∣ = 1 0 0 0 − i − 5 0 1 + i = 4 9 9 .
To show 4 9 9 is upper bound, let σ ( k ) = 5 0 0 and choose one of the numbers σ ( k − 1 ) and σ ( k + 1 ) , since for k ∈ [ 1 , 9 9 9 ] one of k − 1 , k + 1 also lie in the same interval. Let a ∈ [ 1 , 9 9 9 ] with ∣ k − a ∣ = 1 , if ∣ 5 0 0 − σ ( a ) ∣ > 4 9 9 , σ ( a ) < 1 or σ ( a ) > 9 9 9 , contradiction. So min ∣ σ ( i + 1 ) − σ ( i ) ∣ ≤ 4 9 9 . With the example above we know that the answer is 4 9 9 .
499 is possible, demonstrated by: 1,501,2,502,...,500,1000. To prove 500 or any number greater than 500 aren't possible, just look at the number 500. As its both neighbours differ by at least 500 from 500, we infer that its neighbours are less than 1 or at least 1000 - not possible.
For those who do not understand the question, this is the explanation:
Think of all the distinct circular arrangements of the integers from 1 to 999. If you want to know how many arrangements there are, it is exactly (999-1)! or 998! each consisting of 999 integers. You don't want to stick with trial and error, which requires listing. Now, as said in the problem, \sigma (1000) = \sigma (1) so to avoid being confused, it is safe to assume that the arrangement is circular. Now, for each of the 998! arrangements, you have to think of the maximum value of \displaystyle \min_{1 \leq i \leq 999} |\sigma(i+1)-\sigma(i)|. It basically means you have to think the maximum value of the absolute value of the difference between any two consecutive integers in all the 998! arrangements. Then, assuming that you have the maximum value in each of the 998! arrangements, the answer is the least one.
Now that you understood the problem, you can answer it by critical thinking. Keep in mind that the arrangement is circular, so the identity permutation has a maximum value of \displaystyle \min {1 \leq i \leq 999} |\sigma(i+1)-\sigma(i)| of 998, because 1 and 999 are next to each other, hence the circular arrangement. What you have to think is to make the value of \displaystyle \min {1 \leq i \leq 999} |\sigma(i+1)-\sigma(i)| almost equal in just one arrangement, so that there will be no high value such as 998 in the identity permutation. That is the only time that you will obtain the least maximum value over all permutations. If you truly understood the conditions I stated, you will eventually come up with the circular arrangement of { 500, 999, 499, 998, 498, 997, 497, 996, ... , 3, 502, 2, 501, 1 } and the absolute value of the differences between any two consecutive integers will be 499 and 500.
Therefore, the maximum value over all permutations of \displaystyle \min_{1 \leq i \leq 999} |\sigma(i+1)-\sigma(i)| = 499.
Consider k such that σ ( k ) = 5 0 0 . Then, ∣ σ ( k + 1 ) − σ ( k ) ∣ ≤ 4 9 9 , so the minimum is at most 499. We show that it is possible to have a permutation where the minimum is 499. If any of the numbers from 2 to 500 are beside each other, then ∣ σ ( k + 1 ) − σ ( k ) ∣ < 4 9 9 . So we place them one apart from each other like this: σ ( 2 ) = 2 , σ ( 4 ) = 3 , σ ( 6 ) = 4 … σ ( 9 9 8 ) = 5 0 0 . We notice that i + 4 9 9 gives the numbers from 501 to 999 for 2 ≤ i ≤ 5 0 0 . Thus, we place i + 4 9 9 on the left of where i is placed: 5 0 1 , 2 , 5 0 2 , 3 , … 9 9 9 , 5 0 0 . We can place 1 in the last spot and it would be valid as 5 0 1 − 1 = 5 0 0 and 5 0 0 − 1 = 4 9 9 . Thus, the series would be 5 0 1 , 2 , 5 0 2 , 3 , … 4 9 9 , 9 9 9 , 5 0 0 , 1 and it satisfies ∣ σ ( i + 1 ) − σ ( i ) ∣ ≤ 4 9 9 for 1 ≤ i ≤ 9 9 9 . This series is not unique as we can shift the entire series one place to the right and place 1 at the front. We can also reverse the series and the property will still hold.
There is a graph-ish way to interpret the problem: let G = ( V , E ) be an undirected graph such that each vertex v i ∈ V represents a number in { 1 , 2 , . . . , n } and an edge ( v i , v j ) ∈ E exists if v i and v j are adjacent in σ . The weight on each edge is w i j = ∣ v i − v j ∣ .
The process consists of removing all edges { ( v i , v j ) ∣ w i j = i , j min w i j } under the condition that the G remains connected. The figure shows an example for n = 6 . I don't know if there's a way to prove that the vertex ⌈ n / 2 ⌉ is the one that ends up having all of its edges with the minimum weight value (in graph theory terms). If that is the case, the solution for the problem is n − ⌈ n / 2 ⌉ = ⌊ n / 2 ⌋
Hm, how are you relating this connected graph with the optimal permutation? E.g. for n = 6 , the permutation that works is ( 3 , 6 ) ( 1 , 4 ) ( 2 , 5 )
The n odd case gives a slightly more interesting permutation.
Log in to reply
Could it be that each hamiltonian path in the last graph is an optimal permutation? For example σ = ( 4 , 1 , 5 , 2 , 6 , 3 )
Log in to reply
Most likely not, because "all qualifying permutations" don't always yield a Hamiltonian path, at least for even n .
It might be that you just happened to chance upon a similar classification. E.g. the condition of "G remains connected" doesn't seem to be helpful. We could have the disconnected components { 1 , 4 } , { 2 , 5 } , { 3 , 6 } .
Define the multiset S which contains each integer from 1 to 500 exactly twice. S has exactly 1000 elements. Consider each pair of integers (sigma(i+1), sigma(i)) as i ranges from 1 to 999. These pairs cover sigma(i) twice for each i from 1 to 999, thus S is covered by the 999 pairs. By pigeonhole principle, some pair contains 2 elements of S. The largest possible difference of that pair is 500 - 1 = 499.
construction:500,999,499,998,498,997,……2,501,1
The key is noting that if σ ( a ) = 5 0 0 and a < 9 9 9 (if a = 9 9 9 , reverse the permutation so a = 1 ), we have:
1 − 5 0 0 = − 4 9 9 ≤ σ ( a + 1 ) − σ ( a ) ≤ 4 9 9 = 9 9 9 − 5 0 0
∣ σ ( a + 1 ) − σ ( a ) ∣ ≤ 4 9 9
So 1 ≤ i ≤ 9 9 8 min ∣ σ ( i + 1 ) − σ ( i ) ∣ ≤ ∣ σ ( a + 1 ) − σ ( a ) ∣ ≤ 4 9 9 .
Achieving this bound is simple though, seeing that 4 9 9 is nearly half of 9 9 9 : σ = ( 5 0 0 , 1 , 5 0 1 , 2 , 5 0 2 , 3 , … , 9 9 8 , 4 9 9 , 9 9 9 ) achieves the bound.
So the answer is 4 9 9 .
We can consider this permutation as a cycle of numbers starting from 500, since the 1000th term is the 1st term, making it a cycle and it can start with any number since it is a cycle. First we show the answer 499 is valid by choosing 5 0 0 , 1 , 5 0 1 , 2 , 5 0 2 … 4 9 9 , 9 9 9 . Then assume the answer is at least 500, then starting with 500, we have no valid number to follow. The answer is therefore 499.
We know that σ ( i ) = 5 0 0 for some i ∈ { 1 , 2 , 3 , … , 9 9 9 } . So, ∣ σ ( i + 1 ) − σ ( i ) ∣ ≤ 4 9 9 . Hence, the value over all permutations of min 1 ≤ i ≤ 9 9 9 ∣ σ ( i + 1 ) − σ ( i ) ∣ ≤ 4 9 9 . The maximum value of 4 9 9 can be attained using the order { 1 , 5 0 1 , 2 , 5 0 2 , … , 4 9 9 , 9 9 9 , 5 0 0 } .
Problem Loading...
Note Loading...
Set Loading...
We claim that max ( 1 ≤ i ≤ 9 9 9 min ∣ σ ( i + 1 ) − σ ( i ) ∣ ) = 4 9 9 for all permutations σ . We shall now prove this statement.
Consider i such that σ ( i ) = 5 0 0 . Clearly, σ ( i + 1 ) and σ ( i − 1 ) must be chosen from the 9 9 8 remaining numbers. But the maximum value for the expression occurs for { σ ( i − 1 ) , σ ( i + 1 ) } ∈ { 1 , 9 9 9 } , and thus we can conclude that min ∣ σ ( i + 1 ) − σ ( i ) ∣ ≤ 4 9 9 .
Now, it remains to construct a permutation which satisfies 1 ≤ i ≤ 9 9 9 min ∣ σ ( i + 1 ) − σ ( i ) ∣ = 4 9 9 . This is relatively easy:
( σ ( 1 ) , σ ( 2 ) , σ ( 3 ) , … , σ ( 9 9 9 ) ) = ( 1 , 5 0 1 , 2 , 5 0 2 , … , 4 9 9 , 9 9 9 , 5 0 0 ) .