Counting Small Permutation Patterns
Chaim Even-Zohar, Calvin Leng
Abstract
A sample of n generic points in the xy-plane defines a permutation that relates their ranks along the two axes. Every subset of k points similarly defines a pattern, which occurs in that permutation. The number of occurrences of small patterns in a large permutation arises in many areas, including nonparametric statistics. It is therefore desirable to count them more efficiently than the straightforward Õ(n k ) time algorithm.
This work proposes new algorithms for counting patterns. We show that all patterns of order 2 and 3, as well as eight patterns of order 4, can be counted in nearly linear time. To that end, we develop an algebraic framework that we call corner tree formulas. Our approach generalizes the existing methods and allows a systematic study of their scope.
Using the machinery of corner trees, we find twenty-three independent linear combinations of order-4 patterns, that can be computed in time Õ(n). We also describe an algorithm that counts one of the remaining 4-patterns, and hence all 4-patterns, in time Õ(n 3/2 ).
As a practical application, we provide a nearly linear time computation of a statistic by Yanagimoto (1970), Bergsma andDassios (2010). This statistic yields a natural and strongly consistent variant of Hoeffding's test for independence of X and Y , given a random sample as above. This improves upon the so far most efficient Õ(n 2 ) algorithm.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers1
Ask how each one uses itBuilds on1
Related papers
- Hopcroft's Problem, Log-Star Shaving, 2D Fractional Cascading, and Decision TreesTimothy M. Chan, Da Wei ZhengSODA 2022 · 6 citations
- Detecting and counting small patterns in planar graphs in subexponential parameterized timeJesper NederlofSTOC 2020 · 1 citation
- Near-linear time subhypergraph counting in bounded degeneracy hypergraphsDaniel Paul-Pena, C. SeshadhriSODA 2026
- Permutation-Free High-Order Interaction TestsZhaolu Liu, Robert L. Peach, Mauricio BarahonaICML 2025
- Computing in Anonymous Dynamic Networks Is LinearGiuseppe Antonio Di Luna, Giovanni VigliettaFOCS 2022 · 7 citations
