Given increasing sequence of numbers, what is guaranteed min length the longest subseq. s.t. differences of terms are either decreasing or increasing?

278 Views Asked by At

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?

2

There are 2 best solutions below

2
On

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$.

0
On

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.