We wish to estimate the surprise number (2nd moment) of a data stream, using the
method of AMS. It happens that our stream consists of ten different values,
which we'll call 1, 2,..., 10, that cycle repeatedly. That is, at timestamps
1 through 10, the element of the stream equals the timestamp, at timestamps
11 through 20, the element is the timestamp minus 10, and so on. It is now timestamp
75, and a 5 has just been read from the stream. As a start, you should calculate
the surprise number for this time.
For our estimate of the surprise number, we shall choose three timestamps
at random, and estimate the surprise number from each, using the AMS approach
(length of the stream times 2m-1, where m is the number of occurrences
of the element of the stream at that timestamp, considering all times from that
timestamp on, to the current time). Then, our estimate will be the median of the
three resulting values.
You should discover the simple rules that determine the estimate derived from
any given timestamp and from any set of three timestamps. Then, identify from the
list below the set of three "random" timestamps that give the closest estimate.