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 and Marx, 2014),而后者在指数时间假设(ETH)成立的情况下,无法在$f(k)\cdot n^{o(k/\log k)}$时间内求解(Berendsohn, Kozma, and Marx, 2021)。事实上,对于长度为4的模式,在标准细粒度复杂度假设下,精确计数已难以实现近线性时间算法(Dudek and 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}$倍的近似解。