Streaming lower bounds for distinctness and the largest frequency #
Splitting the stream into the positions of Alice's ones followed by the positions of Bob's ones
(Cslib.BitString.positions), the items are distinct exactly when the two bit strings have
disjoint supports (Cslib.Streaming.nodup_positions_append). A streaming algorithm deciding
whether the items of a stream are distinct thus gives a one-way protocol for disjointness
(Cslib.Streaming.Randomized.ecomplexityFun_le_of_spaceLE), and the Ω(n) lower bound for
disjointness KalyanasundaramSchnitger1992 becomes an Ω(n) lower bound on the
memory.
- A randomized streaming algorithm deciding whether at most
2 nitems ofFin nare distinct with errorε ≤ 1 / 2needsΩ(n)bits of memory, with a constant depending only onε(Cslib.Streaming.le_of_solves_nodup); for error1 / 3,n ≤ 36864 (b + 1) + 2 ^ 12(Cslib.Streaming.le_of_solves_nodup_one_third). - The largest frequency
F∞of a stream (Cslib.Streaming.maxFreq) is1on nonempty streams of distinct items and at least2otherwise, so an estimate within less than a third ofF∞decides distinctness, and approximatingF∞needsΩ(n)bits too (Cslib.Streaming.le_of_solves_maxFreq,Cslib.Streaming.le_of_solves_maxFreq_one_third). This is [AlonMatiasSzegedy1999, Proposition 3.1]. The reduction prefixes a fixed item to make the stream nonempty, so the bound is stated forFin (n + 1)and streams of2 n + 1items. - A deterministic streaming algorithm deciding distinctness exactly, or computing
F∞exactly, needsnbits (Cslib.Streaming.Algorithm.le_of_run_eq_decide_nodup,Cslib.Streaming.Algorithm.le_of_run_eq_maxFreq), from the exact deterministic complexityn + 1of disjointness. Storing the set of items seen and a flag shows thatn + 1bits suffice.
Main results #
Cslib.Streaming.nodup_positions_append: the positions of two bit strings are distinct exactly when the bit strings are disjoint.Cslib.Streaming.decide_lt_four_thirds_eq: an estimate ofF∞within less than a third decides distinctness.Cslib.Streaming.le_of_solves_nodup,Cslib.Streaming.le_of_solves_nodup_one_third: randomized distinctness needsΩ(n)bits.Cslib.Streaming.le_of_solves_maxFreq,Cslib.Streaming.le_of_solves_maxFreq_one_third: approximatingF∞needsΩ(n)bits [AlonMatiasSzegedy1999, Proposition 3.1].Cslib.Streaming.Algorithm.le_of_run_eq_decide_nodup,Cslib.Streaming.Algorithm.le_of_run_eq_maxFreq: the deterministic exact boundsn ≤ b.
References #
Detecting a repeated item #
Detecting a repeated item needs Ω(n) bits of memory: a randomized streaming algorithm that
decides, with error at most ε ≤ 1 / 2 on streams of at most 2 n items of Fin n, whether all
items are distinct, and whose algorithms use at most b bits of memory on streams of at most n
items, has n ≤ 2 ^ 10 r (b + 1) + 2 ^ 12 for every r with (4 ε (1 - ε)) ^ r ≤ 1 / 64. For
ε < 1 / 2 such an r exists.
Detecting a repeated item needs Ω(n) bits of memory, for error 1 / 3:
n ≤ 36864 (b + 1) + 2 ^ 12.
Deterministic detection of a repeated item needs n bits of memory: a deterministic
streaming algorithm deciding whether at most 2 n items of Fin n are distinct, with at most
b bits of memory on streams of at most n items, has n ≤ b.
The largest frequency #
Approximating F∞ needs Ω(n) bits of memory [AlonMatiasSzegedy1999, Proposition 3.1]:
a randomized streaming algorithm that estimates the largest frequency of a nonempty stream of at
most 2 n + 1 items of Fin (n + 1) within less than a third of it, except with probability at
most ε ≤ 1 / 2, and whose algorithms use at most b bits of memory on streams of at most n + 1
items, has n ≤ 2 ^ 10 r (b + 1) + 2 ^ 12 for every r with (4 ε (1 - ε)) ^ r ≤ 1 / 64. An
estimate within λ F∞ for a fixed λ < 1 / 3 is in particular within less than a third.
Approximating F∞ needs Ω(n) bits of memory [AlonMatiasSzegedy1999, Proposition 3.1],
for error 1 / 3: n ≤ 36864 (b + 1) + 2 ^ 12.
Computing F∞ exactly needs n bits of memory deterministically: a deterministic
streaming algorithm computing the largest frequency of every stream of at most 2 n items of
Fin n, with at most b bits of memory on streams of at most n items, has n ≤ b.