Detecting and counting copies of permutation patterns are fundamental algorithmic problems, with applications in the analysis of rankings, nonparametric statistics, and property testing tasks such as independence and quasirandomness testing. From an algorithmic perspective, there is a sharp difference in complexity between detecting and counting the copies of a given length-$k$ pattern in a length-$n$ permutation. The former admits a $2^{\mathcal{O}(k^2)} \cdot n$ time algorithm (Guillemot and Marx, 2014) while the latter cannot be solved in time $f(k)\cdot n^{o(k/\log k)}$ unless the Exponential Time Hypothesis (ETH) fails (Berendsohn, Kozma, and Marx, 2021). In fact already for patterns of length 4, exact counting is unlikely to admit near-linear time algorithms under standard fine-grained complexity assumptions (Dudek and Gawrychowski, 2020). Recently, Ben-Eliezer, Mitrović and Sristava (2026) showed that for patterns of length up to 5, a $(1+\varepsilon)$-approximation of the pattern count can be computed in near-linear time, yielding a separation between exact and approximate counting for small patterns, and conjectured that approximate counting is asymptotically easier than exact counting in general. We strongly refute their conjecture by showing that, under ETH, no algorithm running in time $f(k)\cdot n^{o(k/\log k)}$ can approximate the number of copies of a length-$k$ pattern within a multiplicative factor $n^{(1/2-\varepsilon)k}$. The lower bound on runtime matches the conditional lower bound for exact pattern counting, and the obtained bound on the multiplicative error factor is essentially tight, as an $n^{k/2}$-approximation can be computed in $2^{\mathcal{O}(k^2)}\cdot n$ time using an algorithm for pattern detection.
翻译:检测与计数排列模式副本是基础算法问题,在排名分析、非参数统计以及独立性检验与拟随机性检验等性质测试任务中具有重要应用。从算法视角看,在长度为$n$的排列中检测与计数给定长度-$k$模式的副本存在显著的复杂度差异:前者存在$2^{\mathcal{O}(k^2)} \cdot n$时间算法(Guillemot与Marx,2014),而后者除非指数时间假设(ETH)不成立,否则无法在$f(k)\cdot n^{o(k/\log k)}$时间内求解(Berendsohn、Kozma与Marx,2021)。事实上,即使对于长度为4的模式,在标准细粒度复杂度假设下,精确计数也不太可能存在近线性时间算法(Dudek与Gawrychowski,2020)。近期Ben-Eliezer、Mitrović与Sristava(2026)证明对于长度不超过5的模式,可在近线性时间内计算模式计数的$(1+\varepsilon)$近似值,从而为小规模模式的精确计数与近似计数提供了分离证据,并推测近似计数在渐进意义上通常比精确计数更易处理。我们通过严格证明否定了其猜想:在ETH假设下,不存在$f(k)\cdot n^{o(k/\log k)}$时间算法能以$n^{(1/2-\varepsilon)k}$乘法因子逼近长度-$k$模式的副本数量。该运行时下界与精确模式计数的条件性下界相匹配,且所获乘法误差因子的界限本质上是紧致的——因为利用模式检测算法可在$2^{\mathcal{O}(k^2)}\cdot n$时间内计算$n^{k/2}$近似值。