Approximate counting of permutation patterns
Abstract
We consider the problem of counting the copies of a length- pattern in a sequence , where a copy is a subset of indices such that if and only if . This problem is motivated by a range of connections and applications in ranking, nonparametric statistics, combinatorics, and fine-grained complexity, especially when is a small fixed constant. Recent advances have significantly improved our understanding of counting and detecting patterns. Guillemot and Marx [2014] obtained an time algorithm for the detection variant for any fixed . Their proof has laid the foundations for the discovery of the twin-width, a concept that has notably advanced parameterized complexity in recent years. Counting, in contrast, is harder: it has a conditional lower bound of [Berendsohn, Kozma, and Marx, 2019] and is expected to be polynomially harder than detection as early as , given its equivalence to counting -cycles in graphs [Dudek and Gawrychowski, 2020]. In this work, we design a deterministic near-linear time -approximation algorithm for counting -copies in for all . Combined with the conditional lower bound for , this establishes the first known separation between approximate and exact pattern counting. Interestingly, while neither the sequence nor the pattern are monotone, our algorithm makes extensive use of coresets for monotone functions [Har-Peled, 2006]. Along the way, we develop a near-optimal data structure for -approximate increasing pair range queries in the plane, which exhibits a conditional separation from the exact case and may be of independent interest.
Cite
@article{arxiv.2411.04718,
title = {Approximate counting of permutation patterns},
author = {Omri Ben-Eliezer and Slobodan Mitrović and Pranjal Srivastava},
journal= {arXiv preprint arXiv:2411.04718},
year = {2025}
}
Comments
To appear in SODA 2026. We thank the reviewers for pointing out the connection to coresets for monotone functions [Har-Peled '06]