Graph streams #
The graph stream of a word a : Fin n → γ lists the pairs (i, a i) in order
(Cslib.Streaming.graphStream); its items are distinct. In the concatenation of the graph streams
of two words a and b, every position where a and b agree contributes one item seen twice
and every other position two items seen once, so its k-th frequency moment is
2 ^ k · #{i | a i = b i} + 2 · d(a, b), where d is the Hamming distance
(Cslib.Streaming.freqMoment_graphStream_append_eq). For k ≠ 1 it is 2 n exactly when a and
b agree nowhere (Cslib.Streaming.freqMoment_graphStream_append_eq_two_mul_iff).
These streams are the hard instances of the Ω(n) lower bounds for the frequency moments of Alon,
Matias and Szegedy [AlonMatiasSzegedy1999, Propositions 3.7 and 3.8] in
CslibFrontier.Computability.Streaming.MomentLowerBound: for Proposition 3.7 the graphs of two
codewords of a code of relative distance 1 / 2, for Proposition 3.8 graphs encoding two sets.
Main definitions #
Cslib.Streaming.graphStream: the stream of the pairs(i, a i).
Main results #
Cslib.Streaming.freqMoment_graphStream_append,Cslib.Streaming.freqMoment_graphStream_append_eq: the frequency moments of two concatenated graph streams.Cslib.Streaming.freqMoment_graphStream_append_eq_two_mul_iff: fork ≠ 1,F_k = 2 nexactly when the two words agree nowhere.
References #
The frequency moments of two concatenated graph streams: each position where the words agree contributes an item seen twice, and each other position two items seen once.
The frequency moments of two concatenated graph streams, through the number of positions where the words agree and their Hamming distance.
For k ≠ 1, the k-th frequency moment of two concatenated graph streams of length n is
2 n exactly when the words agree nowhere. For k = 1 it is always 2 n.