7

It would be better if I could fit "differences of consecutive terms" in the title, but I ran out of space. Anyway, here is a more precise version of my question:

Given $n,$ for any given distinct real numbers $\ x_1,\ x_2,\ \ldots,\ x_n\ $ such that $\ x_1 < x_2 < \ldots < x_n,\ $ what is the guaranteed minimum length, $\ k,\ $of the longest (ordered, i.e. increasing) subsequence $\ \left( x_{n_1},\ x_{n_2},\ \ldots,\ x_{n_k} \right)\ $ of $\ (x_1,\ x_2,\ldots,\ x_n),\ $ such that either $\ x_{n_i} - x_{n_{i-1}} \leq x_{n_{i+1}} - x_{n_i}\quad \forall\ 2\leq i\leq k-1,\quad $ or $\quad x_{n_i} - x_{n_{i-1}} \geq x_{n_{i+1}} - x_{n_i}\quad \forall\ 2\leq i\leq k-1?$

For example, if we have $ 2,5,6,9,10,12$, then the longest subsequence with the desired property has length $4$. But does every length-$6$ sequence have at least $k=4?$ If so then $k(n=6) = 4.$ The question is, what is the function $k(n)$ like in general?

kodlu
  • 10,287
Adam Rubinson
  • 24,300
  • 1
    There are many duplicates. If you use approach0 to search increasing decreasing subsequence you will find a lot of them. Another is [here]https://math.stackexchange.com/questions/3079113/a-sequence-of-rs-1-real-numbers-has-an-increasing-subsequence-of-length-r?noredirect=1) – Ross Millikan Mar 29 '23 at 16:44
  • 3
    @RossMillikan This is NOT Erdos Szekeres theorem. It's not about incresing/decresing subsequences of $x_i$, but about $x_i - x_j$. Voting to reopen. – Calvin Lin Mar 29 '23 at 16:45
  • @CalvinLin: don't we just apply that to the differences, not to the numbers? – Ross Millikan Mar 29 '23 at 16:48
  • 1
    @RossMillikan No, not as easily IMO. I made that mistake too. Instead of just the difference $a_i = x_{i+1} - x_i$, we actually need to look at consecutive sums of $a_i$ to get to $x_j - x_i$. IE Just because there is a monotonic increasing/decreasing subsequence of length $L$ in the differences, that doesn't mean that we necessarily could split it into a monotonic increasing/decreasing "sum of terms" of length $L$. $\quad$ As an explicit example, if the differences was $1, 2, 4, 2, 4$, and we happen to focus on the subsequence $ 2, 2, 4$, then that doesn't yield a monotonic sum of terms. – Calvin Lin Mar 29 '23 at 17:08
  • Erdos Szekeres theorem is related and something I was looking for though, so thanks for mentioning that! I had not heard of it before! – Adam Rubinson Mar 29 '23 at 18:56
  • @bof Nowhere in particular. I came up with it when thinking about what I don't know about (sets of) real numbers. I thought it was a nice question and might help me improve my usage of PHP. And I don't need an ultra-precise answer. – Adam Rubinson Apr 04 '23 at 21:45
  • https://math.stackexchange.com/help/someone-answers – bof Apr 12 '23 at 07:00
  • @bof I do not feel ready to parse your answer, and it may take me some time to do so. – Adam Rubinson Apr 12 '23 at 07:05
  • https://mathoverflow.net/questions/444169/a-combinatorial-problem-about-sequences-of-numbers – Adam Rubinson Jul 29 '24 at 08:33

2 Answers2

4

Your question was posed and solved on pp. 468–469 of the classical paper by Erdős and Szekeres, A combinatorial problem in geometry, Compositio Math. 2 (1935), 463–470 (pdf); their argument is paraphrased below. (For a generalization to non-monotonic sequences by Sergey Norin see this Math Overflow question.)

Call a sequence $x_1,\dots,x_n$ convex if $x_2-x_1\le\cdots\le x_n-x_{n-1}$, concave if $x_2-x_1\ge\cdots\ge x_n-x_{n-1}$. For integers $r,s\ge0$ let $F(r,s)$ denote the maximum length of an increasing sequence of real numbers with no convex subsequence of length $r+2$ and no concave subsequence of length $s+2$. Thus $k(n)$ is the greatest integer $r$ such that $F(r-2,r-2)\lt n$.

Theorem. (Erdős and Szekeres) $F(r,s)=\binom{r+s}r$ for $r,s\ge0$. Hence $k(n)$ is the greatest integer $r$ with $\binom{2r-4}{r-2}\lt n$.

Proof. The boundary conditions $F(0,s)=F(r,0)=1$ are obvious; we have to show that $F$ obeys the Pascal recurrence $F(r,s)=F(r-1,s)+F(r,s-1)$ for $r,s\ge1$.

Lemma 1. $F(r,s)\le F(r-1,s)+F(r,s-1)$ for $r,s\ge1$.

