Shaving Logs via Large Sieve Inequality: Faster Algorithms for Sparse Convolution and More
Abstract: In sparse convolution-type problems, a common technique is to hash the input integers modulo a random prime $p\in [Q/2,Q]$ for some parameter $Q$, 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]$ is $O(\frac{\log N}{Q})$ rather than $O(\frac{1}{Q})$; (2) It is difficult to derandomize the choice of $p$; 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(t\log t)$-time Las Vegas algorithm that computes the convolution $A\star B$ of two nonnegative integer vectors $A,B$, where $t$ is the output sparsity $|A\star B|_0$. Moreover, our algorithm terminates in $O(t\log t)$ time with $1-1/\mathrm{poly}(t)$ probability. Text-to-Pattern Hamming Distances: Given a length-$m$ pattern $P$ and a length-$n$ text $T$, we obtain a deterministic $O(n\sqrt{m\log \log m})$-time algorithm that exactly computes the Hamming distance between $P$ and every length-$m$ substring of $T$. Sparse General Convolution: We also give a Monte Carlo $O(t\log t)$ time algorithm for sparse convolution with possibly negative input in the restricted case where the length $N$ of the input vectors satisfies $N\le t{1.99}$.
- Stronger 3-SUM lower bounds for approximate distance oracles via additive combinatorics. In Proc. 55th Annual ACM Symposium on Theory of Computing (STOC), pages 391–404, 2023. doi:10.1145/3564246.3585240.
- Karl R. Abrahamson. Generalized string matching. SIAM J. Comput., 16(6):1039–1051, 1987. doi:10.1137/0216067.
- Lower bounds for multiplication via network coding. In Proc. 46th International Colloquium on Automata, Languages, and Programming (ICALP), volume 132, pages 10:1–10:12, 2019. doi:10.4230/LIPICS.ICALP.2019.10.
- Improved parallel integer sorting without concurrent writing. Inf. Comput., 136(1):25–51, 1997. doi:10.1006/INCO.1997.2632.
- Nir Ailon. A lower bound for fourier transform computation in a linear model over 2x2 unitary gates using matrix entropy. Chic. J. Theor. Comput. Sci., 2013, 2013. URL: http://cjtcs.cs.uchicago.edu/articles/2013/12/contents.html.
- Deterministic length reduction: Fast convolution in sparse data and applications. In Proc. 18th Annual Symposium on Combinatorial Pattern Matching (CPM), volume 4580, pages 183–194, 2007. doi:10.1007/978-3-540-73437-6_20.
- Primes is in p. Ann. Math., pages 781–793, 2004.
- Output-sensitive algorithms for sumset and sparse polynomial multiplication. In Proc. 2015 ACM on International Symposium on Symbolic and Algebraic Computation (ISSAC), pages 29–36, 2015. doi:10.1145/2755996.2756653.
- Andrew Arnold. Sparse polynomial interpolation and testing. PhD thesis, 2016. URL: https://uwspace.uwaterloo.ca/handle/10012/10307.
- Asymptotically fast solution of toeplitz and related systems of linear equations. Linear Algebra Appl., 34:103–116, 1980.
- Faster 0-1-knapsack via near-convex min-plus-convolution. In Proc. 31st Annual European Symposium on Algorithms (ESA), volume 274, pages 24:1–24:16, 2023. doi:10.4230/LIPICS.ESA.2023.24.
- Explicit constructions of rip matrices and related problems. Duke Math. J., 159(1):145, 2011.
- Sparse nonnegative convolution is equivalent to dense nonnegative convolution. In Proc. 53rd Annual ACM SIGACT Symposium on Theory of Computing (STOC), pages 1711–1724, 2021. URL: https://arxiv.org/abs/2105.05984, doi:10.1145/3406325.3451090.
- Deterministic and las vegas algorithms for sparse nonnegative convolution. In Proc. 2022 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 3069–3090, 2022. URL: https://arxiv.org/abs/2107.07625, doi:10.1137/1.9781611977073.119.
- Fast multivariate multipoint evaluation over all finite fields. In Proc. 63rd IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 221–232, 2022. doi:10.1109/FOCS54457.2022.00028.
- Deterministically testing sparse polynomial identities of unbounded degree. Inf. Process. Lett., 109(3):187–192, 2009. doi:10.1016/J.IPL.2008.09.029.
- A new deterministic algorithm for sparse multivariate polynomial interpolation. In Proc. 2014 International Symposium on Symbolic and Algebraic Computation (ISSAC), pages 51–58. ACM, 2014. doi:10.1145/2608628.2608648.
- Top-k-convolution and the quest for near-linear output-sensitive subset sum. In Proc. 52nd Annual ACM SIGACT Symposium on Theory of Computing (STOC), pages 982–995, 2020. doi:10.1145/3357713.3384308.
- Fast n-fold boolean convolution via additive combinatorics. In Proc. 48th International Colloquium on Automata, Languages, and Programming (ICALP), volume 198, pages 41:1–41:17, 2021. doi:10.4230/LIPIcs.ICALP.2021.41.
- A fine-grained perspective on approximating subset sum and partition. In Proc. 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1797–1815, 2021. doi:10.1137/1.9781611976465.108.
- Karl Bringmann. A near-linear pseudopolynomial time algorithm for subset sum. In Proc. 28th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1073–1084, 2017. doi:10.1137/1.9781611974782.69.
- On arithmetic properties of sumsets. Acta Math. Hungar., 144(1):18–42, 2014. doi:10.1007/s10474-014-0436-y.
- A deterministic algorithm for sparse multivariate polynominal interpolation (extended abstract). In Proc. 20th Annual ACM Symposium on Theory of Computing (STOC), pages 301–309, 1988. doi:10.1145/62212.62241.
- Verifying candidate matches in sparse and wildcard matching. In Proc. 34th Annual ACM Symposium on Theory of Computing (STOC), pages 592–601, 2002. doi:10.1145/509907.509992.
- Reducing 3SUM to convolution-3SUM. In Proc. 3rd Symposium on Simplicity in Algorithms (SOSA), pages 1–7, 2020. doi:10.1137/1.9781611976014.1.
- Faster algorithms for text-to-pattern Hamming distances. In Proc. 64th IEEE Symposium on Foundations of Computer Science (FOCS), pages 2188–2203, 2023. URL: https://arxiv.org/abs/2310.13174, doi:10.1109/FOCS57990.2023.00136.
- Clustered integer 3SUM via additive combinatorics. In Proc. 47th Annual ACM Symposium on Theory of Computing (STOC), pages 31–40, 2015. doi:10.1145/2746539.2746568.
- Approximating partition in near-linear time. CoRR, abs/2402.11426, 2024. To appear in STOC 2024. arXiv:2402.11426.
- Pattern matching for spatial point sets. In Proc. 39th Annual Symposium on Foundations of Computer Science (FOCS), pages 156–165, 1998. doi:10.1109/SFCS.1998.743439.
- Fredman’s trick meets dominance product: Fine-grained complexity of unweighted APSP, 3SUM counting, and more. In Proc. 55th Annual ACM Symposium on Theory of Computing (STOC), pages 419–432, 2023. doi:10.1145/3564246.3585237.
- Streaming regular expression membership and pattern matching. In Proc. 2022 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 670–694, 2022. doi:10.1137/1.9781611977073.30.
- H. Davenport and H. Halberstam. The values of a trigonometrical polynomial at well spaced points. Mathematika, 13:91–96, 1966. doi:10.1112/S0025579300004277.
- Martin Dietzfelbinger. Universal hashing and k𝑘kitalic_k-wise independent random variables via integer arithmetic without primes. In Proc. 13th Annual Symposium on Theoretical Aspects of Computer Science (STACS), volume 1046, pages 569–580, 1996. doi:10.1007/3-540-60922-9_46.
- Fast integer multiplication using modular arithmetic. SIAM J. Comput., 42(2):685–699, 2013. doi:10.1137/100811167.
- Gaspard Riche de Prony. Essai experimental et analytique: sur les lois de la dilatabilite des fluides elastique et sur celles de la force expansive de la vapeur de l’eau et de la vapeur de l’alkool, a differentes temperatures. Journal Polytechnique ou Bulletin du Travail fait a l’Ecole Centrale des Travaux Publics, 1795.
- P. D. T. A. Elliott. On inequalities of large sieve type. Acta Arith., 18:405–422, 1971. doi:10.4064/aa-18-1-405-422.
- Charles M. Fiduccia. Polynomial evaluation via the division algorithm: The fast fourier transform revisited. In Proc. 4th Annual ACM Symposium on Theory of Computing (STOC), pages 88–93, 1972. doi:10.1145/800152.804900.
- Nick Fischer. Algorithms for sparse convolution and sublinear edit distance. PhD thesis, 2023. doi:http://dx.doi.org/10.22028/D291-40531.
- Nick Fischer. Deterministic sparse pattern matching via the Baur-Strassen theorem. In Proceedings of the 2024 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 3333–3353, 2024. doi:10.1137/1.9781611977912.119.
- Deterministic 3sum-hardness. In Proceedings of the 15th Innovations in Theoretical Computer Science Conference, ITCS 2024, volume 287 of LIPIcs, pages 49:1–49:24. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.ITCS.2024.49.
- String matching and other products. In Complexity of Computation, RM Karp (editor), SIAM-AMS Proceedings, volume 7, pages 113–125, 1974.
- Essentially optimal sparse polynomial multiplication. In Proc. 2020 International Symposium on Symbolic and Algebraic Computation (ISSAC), pages 202–209, 2020. doi:10.1145/3373207.3404026.
- Symbolic-numeric sparse interpolation of multivariate polynomials. J. Symb. Comput., 44(8):943–959, 2009. doi:10.1016/J.JSC.2008.11.003.
- Towards unified approximate pattern matching for Hamming and L11{}_{\mbox{1}}start_FLOATSUBSCRIPT 1 end_FLOATSUBSCRIPT distance. In Proc. 45th International Colloquium on Automata, Languages, and Programming (ICALP), volume 107, pages 62:1–62:13, 2018. doi:10.4230/LIPIcs.ICALP.2018.62.
- Nicholas J. Higham. Accuracy and stability of numerical algorithms. SIAM, 2002.
- Joris van der Hoeven and Grégoire Lecerf. Univariate polynomial factorization over finite fields with large extension degree. Appl. Algebra Eng. Commun. Comput., pages 1–29, 2022. doi:10.1007/s00200-021-00536-1.
- Faster polynomial multiplication over finite fields. J. ACM, 63(6):52:1–52:23, 2017. doi:10.1145/3005344.
- Analytic number theory, volume 53 of American Mathematical Society Colloquium Publications. American Mathematical Society, Providence, RI, 2004. doi:10.1090/coll/053.
- Piotr Indyk. Faster algorithms for string matching problems: Matching the convolution bound. In Proc. 39th Annual Symposium on Foundations of Computer Science (FOCS), pages 166–173, 1998. doi:10.1109/SFCS.1998.743440.
- Henryk Iwaniec. The large sieve with prime moduli. Rev. Mat. Iberoam., 38(7):2337–2354, 2022. doi:10.4171/rmi/1381.
- Fast low-space algorithms for subset sum. In Proc. 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1757–1776, 2021. doi:10.1137/1.9781611976465.106.
- Ce Jin and Yinzhan Xu. Removing additive structure in 3SUM-based reductions. In Proc. 55th Annual ACM Symposium on Theory of Computing (STOC), pages 405–418, 2023. doi:10.1145/3564246.3585157.
- Erich L. Kaltofen. On computing determinants of matrices without divisions. In Proc. 1992 International Symposium on Symbolic and Algebraic Computation (ISSAC), pages 342–349, 1992. doi:10.1145/143242.143350.
- Samuel Karlin. Total positivity. Stanford University Press, 1968.
- Improved sparse multivariate polynomial interpolation algorithms. In Proc. 1988 International Symposium on Symbolic and Algebraic Computation (ISSAC), volume 358, pages 467–474, 1988. doi:10.1007/3-540-51084-2_44.
- Donald E. Knuth. Art of computer programming, volume 2: Seminumerical algorithms. Addison-Wesley Professional, 2014.
- Mathias Bæk Tejs Knudsen. Linear hashing is awesome. In Proc. IEEE 57th Annual Symposium on Foundations of Computer Science (FOCS), pages 345–352, 2016. doi:10.1109/FOCS.2016.45.
- Fast polynomial factorization over high algebraic extensions of finite fields. In Proc. 1997 International Symposium on Symbolic and Algebraic Computation (ISSAC), pages 184–188, 1997. doi:10.1145/258726.258777.
- Fast polynomial factorization and modular composition. SIAM J. Comput., 40(6):1767–1802, 2011. doi:10.1137/08073408X.
- Faster pseudopolynomial time algorithms for subset sum. ACM Trans. Algorithms, 15(3):40:1–40:20, 2019. doi:10.1145/3329863.
- Lei Li. On the arithmetic operational complexity for solving vandermonde linear equations. Jpn. J. Ind. Appl. Math., 17:15–18, 2000.
- Bruce G. Lindsay. On the determinants of moment matrices. Ann. Statist., 17(2):711–721, 1989. doi:10.1214/aos/1176347137.
- Yi Li and Vasileios Nakos. Deterministic sparse fourier transform with an ℓ∞subscriptℓ\ell_{\infty}roman_ℓ start_POSTSUBSCRIPT ∞ end_POSTSUBSCRIPT guarantee. In Proc. 47th International Colloquium on Automata, Languages, and Programming (ICALP), volume 168, pages 77:1–77:14, 2020. doi:10.4230/LIPICS.ICALP.2020.77.
- Hugh L. Montgomery. Topics in multiplicative number theory. Springer-Verlag, Berlin-New York,,, 1971.
- Hugh L. Montgomery. The analytic principle of the large sieve. Bull. Amer. Math. Soc., 84(4):547–567, 1978. doi:10.1090/S0002-9904-1978-14497-8.
- Martin Morf. Doubling algorithms for toeplitz and related equations. In Proc. 1980 IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP), pages 954–959, 1980. doi:10.1109/ICASSP.1980.1171074.
- Parallel sparse polynomial multiplication using heaps. In Proc. 2009 International Symposium on Symbolic and Algebraic Computation (ISSAC), pages 263–270, 2009. doi:10.1145/1576702.1576739.
- S. Muthukrishnan. New results and open problems related to non-standard stringology. In Proc. 6th International Symposium on Combinatorial Pattern Matching (CPM), volume 937, pages 298–317, 1995. doi:10.1007/3-540-60044-2_50.
- Hilbert’s inequality. J. London Math. Soc. (2), 8:73–82, 1974. doi:10.1112/jlms/s2-8.1.73.
- Vasileios Nakos. Nearly optimal sparse polynomial multiplication. IEEE Trans. Inf. Theory, 66(11):7231–7236, 2020. doi:10.1109/TIT.2020.2989385.
- Vassiliy Ilyich Nechaev. Complexity of a determinate algorithm for the discrete logarithm. Mathematical Notes, 55(2):165–172, 1994. doi:10.1007/BF02113297.
- Victor Pan. Structured matrices and polynomials: unified superfast algorithms. Springer Science & Business Media, 2001.
- Victor Y. Pan. Toeplitz/Hankel Matrix Structure and Polynomial Computations, pages 23–71. Birkhäuser Boston, Boston, MA, 2001. doi:10.1007/978-1-4612-0129-8_2.
- Daniel S. Roche. Adaptive polynomial multiplication. Proc. Milestones in Computer Algebra (MICA’08), pages 65–72, 2008.
- Daniel S. Roche. What can (and can’t) we do with sparse polynomials? In Proc. 2018 ACM on International Symposium on Symbolic and Algebraic Computation (ISSAC), pages 25–30, 2018. doi:10.1145/3208976.3209027.
- Victor Shoup. New algorithms for finding irreducible polynomials over finite fields. In Proc. 29th Annual Symposium on Foundations of Computer Science (FOCS), pages 283–290, 1988. doi:10.1109/SFCS.1988.21944.
- Schnelle multiplikation großer zahlen. Computing, 7(3-4):281–292, 1971. doi:10.1007/BF02242355.
- Mikkel Thorup. Randomized sorting in O(nloglogn)𝑂𝑛𝑛O(n\log\log n)italic_O ( italic_n roman_log roman_log italic_n ) time and linear space using addition, shift, and bit-wise boolean operations. J. Algorithms, 42(2):205–230, 2002. doi:10.1006/jagm.2002.1211.
- Joris van der Hoeven and Grégoire Lecerf. On the complexity of multivariate blockwise polynomial multiplication. In Proc. 2012 International Symposium on Symbolic and Algebraic Computation (ISSAC), pages 211–218, 2012. doi:10.1145/2442829.2442861.
- Joachim von zur Gathen and Jürgen Gerhard. Modern Computer Algebra. Cambridge University Press, 2013.
- Dieter Wolke. Farey fractions with prime demoninator and the large sieve. In Colloque de Théorie des Nombres (Univ. Bordeaux, Bordeaux, 1969), Bull. Soc. Math. France, Mém. No. 25, pages 183–188. Soc. Math. France, Paris, 1971. doi:10.24033/msmf.52.
- D. Wolke. On the large sieve with primes. Acta Math. Acad. Sci. Hungar., 22:239–247, 1971/72. doi:10.1007/BF01896016.
- Zhiqiang Xu. Deterministic sampling of sparse trigonometric polynomials. J. Complex., 27(2):133–140, 2011. doi:10.1016/J.JCO.2011.01.007.
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Collections
Sign up for free to add this paper to one or more collections.