[Paper Review] Doubly-Periodic String Comparison
This paper introduces a novel 'frog dynamics' particle system to analyze the expected length of the longest common subsequence (LCS) between a random word R and a doubly-periodic word W(n), showing that E[LCS(R, W(n))] = γW n − τW √n + O(1) for computable constants γW and τW. The key contribution is a rigorous framework linking LCS asymptotics to interacting particle systems, with explicit formulas for γW when W has distinct symbols and new conjectures on LCS behavior in random word pairs.
Let $W^{(n)}$ be the $n$-letter word obtained by repeating a fixed word $W$, and let $R_n$ be a random $n$-letter word over the same alphabet. We show several results about the length of the longest common subsequence (LCS) between $W^{(n)}$ and $R_n$; in particular, we show that its expectation is $γ_W n-O(\sqrt{n})$ for an efficiently-computable constant $γ_W$. This is done by relating the problem to a new interacting particle system, which we dub "frog dynamics". In this system, the particles (`frogs') hop over one another in the order given by their labels. Stripped of the labeling, the frog dynamics reduces to a variant of the PushTASEP. In the special case when all symbols of $W$ are distinct, we obtain an explicit formula for the constant $γ_W$ and a closed-form expression for the stationary distribution of the associated frog dynamics. In addition, we propose new conjectures about the asymptotic of the LCS of a pair of random words. These conjectures are informed by computer experiments using a new heuristic algorithm to compute the LCS. Through our computations, we found periodic words that are more random-like than a random word, as measured by the LCS.
Motivation & Objective
- To understand the expected LCS length between a random word and a fixed periodic word, extending beyond the classical random-random LCS problem.
- To resolve open questions about the rate of convergence, distributional behavior, and computability of LCS constants in periodic settings.
- To introduce a new interacting particle system—'frog dynamics'—to model and analyze LCS behavior in periodic strings.
- To propose new conjectures on the LCS of two random words, informed by heuristic algorithms and simulations.
Proposed method
- Model the LCS problem as a particle system where labeled frogs hop over one another in order of nastiness, forming a dynamics equivalent to a variant of PushTASEP.
- Define a stationary distribution for the frog dynamics, which encodes the LCS asymptotics via a coupling argument and Dyck path combinatorics.
- Use a recursive dynamic programming approach to compute LCS between a random word and a periodic word in O(kn) time, where k is the period length.
- Derive γW(ρ) as a piecewise linear, non-increasing slope function of the density ρ, with discontinuities at critical points where τW(ρ) becomes non-zero.
- Construct an algorithm to compute γW and τW from the stationary distribution of the auxiliary frog dynamics on m-arrangements, reducing state space from k! to |Σ|·2k.
- Use computer simulations with a new heuristic LCS algorithm to conjecture that E[LCS(R,R′)] = γn − Θ(n^{1/3}) for random word pairs, with γ ≈ 0.8122 in the binary case.
Experimental results
Research questions
- RQ1What is the precise asymptotic behavior of E[LCS(R, W(n))] for a fixed periodic word W and random word R?
- RQ2How does the distribution of LCS(R, W(n)) behave—specifically, is it asymptotically normal, and under what conditions?
- RQ3Can the LCS constant γW for periodic words be computed efficiently, and what is its structure in terms of the word’s symbol composition?
- RQ4Do periodic words exist that yield higher LCS expectations than random words, suggesting they are 'more random-like'?
- RQ5What is the correct rate of convergence for E[LCS(R,R′)] in the random-random case, and does the variance grow linearly with n?
Key findings
- The expected LCS length between a random word R and a k-periodic word W(n) is E[LCS(R, W(n))] = γW n − τW √n + O(1), with γW and τW explicitly computable from W.
- For words with all distinct symbols, γW is given by a closed-form expression involving harmonic means of symbol frequencies, and the stationary distribution of the frog dynamics is a uniform measure over Dyck paths.
- The LCS distribution is asymptotically normal with linear variance if τW = 0 and the slope of γW is positive or if some alphabet symbol is missing from W; otherwise, the variance is sub-linear.
- When τW ≠ 0, the LCS converges in distribution to the minimum of two i.i.d. Gaussian random variables under proper scaling.
- The paper identifies periodic binary words—such as W = 0110111010010110010001011010—for which γW(1) ≥ 0.82118, exceeding the conjectured γ ≈ 0.8122 for random word pairs.
- Simulations suggest that E[LCS(R,R′)] = γn − Θ(n^{1/3}) for random words, with γ ≈ 0.8122 in the binary case, and that the variance of LCS(R,R′) is likely linear in n.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.