English

Shaving Logs via Large Sieve Inequality: Faster Algorithms for Sparse Convolution and More

Data Structures and Algorithms 2024-04-01 v1

Abstract

In sparse convolution-type problems, a common technique is to hash the input integers modulo a random prime p[Q/2,Q]p\in [Q/2,Q] for some parameter QQ, which reduces the range of the input integers while preserving their additive structure. However, this hash family suffers from two drawbacks, which led to bottlenecks in many state-of-the-art algorithms: (1) The collision probability of two elements from [N][N] is O(logNQ)O(\frac{\log N}{Q}) rather than O(1Q)O(\frac{1}{Q}); (2) It is difficult to derandomize the choice of pp; known derandomization techniques lead to super-logarithmic overhead [Chan, Lewenstein STOC'15]. In this paper, we partially overcome these drawbacks in certain scenarios, via novel applications of the large sieve inequality from analytic number theory. Consequently, we obtain the following improved algorithms for various problems (in the standard word RAM model): Sparse Nonnegative Convolution: We obtain an O(tlogt)O(t\log t)-time Las Vegas algorithm that computes the convolution ABA\star B of two nonnegative integer vectors A,BA,B, where tt is the output sparsity AB0\|A\star B\|_0. Moreover, our algorithm terminates in O(tlogt)O(t\log t) time with 11/poly(t)1-1/\mathrm{poly}(t) probability. Text-to-Pattern Hamming Distances: Given a length-mm pattern PP and a length-nn text TT, we obtain a deterministic O(nmloglogm)O(n\sqrt{m\log \log m})-time algorithm that exactly computes the Hamming distance between PP and every length-mm substring of TT. Sparse General Convolution: We also give a Monte Carlo O(tlogt)O(t\log t) time algorithm for sparse convolution with possibly negative input in the restricted case where the length NN of the input vectors satisfies Nt1.99N\le t^{1.99}.

Keywords

Cite

@article{arxiv.2403.20326,
  title  = {Shaving Logs via Large Sieve Inequality: Faster Algorithms for Sparse Convolution and More},
  author = {Ce Jin and Yinzhan Xu},
  journal= {arXiv preprint arXiv:2403.20326},
  year   = {2024}
}

Comments

To appear at STOC 2024

R2 v1 2026-06-28T15:38:33.427Z