Streaming algorithms for recognizing nearly well-parenthesized expressions
We study the streaming complexity of the membership problem of 1-turn-Dyck2 and Dyck2 when there are a few errors in the input string. 1-turn-Dyck2 with errors: We prove that there exists a randomized one-pass algorithm that given x checks whether there exists a string x’ in 1-turn-Dyck2 such that x is obtained by flipping at most $k$ locations of x’ using: - O(k log n) space, O(k log n) randomness, and poly(k log n) time per item and with error at most 1/poly(n). - O(k^{1+epsilon} + log n) space for every 0 <= epsilon <= 1, O(log n) randomness, O(polylog(n) + poly(k)) time per item, with error at most 1/8. Here, we also prove that any randomized one-pass algorithm that makes error at most k/n requires at least Omega(k log(n/k)) space to accept strings which are exactly k-away from strings in 1-turn-Dyck2 and to reject strings which are exactly (k+2)-away from strings in 1-turn-Dyck2. Since 1-turn-Dyck2 and the Hamming Distance problem are closely related we also obtain new upper and lower bounds for this problem. Dyck2 with errors: We prove that there exists a randomized one-pass algorithm that given x checks whether there exists a string x’ in Dyck2 such that x is obtained from x’ by changing (in some restricted manner) at most k positions using: - O(k log n + sqrt(n log n)) space, O(k log n) randomness, poly(k log n) time per element and with error at most 1/poly(n). - O(k^(1+epsilon)+ sqrt(n log n)) space for every 0 <= epsilon <= 1, O(log n) randomness, O(polylog(n) + poly(k)) time per element, with error at most 1/8.
💡 Research Summary
The paper investigates the streaming complexity of recognizing strings that are “almost” well‑parenthesized, focusing on two canonical languages: 1‑turn‑Dyck₂ (a one‑turn version of the Dyck language with two types of parentheses) and the full Dyck₂ language. The authors consider the setting where the input string may differ from a valid string by at most k edit operations (flipping a symbol) and ask whether a one‑pass streaming algorithm can decide membership with limited memory, randomness, and per‑item processing time.
1‑turn‑Dyck₂ with errors.
The authors first observe a tight correspondence between 1‑turn‑Dyck₂ and the Hamming‑distance problem: a string belongs to 1‑turn‑Dyck₂ after at most k flips iff its Hamming distance to the language is ≤ k. Leveraging this equivalence, they adapt known streaming protocols for the k‑distance problem. Two algorithms are presented:
-
Algorithm A (high‑accuracy). Uses O(k log n) bits of space, the same amount of randomness, and poly(k log n) time per symbol. By hashing each symbol with a pairwise‑independent hash family and maintaining a running checksum, the algorithm accepts if the checksum is consistent with ≤ k errors. The error probability can be driven down to 1/poly(n) via standard amplification.
-
Algorithm B (space‑efficient). For any ε∈
Comments & Academic Discussion
Loading comments...
Leave a Comment