Addressing the quality control problem for pattern counting in sequence settings, this paper proposes a sublinear algorithmic framework based on exponentially robust pseudorandomness, obtaining polynomial-time feasible solutions for both permutation patterns and discrete subsequences, along with corresponding query complexity lower bounds.
This study introduces and investigates quality control problems on sequences, whose core goal is to distinguish between two types of sequences: baseline sequences generated by independently and identically distributed characters, and anomalous sequences in which a specified pattern appears as a subsequence with too high or too low a frequency. The study covers two typical scenarios: pattern counting over finite alphabets, and permutation pattern counting over real-valued sequences where patterns are defined by the relative order of characters within a subsequence.
Prior quality-control-related frameworks were only defined and applied in graph settings; this work is a new exploration extending that framework to sequences. Although multiple steps of the algorithm and analysis are inspired by research in graph settings, each step requires tailored definitions and rigorous derivation for the sequence setting. In terms of performance, the original worst-case approximate sequence pattern counting problem has an exponential lower bound in the pattern length k, whereas the quality control version admits a polynomial upper bound in k; the performance gap between the two is clear-cut.
For the continuous permutation pattern scenario, the paper proposes a quality control algorithm running in poly(k) time in the sublinear-time model, distinguishing two types of sequences: typical sequences sampled from the independent distribution , and atypical sequences in which the number of copies of a target permutation pattern τ of length k deviates from typical statistics. For the discrete subsequence scenario, when distribution p is defined over the symbol set [m] with minimum probability , the corresponding quality control algorithm requires only on the order of queries and time. This is the first validated scenario, proving that the quality control framework can transform a problem requiring exponential time in the worst case into one fully solvable in polynomial time.
To obtain the above low-complexity results, the paper introduces the concept of exponentially robust pseudorandomness, proving that samples of only poly(k) size fully preserve the counting properties of permutation patterns of length k, without needing to read subsequences of length to verify whether the count share of a permutation pattern is close to 1, thereby directly avoiding the high overhead of the original verification route.
The final algorithm for a permutation of length n is very simple, with core steps as follows: first sample a random subsequence of length from the original permutation, then represent the permutation σ corresponding to this subsequence as a two-dimensional point set , then partition the space into a coarse grid of , where each grid cell is an square, and the quality control decision is completed based on this binning result.
To address the two core obstacles in quality control for sequence pattern counting, the paper designs two mutually cooperating core components. The first component is exponentially robust pseudorandomness, a mechanism that verifies the global count of a target pattern using only random subsequences of polynomial size in k, directly keeping query complexity polynomial. The design of this concept draws on existing pseudorandomness research and extends the applicability boundary of such methods.
The second core component is permutation mixingness, a proxy statistic computable in O(N) time that characterizes pattern counting features on subsequences, avoiding explicit enumeration and counting of all patterns and reducing the overall runtime overhead of the algorithm at the computational-path level.
Combining the two core components yields the complete quality control decision algorithm for sequence pattern counting: first sample an index subsequence of polynomial size in k and construct the corresponding induced permutation, then test whether that permutation satisfies the (m, β)-mixingness condition, outputting an accept decision only when it does. Completeness of the algorithm is guaranteed directly, because the restriction of a random permutation to a random index set is still a random permutation, hence satisfying the mixingness requirement with high probability; for reliability, if the count of the target pattern in the original sequence deviates from 1 by a sufficiently large margin, the argument via exponentially robust pseudorandomness shows that there must exist some subsequence length such that the sampled subpattern count deviates from the expected value under independent and identically distributed sampling, whereas the mixingness requirement demands all such counts match expectations; thus the sampled subsequence cannot satisfy the mixingness condition, and the tester outputs reject. You can refer to the algorithm flow diagram below to fully trace the three-step execution logic from input to final decision.
This algorithm, constructed from exponentially robust pseudorandomness and permutation mixingness, ultimately completes the specified sequence pattern counting quality control task using only on the order of poly(k/p_min) queries and time, where p_min is the minimum probability over all patterns.
For a permutation pattern τ of length k, in the setting of sequences generated by non-atomic real-valued distributions, the paper proves that the quality control algorithm's query and time complexity is only polynomial in k, entirely independent of the total input sequence length n, requiring only on the order of queries and time to complete the decision. You can refer to the diagram that follows to understand the correspondence between the block design of multi-level decreasing point sequences and the derivation of this polynomial upper bound.
The paper also gives query complexity lower bound conclusions for both scenarios: for any permutation pattern of length k, all quality control algorithms satisfying the correctness requirement require at least queries, while for the specific case of the increasing permutation pattern of length k, the query complexity lower bound can be further tightened to , where δ is any constant in the open interval (0,1).
The current research has achieved the core goal of deriving fully polynomial bounds for the sequence pattern counting quality control problem, but core parameter dependencies remain unclear: for both the permutation pattern and subsequence scenarios, the precise correspondence of algorithm complexity with respect to the parameters (k, ε, m, p_min) has not been pinpointed; this is currently the main open problem in this direction.
In addition, the permutation mixingness concept proposed in the paper has potential broader applicability in research on pseudorandom permutations and sequences; exploring practical application scenarios for this concept is a research direction worth attention going forward.