Proof. Let $r,s\ge1$, let $n=F(r,s)\ge2$, and let $x_1,\dots,x_n$ be an increasing sequence of length $n$ with no convex subsequence of length $r+2$ and no concave subsequence of length $s+2$. Choose $k\in\{1,\dots,n-1\}$ so that $x_k\le\frac{x_1+x_n}2\le x_{k+1}$. Since $x_k-x_1\le x_n-x_k$, the sequence $x_1,\dots,x_k$ has no convex subsequence of length $r+1$ and no concave subsequence of length $s+2$, so $k\le F(r-1,s)$. Likewise, since $x_n-x_{k+1}\le x_{k+1}-x_1$, the sequence $x_{k+1},\dots,x_n$ has no convex subsequence of length $r+2$ and no concave subsequence of length $s+1$, so $n-k\le F(r,s-1)$. Hence $F(r,s)=n=k+(n-k)\le F(r-1,s)+F(r,s-1)$.

Lemma 2. $F(r,s)\ge F(r-1,s)+F(r,s-1)$ for $r,s\ge1$.

Proof. Let $x_1,\dots,x_m$ be an increasing sequence of length $m=F(r-1,s)$ with no convex subsequence of length $r+1$ and no concave subsequence of length $s+2$. Let $y_1,\dots,y_n$ be an increasing sequence of length $n=F(r,s-1)$ with no convex subsequence of length $r+2$ and no concave subsequence of length $s+1$. If $y_1-x_m\gt\max(x_m-x_1,y_n-y_1)$ then the sequence $x_1,\dots,x_m,y_1,\dots,y_n$ will have no convex subsequence of length $r+2$ and no concave subsequence of length $s+2$, showing that $F(r,s)\ge m+n=F(r-1,s)+F(r,s-1)$.

Remark. Here is an alternative proof of the fact that $k(7)\ge4$. We show that a sequence $x_1,\dots,x_7$ (not necessarily monotonic) has a convex or concave subsequence of length $4$. Consider the graph with vertex set $$V=\{(r,s,t)\in\mathbb N^3:1\le r\lt s\lt t\le7\}$$ and edge set $$E=\{\{(r,s,t),(s,t,u)\}\in\binom V2:1\le r\lt s\lt t\lt u\le7\}.$$ Color a vertex $(r,s,t)$ blue if $x_s-x_r\le x_t-x_s$, red if $x_s-x_r\gt x_t-x_s$. Since the graph has odd cycles such as the $7$-cycle $$(1,2,3),(2,3,4),(3,4,5),(4,5,6),(5,6,7),(3,5,6),(2,3,5),(1,2,3),$$ there must be two adjacent vertices $(r,s,t)$ and $(s,t,u)$ of the same color. Then the sequence $x_r,x_s,x_t,x_u$ is either convex or concave.

bof
  • 82,298
3

1/ Answering "But does every length-$6$ sequence have at least $k=4?$" in the negative.

First we construct the difference $a_i = x_{i+1} - x_i$. Then, we want to consider the consecutive sum of terms to get to $x_j - x_i$, and find a (not necessarily strictly) monotonic sum of terms from there.

Claim: With a difference of $2, 1, 8, 1, 2$, then we can't form a monotonic sum of terms of length 3.

  • Any length 3 sum of terms must involve 8 (not necessarily as a stand alone term).
  • Because 8 is so large (larger than the sum of the rest of the terms), the term involving 8 is the largest, so it must be in the first or last term.
  • Clearly, there is no monotonic increasing or decreasing sequence from there, since we're constrained to $+8, 1, 2$ (and reflection).

Corollary: In the original problem, the sequence $0, 2, 3, 11, 12, 14$ results in $k = 3$.

Conversely, given any sequence of 6 terms, then we can take any sequence of 3 terms and trivially their difference is monotonic.


2/ Showing that "Every length-7 sequence has at least k = 4"

Again we construct the difference $a_i = x_{i+1} - x_i$.

  • If any 2 consecutive terms are equal, then we can find 3 consecutive terms that are monotonic. Henceforth, $a_{i+1} \neq a_i$.
  • Since no 3 consecutive terms $a_i$ are monotonic, when we plot the graph, each value is a "peak" ($a_{i-1} < a_i > a_{i+1}$) or "trough" ($a_{i-1} > a_i < a_{i+1}$).
  • After a peak can only comes a trough and vice versa.
  • WLOG, let $a_1, a_3, a_5$ be peaks, meaning $a_1 > a_2 < a_3 > a_4 < a_5 > a_6$.
  • Since $a_2 < a_3$, so we require $ a_3 > a_4 + a_5 + a_6$.
  • But then we have $a_6 < a_5 < a_4 + a_3$, so we have a monotonic sequence of length 3.
  • Thus, the original sequence has a corresponding sequence of length 4.

Unfortunately, this doesn't easily extend to $k = 5$.

Calvin Lin
  • 77,541
  • Yeah I thought that we'll have to analyse peaks and trough to some extent: it reminds me of the Lemma for the proof of Bolzano-Weierstrass theorem, although I'm not sure how useful the idea of the proof of that Lemma is in this setting. – Adam Rubinson Mar 30 '23 at 00:14
  • @AdamRubinson Right, that lemma is the infinite analogue of Erdos Szekeres. (Note that my definition of peak and trough is different from the lemma.) $\quad$ Worth mentioning that the infinite analogue of your problem is very easy. If $x_i$ is unbounded, clearly we can find an ever larger sequence. If $x_i$ is bounded, and converges to $x$, then take the values that are $> x - \frac{1}{2^n}$. – Calvin Lin Mar 30 '23 at 00:21