Ariel Rosenfeld 1. 2 1 0 1 1 1 0 1 0 0 1 1 Network Traffic Engineering. Call Record Analysis. Sensor...

12
Ariel Rosenfeld 1

Transcript of Ariel Rosenfeld 1. 2 1 0 1 1 1 0 1 0 0 1 1 Network Traffic Engineering. Call Record Analysis. Sensor...

Ariel Rosenfeld

1

2

10

11

1

0

1

0

0

1

1

Network Traffic Engineering.

Call Record Analysis.

Sensor Data Analysis.

Medical, Financial Monitoring.

Etc, etc, etc.

3

….1 0 1 0 0 0 1 0 1 1 1 1 1 1 0 0 0 1 0 1 0 0 1 1…

Time Increases

Current Time

Window Size = N

Count the number of ones in N size window. Exact Solution: Θ(N) memory. Approximate Solution: ?

◦ Good approx with o(N) memory?

4

Exponential Histogram (EH):◦ 1 + ε approximation. (k = 1/ε)◦ Space: O(1/ε(log2N)) bits.◦ Time: O(log N) worst case, O(1) amortized.

5

6

7

Bucket sizes = 4,2,2,2,1.Bucket sizes = 4,4,2,1.Bucket sizes = 4,2,2,1,1,1.Bucket sizes = 4,2,2,1,1.Bucket sizes = 4,2,2,1.

….1 1 0 1 1 1 0 1 0 1 0 0 1 0 1 1 1 1…

k/2 = 1.

Element arrived this step.

Future

Error in last (leftmost) bucket. Bucket Sizes (left to right): Cm,Cm-1, …,C2,C1

Absolute Error <= Cm/2. Answer >= Cm-1+…+C2+C1+1. Error <= Cm/2(Cm-1+…+C2+C1+1). Maintain: Cm/2(Cm-1+…+C2+C1+1) <= 1/k.

8

Every Bucket will become last bucket in future.

New elements may be all zeros. Bucket Sizes (left to right): Cm,Cm-1, …,C2,C1

For every bucket i,◦ Ci/2(Ci-1+…+C2+C1+1) <= 1/k.

9

Maintain Ci/2(Ci-1+…+C2+C1+1) <= 1/k. Exponentially increasing bucket sizes from

right to left. At least k/2 buckets (at most k/2 +1)of each

size(1,2,4,8,…,2i,...).

10

Error Guarantee: ◦ Error <= Cm/2(Cm-1+…+C2+C1) <= 1/k.

Number of buckets: O(k log N). Buckets require O(log N) bits. Total memory: O(k log2 N) bits.

11

If exact size of bucket is not “a must”.

Number of buckets: O(k log N). Buckets require O(loglog N) bits. Total memory: O(k logN loglogN) bits.

12