In a sequence of 1000 different numbers, a pair with is called increasing if and decreasing if . Determine the largest positive integer with the property that in any sequence of 1000 different numbers, there are at least non-overlapping increasing pairs or at least non-overlapping decreasing pairs.
Solution
We will prove that the largest is equal to 333. First, consider the sequence . The first 333 numbers in the sequence are not usable in an increasing pair, because for each of these numbers, only larger numbers are to the left and only smaller numbers are to the right. Therefore, only the last 667 numbers are available for increasing pairs, and this yields at most 333 non-overlapping increasing pairs. For a decreasing pair with , the same logic applies, and thus cannot be satisfied.
Now we prove for all that in a sequence of different numbers, there are always at least non-overlapping increasing pairs or non-overlapping decreasing pairs. We prove this by induction on . For , the sequence has length 2, and this pair of numbers is either increasing or decreasing, so it holds. Now let and assume the statement is true for . We now consider and take an arbitrary sequence with different numbers. If the sequence is completely increasing, then we can divide the sequence into adjacent pairs, all of which are increasing. There are such pairs. If the sequence is completely decreasing, there are analogously at least decreasing pairs. If the sequence is neither completely increasing nor completely decreasing, then there is a point in the sequence where it first increases and then decreases, or vice versa, i.e., there are numbers in the sequence with or . In both cases, among these three numbers, there is both an increasing pair and a decreasing pair. Now apply the induction hypothesis to the sequence . This is a sequence with different numbers, so there are non-overlapping increasing pairs or non-overlapping decreasing pairs. In the first case, we add the increasing pair from to these, and in the second case, we add the decreasing pair. Thus, we have found non-overlapping increasing pairs or non-overlapping decreasing pairs. This completes the induction.
Now substitute into this result: in a sequence of 998 different numbers, there are always at least 333 non-overlapping increasing pairs or at least 333 non-overlapping decreasing pairs. This also holds for a sequence of 1000 numbers (ignore the last two numbers in the sequence). Therefore, satisfies the condition and is thus the largest that satisfies it.