The number of decreasing blocks needed to maximize copies of 1324 grows logarithmically with list length
Why it matters
Arrange a list to make as many groups of four as possible with the smallest number first, the largest last and the middle two descending. A best list can be built from decreasing blocks; multiplying the list length by a fixed factor changes the number of blocks it needs by only a bounded amount. The same growth rule applies even when different block counts tie for best.
How should you order n distinct numbers so that as many groups of four as possible have the order 1324? Reading the chosen numbers from left to right, the smallest must come first, the largest last, and the middle two must descend. The four positions need not be consecutive. One way to attain the maximum is to build the list from decreasing blocks, with every number in one block smaller than every number in the next. How many blocks does this take? The maximum number of copies does not tell us: lists with different numbers of blocks can tie. It was known that the number of blocks must grow with the length of the list, but the rate was unknown.
We prove that every best list built from such blocks has 2\log n/\log(1+\sqrt{3}) blocks, up to a bounded error. Half of the leading term comes from each end. The reason is that, between the central layers and the last few entries at either end, each step across a block leaves roughly the same fraction of the distance still to go.
Patterns and blocks
The decreasing blocks are called layers. For example, 1\,|\,3\,2\,|\,4 has layer widths (1,2,1). Replacing the middle pair by k descending entries gives the pattern (1,k,1): the first entry is smaller than all k, and the last is larger than all k. For these patterns, Stromquist's theorem guarantees that the maximum number of copies among layered lists equals the maximum among all permutations (all possible orderings of the entries; Hildebrand, Sagan and Vatter, Theorem 2.1).
Sliačan and Stromquist, §§3.1 and 5 asked how the number of layers in a best finite list grows. To construct a list rich in copies of 1324, they modeled its ends on lists that maximize copies of 132. Dropping the last entry of the pattern makes this a one-ended problem: a descending pair needs only a smaller entry to its left. In that problem, removing the last layer of a best list leaves roughly a fixed fraction of its length. For 1324, the contribution of a descending pair depends on how many entries lie on both sides.
For the one-ended pattern (1,k), write \alpha_k for the limiting fraction of the length retained after removing the last layer. It is the unique root in (0,1) of k r^{k+1}-(k+1)r+1=0. We show that the same ratio governs both ends for (1,k,1). When the distance to the nearer end is large compared with one position but small compared with n, moving one layer toward that end multiplies the remaining distance by a factor close to \alpha_k. For each fixed k\ge2, the number of layers L_n in every best layered list satisfies
Here O_k(1) means that the error is bounded by a constant that can depend on k, regardless of the length or which list attains the maximum. For 1324, 1/\alpha_2=1+\sqrt3.
Layer counts at finite lengths
We computed the fewest and most layers among best layered lists for 3,075 combinations of length and pattern. For each k=2,\ldots,7, we used all lengths from k+2 through 512, then powers of two from 1,024 through 32,768.
Table 1. Fewest and most layers among lists that attain the maximum, for the shortest and longest patterns examined.
| Length | Fewest, 1324 | Most, 1324 | Fewest, (1,7,1) | Most, (1,7,1) |
|---|---|---|---|---|
| 512 | 11 | 13 | 5 | 17 |
| 2,048 | 15 | 15 | 7 | 11 |
| 8,192 | 17 | 19 | 9 | 9 |
| 32,768 | 21 | 21 | 9 | 21 |
At length 32,768 every best layered list for 1324 has 21 layers. In one such list, three consecutive layers end at positions 186, 509 and 1,388. Starting at the last of these boundaries and stepping left, the fractions of the distance remaining are 509/1388=0.367 and 186/509=0.365 to three decimal places. Both are close to the one-ended ratio 1/(1+\sqrt3)=0.366.
For k=7 at the same length, one best list has nine layers, of widths 7,50,398,3186,25486,3186,398,50,7. Splitting each outermost layer into seven layers of one entry each gives a 21-layer list with exactly the same number of copies. Neither outer layer could supply the seven descending entries of a copy: the first layer has no entry before it, and the last has none after it. After the split, the same entries remain available as endpoints for copies whose descending entries lie in the interior. To count the layers in every best list, we need to know where such thin layers can occur.
Counting copies one layer at a time
Label each boundary by the number of entries to its left. A layer between boundaries a and b has width b-a. The k descending entries of a copy all lie in one layer because entries increase from one layer to the next. There are \binom{b-a}{k} ways to choose them, a choices for the first entry and n-b choices for the last. The layer therefore contributes
copies. Summing over layers counts every copy once.
Fix the full length n. For the first b entries (the prefix), let H(b) be the largest sum of contributions over all ways to divide that prefix into layers. The descending entries come from the prefix, but the last entry of a copy may lie beyond it. If the final layer of the prefix starts at a, the best contribution up to that boundary is H(a). Thus H(0)=0 and
In any best full list, each prefix ending at a layer boundary must itself attain H(b): replacing it with a better prefix would leave all later layer contributions unchanged. Its preceding boundary a must therefore attain the maximum in (1).
For Table 1 we evaluated (1) in increasing order of b, trying every preceding boundary a and counting copies with integer arithmetic. Among all choices of a giving the maximum, we took the smallest and largest layer counts up to a and added one to each for the new layer. At b=n this gives the extremes for the full list. As a separate check, we enumerated all lists of layer widths through length 12 for k=2,3,5 and directly counted decreasing subsequences with their possible endpoints. The maximum scores and both extreme layer counts agreed. For 1324 the scores also matched the maximum counts in the On-Line Encyclopedia of Integer Sequences, entry A342853, through length 14.
Comparing counts near one end
Let M(b) be the best score for the one-ended pattern in a list of length b. Each layer contributes just the choices of a smaller first entry and k descending entries. Write p=k+1 and \alpha=\alpha_k. The one-ended bounds of Hildebrand, Sagan and Vatter (Theorems 1.2–1.3) give
Here and below, O_k bounds the size of an error by a constant depending only on k times the expression in parentheses. For a layer in the first b positions, between n-b and n entries can serve as the last entry. It follows that
When b is small compared with n, these bounds give nearly the same score. But a very thin final layer could have little effect on the score. To recover layer widths from (2), we first bound how thick or thin that layer can be.
Bounds on the width of a layer
A wide layer in a best list needs room on both sides. Suppose its width is d\ge\max(8,4k), with a entries before it and s after it. Split it into three layers of widths h,d-2h,h, where h=\lfloor d/4\rfloor. Contributions from other layers stay fixed. The new middle layer alone contributes
The inequality follows by comparing the k successive factors in the numerators of the two binomial coefficients. Since the split cannot improve the best score, as\ge4^{-k}(a+h)(s+h). Both a and s must be positive and each must be at least 4^{-k}h. Thus \min(a,s)\ge c_k d for a positive constant c_k. In particular, if the layer ends at a large boundary b=a+d, then a/b is bounded away from zero. This also holds if the width is below the fixed threshold, since then a=b-d differs from b by a bounded amount.
To bound the width from below on the left half, consider how much the best prefix score grows with one extra entry. Start with a best prefix of length t>0, where t+1\le n/2. Pick a uniformly random entry in the prefix and enlarge its layer by one, still treating n as the full length. For every layer, the number of possible first entries stays the same or grows. The number of possible last entries falls by at most one, so it retains at least a fraction 1-1/(n-t) of its old value.
A layer of width w has probability w/t of growing. If it grows, it gains \binom w{k-1} choices of descending entries. Since w\binom w{k-1}\ge k\binom wk, its expected number of choices is at least 1+k/t times its old count whenever that count is positive. Applying the endpoint bounds to each contribution and then taking the average gives
The best new prefix does at least as well as the average. The last inequality is equivalent to k(n-t-1)\ge n, which holds on this half.
By (2), H(t)\ge c n t^{k+1} for large t on this half, with c>0 depending only on k. Summing the gains from length a to length b gives H(b)-H(a)\ge c(b-a)n a^k for large a and b\le n/2. In a best list the final layer of width d=b-a must supply that entire gain. It contributes at most na d^k/k! copies. Comparing the two bounds gives d\ge c' a for a positive constant c', since k>1.
These width bounds give a threshold B and constants \eta>0 and q<1, all depending only on k. For any two consecutive boundaries a,b of a best list with B\le b\le n/2, the fraction of the distance to the left end retained in stepping from b to a satisfies
The wide-layer bound gives the lower bound on r. Choosing B large enough then makes a large enough to apply the thin-layer bound, which gives the upper bound on r.
The fraction of distance retained at each step
We can now use the score to pin down r. For consecutive boundaries of a best list, use the lower bound in (2) at b and the upper bound at a in the equality H(b)=H(a)+a\binom d k(n-b). Substituting the estimate for M, dividing by n b^p, and using \binom d k\le d^k/k! gives
When b is large and b/n is small, the right side is small. To see why this forces r close to \alpha, write the left side as (1-r^p)(C-g(r)), where
Its derivative is the polynomial 1-pr+kr^p times the positive factor (1-r)^{k-1}/[k!(1-r^p)^2] on (0,1). The polynomial is strictly convex; its first zero, at \alpha, is simple, and its second zero is at 1. Hence g has a unique maximum at \alpha, with g''(\alpha)<0. Substitution of the root equation gives g(\alpha)=C.
Near the maximum, Taylor expansion bounds C-g(r) below by a positive constant times (r-\alpha)^2. Away from the maximum the same bound holds by compactness on the interval (3). The factor 1-r^p is bounded away from zero there. This is why we needed to exclude very thin layers: as r approaches 1, that factor vanishes. Inequality (4) now bounds the squared distance from r to \alpha. Taking the square root and using the bounded derivative of the logarithm away from zero gives
Counting from the midpoint to each end
Start at the largest boundary b_0\le n/2 and step left. The starting distance b_0 is proportional to n up to constant factors depending only on k, written b_0=\Theta_k(n). To see this, suppose the midpoint is inside a layer of width d. If d<n/4, its left boundary b_0 is greater than n/4. Otherwise, for large n the three-way split gives b_0\ge c_k d. If the midpoint itself is a boundary, b_0=n/2.
Stop at the first boundary below B. For large n, (3) puts this boundary between \eta B and B. If it takes m steps to reach it, the sum of the log ratios in (5) is \log(b_0/b_m)=\log n+O_k(1), because intermediate boundaries cancel. The errors also have a bounded sum. Moving left, each distance is at most q times the previous distance. The terms \sqrt{b/n} therefore sum to at most a geometric series starting at the large end. Reading the same steps in reverse gives a geometric bound for the terms 1/\sqrt b, starting at the small end. Thus m=\log n/\log(1/\alpha)+O_k(1). Fewer than B further layers fit between the stopping boundary and the left end because widths are positive integers.
Reversing the list of widths preserves the score: it just exchanges the numbers of possible first and last entries in each layer's contribution. The same count therefore holds for the layers wholly in the right half, even if the list is asymmetric. At most one layer crosses the midpoint. Adding the two halves gives the stated logarithmic count for every best layered list, including ties.
The result describes exact layered maximizers for fixed k. Their ends determine the leading layer count. The argument leaves open the proportions occupied by the central layers and hence the exact limiting fraction of subsequences that match the pattern.