WorksMathematics
Upper bounds for the Chvátal–Sankoff constants ,
Abstract
Lueker (J. ACM 56(3), 2009) constructed a family of finite-state machines whose associated transfer matrices yield upper bounds on the Chvátal–Sankoff constants , and proved (his Theorem 3.26) that these bounds converge to for every alphabet size . He published values only for . For the best upper bounds we were able to find in the literature in September 2026 were still those of Dančík's 1994 thesis: subsequent work generalising Lueker has generalised his Section 2, the lower bound. We implement for arbitrary . One ingredient has no binary analogue — the generating function of a truncation class when both sides of a minimal match pair are truncated — and we derive it. We then give a reduction by relative forms under which the transition multiplicities of the transfer matrix are falling factorials in ; one alphabet-free construction consequently determines the exact matrix for every . We obtain improved upper bounds for , each supported by a Collatz–Wielandt certificate verified in exact rational arithmetic, among them . A note added on 31 October 2026 compares these values with those of a repository made public by L. Jack on 25 October 2026.
Results
Let and let be the length of a longest common subsequence of two independent uniform random words of length over . By subadditivity [1]. The constants are not known.
| Dančík 1994 | this note | gain | gain | ||
| 3 | 4 | 0.765803 | 0.747886276 | 0.017917 | 2.34% |
| 4 | 4 | 0.708236 | 0.689063947 | 0.019172 | 2.71% |
| 5 | 4 | 0.664428 | 0.645032787 | 0.019395 | 2.92% |
| 6 | 3 | 0.629316 | 0.618256822 | 0.011059 | 1.76% |
| 7 | 3 | 0.600184 | 0.589456726 | 0.010727 | 1.79% |
| 8 | 3 | 0.575407 | 0.565041150 | 0.010366 | 1.80% |
| 9 | 3 | 0.553937 | 0.543937275 | 0.010000 | 1.81% |
| 10 | 3 | 0.534855 | 0.525416942 | 0.009438 | 1.76% |
| 11 | 3 | 0.517842 | 0.508964025 | 0.008878 | 1.71% |
| 12 | 3 | 0.502591 | 0.494199896 | 0.008391 | 1.67% |
| 13 | 3 | 0.488800 | 0.480838934 | 0.007961 | 1.63% |
| 14 | 3 | 0.476198 | 0.468660628 | 0.007537 | 1.58% |
| 15 | 3 | 0.464619 | 0.457491357 | 0.007128 | 1.53% |
Table 1.
Every bound in the fourth column is certified in the sense of § 6: it is the value of for an explicit rational and an explicit rational for which the inequality has been checked coordinatewise in exact rational arithmetic.
Background, and why the gap existed
The framework is that of Chvátal and Sankoff [1]: writing for the number of pairs of words of total length whose longest common subsequence has length at least , if then . All published upper bounds bound by counting lists of minimal match pairs, the difficulty being to control the overcounting.
Dančík [2] and Dančík–Paterson [3] control it by domination; for a hand-built 52-state automaton gives , and a much coarser three-class system gives the values for that are still quoted today (see for instance [7]).
Lueker [6] replaces domination by canonicity: the canonical longest common subsequence obtained by backtracking through the dynamic programming table with the fixed priority (up, left, diagonal). Every pair of words has exactly one canonical decomposition (his Lemma 3.4), which domination does not provide — indeed his Conjecture 3.19, that a pair is generated by only one undominated list, is false for every , and he gives counterexamples. His machine remembers the last characters of each word and the last differences in the final row and column of the table. His Theorem 3.26 states that the bounds converge to for arbitrary ; his Table II is binary.
The subsequent literature generalised the other half of his paper. Kiwi and Soto [5] extended his Section 2 — the lower-bound recurrence — to arbitrary alphabet size and number of strings, and that extension has become the standard tool for lower bounds. Section 3 was apparently never revisited for . Professor Kiwi has confirmed (personal communication, 19 September 2026) that they neither implemented nor considered it, and that they know of no obstruction.
The machine
We recall only as far as needed. A minimal match pair is with , and . The map truncates each side of from the left to at most characters; denotes the (finite) set of minimal match pairs with both sides of length at most . A state is with and , and is computed as in [6 Fig. 7]: the limited-history table is extended, missing entries being replaced by the lower bounds available, and the input is accepted exactly when the canonical backtracking from the new corner returns to the stored corner.
Remark 1 (implementation note). The canonicity test of [6 Fig. 7] is printed as while i ≥ h and j ≥ h. Read literally the loop continues past into the region where the limited-history table holds no values, and every input is rejected. The intended semantics — backtrack while strictly outside the stored corner, then test arrival at — is while i > h or j > h. With this reading the machine reproduces Table II of [6] exactly; see § 7.
By [6 Thm. 3.3], if and bounds the growth of the generating function of accepted lists, then
Both logarithms are negative, so the right-hand side is increasing in : overestimating overestimates the bound, which is the safe direction. This is what makes the certificates of § 6 sufficient.
The truncation weights for
The transfer matrix is with , where sums over all minimal match pairs truncating to [6 eq. (36)]. For a minimal match pair always has one side of length 1, so at most one side is ever truncated and is immediate. For both sides can be truncated at once, and the two extensions are not independent: they may not share a letter. This is the only step of [6 Sec. 3] that does not carry over verbatim.
Lemma 2. Let , , , , and . Then
where .
Proof. The preimages of under are the minimal match pairs with , subject to and . Let be the set of letters outside . The constraints are exactly , and . If no truncation occurred on the top, so is empty; likewise for the bottom. This gives the first three cases, the geometric series counting words over (resp. ).
In the fourth case put and ; the constraint is . For fixed , the generating function of words with and is, by inclusion–exclusion over the subsets of , , which depends on only through . Summing over ordered pairs of disjoint subsets of of cardinalities and , of which there are , gives the stated expression; the factor accounts for and themselves. □
That the summand depends only on the cardinalities is what makes the computation feasible: the double sum has terms instead of .
Relative forms, and one construction for every
Canonical states have letter set for some . For let be obtained by keeping the letters and renumbering the letters by order of first appearance, reading the top component then the bottom one; let be the number of letters so renumbered.
Lemma 3. Let be a canonical state with letters.
(i) , its canonical class, and the pair depend on only through .
(ii) For each relative form with , the number of with is the falling factorial , which vanishes as soon as .
Proof. Two symbols with the same relative form differ by a permutation of fixing pointwise. The computation of uses only equality tests between characters, so it commutes with any permutation of ; one fixing the letters of leaves unchanged, whence (i). For (ii), such a symbol is obtained from by choosing the images of its fresh letters among the letters absent from , injectively and in the prescribed order of first appearance.
Corollary 4. Each entry of the aggregated transfer matrix is , where is the number of accepted relative forms with fresh letters. A single alphabet-free construction, enumerating relative forms rather than symbols, therefore determines the exact matrix for every ; the terms with vanish of their own accord, and the states that become unreachable are removed by a graph traversal.
Corollary 5. The transition structure is independent of once . Indeed , because the two words stored in a state end with the same character—the match character of the last pair read—and , because a minimal match pair with both sides of length at most uses at most distinct letters.
At both bounds are attained (), so the threshold is exactly 10. We stress what does not stabilise: the multiplicities themselves are polynomials in and keep changing. At , 24 628 of the 28 467 entries of the aggregated matrix differ between two consecutive values of .
Certificates
For a nonnegative matrix and any vector one has (Collatz–Wielandt), whatever the provenance of ; this is the criterion Lueker uses [6 eq. (41)]. We take rational, compute an approximate Perron vector in floating point, round it to a rational vector with denominator , and then evaluate and verify coordinatewise in exact rational arithmetic. By the monotonicity noted after (1), is then a valid upper bound for . No floating-point error analysis is required.
| states | entries | (exact, shown truncated) | bound | |||
| 3 | 4 | 5116 | 366370 | 18207/100000 | 0.198447797322 | 0.747886276 |
| 4 | 4 | 9427 | 2914973 | 1753/12500 | 0.186757381843 | 0.689063947 |
| 5 | 4 | 11093 | 7053339 | 11493/100000 | 0.179474183475 | 0.645032787 |
| 6 | 3 | 316 | 28466 | 2281/25000 | 0.142411285045 | 0.618256822 |
| 7 | 3 | 316 | 28467 | 8027/100000 | 0.141441938103 | 0.589456726 |
| 8 | 3 | 316 | 28467 | 3593/50000 | 0.140931417339 | 0.565041150 |
| 9 | 3 | 316 | 28467 | 6519/100000 | 0.140772426086 | 0.543937275 |
| 10 | 3 | 316 | 28467 | 2987/50000 | 0.140719207043 | 0.525416942 |
| 11 | 3 | 316 | 28467 | 69/1250 | 0.140796270761 | 0.508964025 |
| 12 | 3 | 316 | 28467 | 1027/20000 | 0.140933803949 | 0.494199896 |
| 13 | 3 | 316 | 28467 | 1201/25000 | 0.141122452238 | 0.480838934 |
| 14 | 3 | 316 | 28467 | 1129/25000 | 0.141340858176 | 0.468660628 |
| 15 | 3 | 316 | 28467 | 4263/100000 | 0.141596014720 | 0.457491357 |
Table 2.
Validation
Reproduction of Table II. Our implementation, run for , returns 7, 98 and 1020 accepting states at , matching [6 Table II], and certified values , 0.177752613, 0.217017514 against the published 0.131204211, 0.177752610, 0.217017510. Our values exceed the published ones — the safe direction — by less than , the difference being the rounding of the certificate vector. The resulting bounds 0.845855, 0.839250, 0.835072 agree with the published six decimals.
Thirteen further published values. The framework (1) was calibrated beforehand against the Chvátal–Sankoff bounds of 1975 and 1983 for — computed 0.905118, 0.829982, 0.772908, 0.727666, 0.690556 and 0.866595, 0.786473, 0.729705, 0.686117, 0.650983 against published 0.90512, 0.82999, 0.77291, 0.72767, 0.69056 and 0.86660, 0.78648, 0.72971, 0.68612, 0.65099 — and against the values attributed to Deken in [2 Fig. 4.2] for , obtained by taking minimal match pairs alone: 0.776817, 0.718092, 0.673221 against 0.77682, 0.71810, 0.67323.
Remark 6. For the same computation gives and hence 0.860191, not the 0.85750 listed for Deken in [2 Fig. 4.2]. The reconstruction of [2 Sec. 4.2] therefore does not reproduce that particular entry, and it should not be used as a calibration point.
End-to-end test. For all pairs of words over up to a given length we computed the canonical decomposition directly from the dynamic programming table and checked that accepts it; and, conversely, that lists of minimal match pairs of total size at most that are not canonical are rejected, as required by [6 Def. 3.12(2)]. Over equal to , , , , and this covers 56 788 canonical decompositions: none is rejected, and of the 195 short lists tested (four of them not canonical) none is wrongly accepted. This is the test that would invalidate the bounds, since coverage of is what [6 Thm. 3.3] requires.
The falling-factorial law. Corollary 4 was checked against direct constructions: 85 401 comparisons of individual matrix entries at , no discrepancy. The alphabet-free construction was then compared entry by entry with the direct one for : identical state sets (including the smaller ones, 249 states at and 309 at ) and identical multiplicities throughout.
Internal consistency. The bounds are strictly decreasing in . Kiwi, Loebl and Matoušek [4] proved ; our bound increases monotonically and stays below 2:
| bound | bound | Dančík | |
| 3 | 0.747886276 | 1.29538 | 1.32641 |
| 4 | 0.689063947 | 1.37813 | 1.41647 |
| 5 | 0.645032787 | 1.44234 | 1.48571 |
| 6 | 0.618256822 | 1.51441 | 1.54150 |
| 7 | 0.589456726 | 1.55956 | 1.58794 |
| 8 | 0.565041150 | 1.59818 | 1.62750 |
| 9 | 0.543937275 | 1.63181 | 1.66181 |
| 10 | 0.525416942 | 1.66151 | 1.69136 |
| 11 | 0.508964025 | 1.68804 | 1.71749 |
| 12 | 0.494199896 | 1.71196 | 1.74103 |
| 13 | 0.480838934 | 1.73369 | 1.76239 |
| 14 | 0.468660628 | 1.75357 | 1.78177 |
| 15 | 0.457491357 | 1.77186 | 1.79946 |
Table 3.
Limitations
The bounds for are computed at , the first rung of the ladder. At the ladder reads 0.764971 (), 0.754807 (), 0.747886 (); at , 0.696850 () and 0.689064 (); at , 0.653114 () and 0.645033 (). Each further rung is worth roughly 0.007–0.008. We did not reach for : the number of relative forms per state at is 81, 414, 1895, 7740, 28 149, 91 226, 264 699, 693 480 for , and with some states this puts at about evaluations of and at about . These are not bounds of the method, only of the hardware used here; anyone with more compute will improve every line of the table.
For we reproduce [6] and add nothing: his machine has 6.4 million accepting states and gives .
Code
A single self-contained script, VERIF_CS.py, rebuilds the machine from scratch, self-tests against Table II of [6], and re-verifies in exact rational arithmetic. It shares no code with the program that produced the bounds. As distributed it covers twelve of the thirteen lines of the table — the ten lines at , together with and at — in a few minutes, and reproduces each of them to the last digit printed here. The thirteenth line, at , has 11 093 states and some matrix entries and does not fit in a single short session; it was re-verified with the script’s own routines in a checkpointed run of about a quarter of an hour, which reconstructs the same automaton (11 093 states, 7 053 339 entries) and the same certificate. All thirteen lines have thus been reproduced, to the last digit printed here, along a second code path. We note the limit of this independence in any case: the two programs were written by the same author from the same reading of [6 Fig. 7], so they are independent as code paths, not as readings. The script is attached to this deposit as anc/VERIF_CS.py (Python 3 and numpy, no argument); the line , is obtained by uncommenting one line.
Note added, 31 October 2026
This note was circulated in the version above on 20 and 21 September 2026. On 25 October 2026, L. Jack made public a repository [8] with upper bounds for obtained from the same machine of Lueker. For () and () it reports the same numbers of states and the same bounds to six decimals as the present note, and for , the bound 0.653115, which agrees with the value 0.653114 of § 8 up to the rounding of the last digit: an independent confirmation of these computations. It also reports () and (), which improve the values of the present note for . For it stops at ; to our knowledge the bound () above is the best published one, and for the two sets of values coincide.
Acknowledgements
I thank Professor Marcos Kiwi for two prompt replies, and in particular for confirming that Section 3 of [6] had been neither implemented nor considered for , and that no obstruction was known to him. The computations and the drafting of this note were carried out with the assistance of an AI system (Claude, Anthropic); every statement attributed to the literature has been checked against the primary source cited, and every numerical claim is backed by the certificates of § 6.
References
- [1]V. Chvátal and D. Sankoff, Longest common subsequences of two random sequences, J. Appl. Probab. 12 (1975), 306–315.
- [2]V. Dančík, Expected length of longest common subsequences, Ph.D. dissertation, Department of Computer Science, University of Warwick, 1994.
- [3]V. Dančík and M. Paterson, Upper bounds for the expected length of a longest common subsequence of two binary sequences, Random Structures Algorithms 6 (1995), no. 4, 449–458.
- [4]M. Kiwi, M. Loebl and J. Matoušek, Expected length of the longest common subsequence for large alphabets, Adv. Math. 197 (2005), no. 2, 480–498.
- [5]M. Kiwi and J. Soto, On a speculated relation between Chvátal–Sankoff constants of several sequences, Combin. Probab. Comput. 18 (2009), no. 4, 517–532.
- [6]G. S. Lueker, Improved bounds on the average length of longest common subsequences, J. ACM 56 (2009), no. 3, Article 17, 38 pp.
- [7]M. Rosenfeld, Upper bounds on the average edit distance between two random strings, arXiv:2407.18113 (2024).arxiv.org/abs/2407.18113
- [8]L. Jack, Improved upper bounds on the Chvátal–Sankoff constants for alphabets of size 3 to 15, GitHub repository leandrejack-afk/chvatal–sankoff-bound, version ipl–2026, 25 October 2026.