Sharp polynomial degrees and exact counts for adjacent lexicographic mistakes in arrays
At fixed width, the number of arrays with exactly \(m\) failed adjacent lexicographic comparisons is a polynomial in the height. Its degree is one less than the largest number of blocks of consecutive identical rows that an admissible array can have. Reversing the intended order of the columns changes how many distinct rows fit in the first increasing run, and this changes the degree. Fix integers \(q\ge2\), \(w\ge1\) and \(m\ge0\). The entries of an array of height \(n\ge1\) and width \(w\) come from the ordered alphabet \(0,\ldots,q-1\). Read each row from left to right and compare successive rows from top to bottom. Read each column from top to bottom and compare successive columns from left to right. In both cases the first differing entry determines the order, and equal words pass. A strict descent of successive rows is always a mistake. For columns, a strict descent is a mistake when both axes are intended to increase, and a strict ascent is a mistake when the columns are intended to decrease. The two axes contribute to a single total of exactly \(m\) mistakes. Write \(Q=q^w\) for the number of possible row words and put \(H=Q-\sum_{j=1}^{w-1}q^j+w-1\), with an empty sum at width one. The exact degree \(D\) and leading term are \[D=\begin{cases}(m+1)Q-1 & \text{if columns are intended to increase},\\ mQ+H-1 & \text{if columns are intended to decrease},\end{cases} \qquad \frac{n^D}{D!}. \] For increasing columns, the unique longest compressed array consists of \(m+1\) complete passes through the row words in increasing lexicographic order. The first pass settles every column comparison favourably, and each reset from the largest word to the smallest accounts for one row mistake. For decreasing columns, the unique longest compressed array starts with the longest increasing run that makes no column mistake and follows it with \(m\) complete passes. To construct that initial run, scan the words in increasing order and accept each word whose first differences in still-equal adjacent columns are all favourable. The scan accepts the words \(1^j0^{w-j}\) for \(j=0,\ldots,w-1\), then every word larger than the last of these. Here \(1^j0^{w-j}\) denotes \(j\) ones followed by \(w-j\) zeros. This gives \(H\) rows and settles all column comparisons. Spending even one mistake on a column leaves at most \(m\) increasing runs, with at most \(mQ\) rows after compression. The loss in degree on reversing the column order is therefore \(Q-H\), independent of the mistake budget. To compute the whole polynomial, replace each maximal block of identical consecutive rows by its single lexicographic rank in \(0,\ldots,Q-1\), using the leftmost digit as the most significant. The resulting sequence is the skeleton. Removing repetitions preserves the row descents and the first difference of every adjacent column pair. Let \(B_s\) count the skeletons of length \(s\) with exactly \(m\) mistakes for the chosen column direction. The count at every positive integer height is \[N(n)=\sum_{s=1}^{D+1} B_s\binom{n-1}{s-1}. \] The binomial counts the ways to restore the \(s\) blocks with positive lengths summing to \(n\). It is zero when \(s>n\). As a polynomial it is \(\prod_{j=1}^{s-1}(n-j)/(s-1)!\), with the empty product equal to one. This gives every ordinary coefficient as well as every count. The unique longest skeleton gives \(B_{D+1}=1\). The polynomial continuation at height zero is zero for \(m>0\) and one for \(m=0\). The numbers \(B_s\) can be computed without enumerating arrays of height \(n\). Store counts by length and by state \((c,r,U)\), where \(c\) is the cumulative number of mistakes, \(r\) is the last rank and \(U\) is the set of adjacent column pairs that have agreed on every row so far. Initialise a length-one count for each first rank, starting with all column pairs unresolved and processing that row's first differences without charging a row comparison. To append a rank \(t\ne r\), add one mistake if \(t<r\). For every pair in \(U\) whose entries differ in the new row, add one mistake if the left entry is larger for increasing columns or smaller for decreasing columns, and remove that pair from \(U\) in either case. Discard costs above \(m\) and add the old count to the new state at length one greater. Each transition advances lexicographically in \((c,r)\), so the states can be processed in that order. There are at most \((m+1)Q2^{w-1}\) states before tracking length and at most \(Q-1\) candidate next ranks per state. Sum the length-\(s\) counts at cost \(m\) over all last ranks and unresolved sets to obtain \(B_s\). Pairs still unresolved at the end are ties. The sequence in height also has a minimal eventual homogeneous constant-coefficient recurrence of order \(D+1\). It already holds for all \(n\ge1\) in the form \[\sum_{j=0}^{D+1}(-1)^{D+1-j}\binom{D+1}{j}N(n+j)=0. \] At width one, both orientations give the ordinary count of words with \(m\) descents. A direct formula is \([z^{qm+q-1}](1+z+\cdots+z^{q-1})^{n+1}\), where \([z^k]\) extracts the coefficient of \(z^k\) in the polynomial that follows. In the binary case this is \(\binom{n+1}{2m+1}\). Hardin's OEIS entries give proposed strip polynomials and, in several cases, degree predictions for particular alphabets, column directions and mistake totals. The degrees below are in increasing width order. Each listed polynomial identity holds at every positive height. The full rational polynomials were checked within their proved degree ranges. Alphabet sizeIntended column orderMistakesWidths and exact degreesPosted formulas established2Increasing1Widths 1–6 have degrees 3, 7, 15, 31, 63, 127The four formulas at widths 3–6 agree in full. Width two agrees with the prior A278357 theorem. A278363, degree predictions and A278357–A2783612Increasing2Widths 1–5 have degrees 5, 11, 23, 47, 95The three formulas at widths 3–5 agree in full. The width-two Barker generating function also agrees and has prior proof work at A278319. A278325, degree predictions and A278319–A2783222Increasing3Widths 2–5 have degrees 15, 31, 63, 127All four posted coefficient lists agree. The width-one identification with A000580 at index \(n+1\) was already known. A278385, FORMULA and A278379–A2783822Decreasing1Widths 3–6 have degrees 11, 20, 37, 70All four posted coefficient lists agree. Width two has prior proof work at A278670. A278676, FORMULA and A278671–A2786742Decreasing2Widths 1–6 have degrees 5, 10, 19, 36, 69, 134The four formulas at widths 3–6 agree in full. Width one has the ordinary binary descent law, and the width-two Barker generating function agrees with the prior A278772 result. A278778, degree predictions and A278772–A2787762Decreasing3Widths 2–5 have degrees 14, 27, 52, 101All four posted coefficient lists agree. Width one shares the known A000580 law with increasing columns. A278855, FORMULA and A278849–A2788523Increasing1Widths 2–4 have degrees 17, 53, 161All three posted coefficient lists agree. The known width-one count is A000574 at index \(n+1\). A278309, FORMULA and A278303–A2783053Increasing2Widths 2–3 have degrees 26, 80Both posted coefficient lists agree. The known width-one count is A005716 at index \(n+1\). A278414, FORMULA and A278408–A2784093Increasing3Widths 1–3 have degrees 11, 35, 107All three posted coefficient lists agree, including the single-column descent law. A278372, FORMULA and A278365–A2783673Decreasing1Widths 2–4 have degrees 15, 43, 125All three posted coefficient lists agree. Width one shares the known A000574 law with increasing columns. A278627, FORMULA and A278621–A2786233Decreasing2Widths 1–3 have degrees 8, 24, 70Both wider polynomials agree in full and reproduce the tabulated counts. Width one has the known ternary descent law. A278634, degree predictions and A278628–A2786293Decreasing3Widths 2–3 have degrees 33, 97Both posted coefficient lists agree. Width one shares A278365 with increasing columns. A278656, FORMULA and A278650–A2786514Increasing1Widths 2–3 have degrees 31, 127Both posted coefficient lists agree. The known width-one count is A001919 at index \(n+1\). A278435, FORMULA and A278430–A2784314Increasing2Widths 1–3 have degrees 11, 47, 191All three posted coefficient lists agree, including the single-column descent law. A278553, FORMULA and A278547–A2785494Increasing3Widths 1–2 have degrees 15, 63Both posted coefficient lists agree, including the single-column descent law. A278610, FORMULA and A278604–A2786054Decreasing1Widths 2–3 have degrees 28, 109Both posted coefficient lists agree. Width one shares the known A001919 law with increasing columns. A278734, FORMULA and A278728–A2787294Decreasing2Widths 2–3 have degrees 44, 173Both posted coefficient lists agree. Width one shares A278547 with increasing columns. A278798, FORMULA and A278793–A2787944Decreasing3Width 2 has degree 60The posted coefficient list agrees in full. Width one shares A278604 with increasing columns. A278896, FORMULA and A278890 Original problem sources. https://oeis.org/A278363/internal https://oeis.org/A278325/internal https://oeis.org/A278778/internal https://oeis.org/A278634/internal https://oeis.org/A278309/internal https://oeis.org/A278385/internal https://oeis.org/A278414/internal https://oeis.org/A278372/internal https://oeis.org/A278627/internal https://oeis.org/A278656/internal https://oeis.org/A278676/internal https://oeis.org/A278855/internal https://oeis.org/A278435/internal https://oeis.org/A278553/internal https://oeis.org/A278610/internal https://oeis.org/A278734/internal https://oeis.org/A278798/internal https://oeis.org/A278896/internal
Authors
- Zixuan He
Institutions
- University of Glasgow (GB)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-03
- DOI
- https://doi.org/10.5281/zenodo.24800580
- Primary Topic
- Advanced Combinatorial Mathematics
- Type
- preprint