Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Read about Morris's Algorithm of Countingf' before attempting Counting the Number of tokens in a stream [Not Distinct) It is trivial to see that if

image text in transcribed
Read about "Morris's Algorithm of Countingf' before attempting Counting the Number of tokens in a stream [Not Distinct) It is trivial to see that if there are m tokens in the stream, then [logzm] many bits suffice to keep track of the number of tokens. Now consider the following randomized algorithm. Probabilistic Counting: LetX ( 0 . While stream is non-emplty With probability21X incrementX ( X + 1. End While Return 2X - 1 In the following, let Y = 2". m = number of tokens in the entire stream E[Y] = m + 1 (Can be proven Inductively) Var[Y] = m(m - 1)/2. We consider an alternate (and somewhat more elegant) way of modifying the basic estimator1 to achieve better estimates. Suppose you modify the given algorithm as follows - you increment X with probability (\"lay , for some a > 0 (a = 1 in the above algorithm). What should the algorithm return now? Determine the value of a that you need to choose in order to find an estimate Y such that |Y ml 5 em with probability at least 9/10? [1] Basic estimator (For Distinct Counting): Let Y [0,1] (h is an idealized hash func) While (stream is non-empty) Let i be the next element/token Y ( min{ Y, h(i)] Return % 1 Space: Just the number of bits to represent Y. 1 Var [Y] S (M 1)2 Probability of error E(that the error is more than allowed): P \"Y S i using Chebyshev's Inequality. n+1 n+1 E2 using Chebyshev's Inequality

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Business Ethics

Authors: Peter A. Stanwick, Sarah D. Stanwick

3rd Edition

1506303234, 9781506303239

More Books

Students also viewed these Mathematics questions

Question

8. What values do you want others to associate you with?

Answered: 1 week ago