English

Computable Bounds and Monte Carlo Estimates of the Expected Edit Distance

Formal Languages and Automata Theory 2024-04-09 v2 Data Structures and Algorithms Probability

Abstract

The edit distance is a metric of dissimilarity between strings, widely applied in computational biology, speech recognition, and machine learning. Let ek(n)e_k(n) denote the average edit distance between random, independent strings of nn characters from an alphabet of size kk. For k2k \geq 2, it is an open problem how to efficiently compute the exact value of αk(n)=ek(n)/n\alpha_{k}(n) = e_k(n)/n as well as of αk=limnαk(n)\alpha_{k} = \lim_{n \to \infty} \alpha_{k}(n), a limit known to exist. This paper shows that αk(n)Q(n)αkαk(n)\alpha_k(n)-Q(n) \leq \alpha_k \leq \alpha_k(n), for a specific Q(n)=Θ(logn/n)Q(n)=\Theta(\sqrt{\log n / n}), a result which implies that αk\alpha_k is computable. The exact computation of αk(n)\alpha_k(n) is explored, leading to an algorithm running in time T=O(n2kmin(3n,kn))T=\mathcal{O}(n^2k\min(3^n,k^n)), a complexity that makes it of limited practical use. An analysis of statistical estimates is proposed, based on McDiarmid's inequality, showing how αk(n)\alpha_k(n) can be evaluated with good accuracy, high confidence level, and reasonable computation time, for values of nn say up to a quarter million. Correspondingly, 99.9\% confidence intervals of width approximately 10210^{-2} are obtained for αk\alpha_k. Combinatorial arguments on edit scripts are exploited to analytically characterize an efficiently computable lower bound βk\beta_k^* to αk\alpha_k, such that limkβk=1 \lim_{k \to \infty} \beta_k^*=1. In general, βkαk11/k\beta_k^* \leq \alpha_k \leq 1-1/k; for kk greater than a few dozens, computing βk\beta_k^* is much faster than generating good statistical estimates with confidence intervals of width 11/kβk1-1/k-\beta_k^*. The techniques developed in the paper yield improvements on most previously published numerical values as well as results for alphabet sizes and string lengths not reported before.

Keywords

Cite

@article{arxiv.2211.07644,
  title  = {Computable Bounds and Monte Carlo Estimates of the Expected Edit Distance},
  author = {Gianfranco Bilardi and Michele Schimd},
  journal= {arXiv preprint arXiv:2211.07644},
  year   = {2024}
}

Comments

42 pages, 1 figure, 9 tables, submitted for review