hw4sol - Computer Science 340 Reasoning about Computation...

  • Homework Help
  • PresidentHackerCaribou10582
  • 6
  • 100% (5) 5 out of 5 people found this document helpful

Info icon This preview shows pages 1–3. Sign up to view the full content.

Computer Science 340 Reasoning about Computation Homework 4 Due at the beginning of class on Wednesday, October 17, 2007 Problem 1 (10 points) We analyzed the process of throwing n balls into n bins independently and at random and showed that the maximum load is at most O ( log n log log n ) with high probability. Suppose instead that the balls are assigned to bins by a function f which is chosen from a universal family. Prove that, with probability at least 1 / 2, the maximum load is O ( n ). Hint: Let X i be the load of the i th bin. Give an upper bound on E [ X 2 i ]. Solution: Let indicator random variables y jk be 1 if ball j is mapped to bin k , and zero otherwise. We know that X i = j y ji . We have E [ i X 2 i ] = i E [ X 2 i ] = i a,b E [ y ai y bi ] = i a E [ y ai ] + a = b E [ y ai y bi ] = a E i y ai + a = b E i y ai y bi n + n ( n - 1) 1 n = 2 n - 1 . Besides changing the order of summations and using linearity of expectations, we use the following: the inequality uses universality property, while the third equation uses the fact that for a zero-one variable x , we have x 2 = x . Using Markov’s bound, we know that with probability at least 1 / 2, i X 2 i < 4 n . Then the maximum is also bounded by 4 n = 2 n = O ( n ). Problem 2 (15 points) In order to implement a counter capable of counting from 1 to N, at least log N bits are needed. In some cases, allowing this number of bits is too expensive. If we allow the counter
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

to make some errors, we can get by with much fewer bits. In this question you’ll see how to implement a “probabilistic counter” - a counter that counts with small errors, and uses only Θ(log log N ) bits. The counter is defined as follows: Initially the counter is 0. An Increment operation is performed as follows: If the current value of the counter is i , increase the counter value by 1 with probability 1 2 i , and leave the counter in its current state ( i ) with probability 1 - 1 2 i . Let C k be a random variable denoting the value of the counter after k Increment operations have occurred.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '07
  • CharikarandChazelle
  • Probability, Probability theory, Yi

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern