 
Summary: Com S 633: Randomness in Computation
Lecture 8, 9, 10 Scribe: Xiaoyang Gu
Data Stream Algorithms
In this lecture, the space complexity of approximating frequency moments in the data
stream model is discussed.
In the data stream model, a computer has access to a data stream A = (a 1 ; a 2 ; : : : ; a n ) such
that each data item a i 2 T (i = 1; : : : ; n, where n is the size of the stream and T = f1; :::; tg)
can be read only once in an order that is unknown to the computer.
For each i 2 T , let
m i = jfj j a j = igj
be the number of occurrences of i in the data stream A.
Denition. For each k 2 N , the kth frequency moment of fm i g is
F k =
t
X
i=1
m k
i :
Note that F 0 is the number of distinct elements in A; F 1 is the size of A.
Denition. An algorithm A computes an (; Æ)approximation of F k if
