This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CS174 Final Exam Solutions Spring 2001 J. Canny May 16 1. Give a short answer for each of the following questions: (a) (4 points) Suppose two fair coins are tossed. Let be 1 if the first coin is heads, 0 if the first coin is a tail. Let be 1 if the outcomes on the two coins are the same , and 0 if they are different. Are and independent? Explain briefly. Answer: Each pair of outcomes corresponds to a unique combination of heads and tails for the two coins. There are four of these, and all have probability 1/4 for fair coins. So for all pairs . Therefore and are independent. (b) (4 points) Let have the geometric distribution with parameter . What is ? Answer: Notice that or you can compute the sum of the infinite geometric series which is another route to . (c) (4 points) Let be the number of fixed points in a random permutation of items (assume large). Which bounding method out of Markov, Chebyshev or Chernoff would you use to get the best bound for ? Answer: The number of fixed points in a permutation is well-approximated as a pois- son distribution with parameter . The poisson distribution is a good approxima- tion to the binomial distribution for large , and we can apply Chernoff to binomial distributions. Chernoff gives the best bounds when it is applicable, so its the right choice here. (d) (4 points) Suppose balls are randomly distributed into bins, for large . What is the expected number of empty bins? Answer: The probability of a bin being empty is well-approximated by a poisson distribution with parameter here. The distribution is where and (empty bins), which gives . This is also the expected value of the number of empty bins in this bin (think about it). The total expected number of empty bins is times this, which is . 1 (e) (4 points) Suppose we create a random graph on vertices by adding one edge at a time, selecting and independently and uniformly at random from , discarding self-loops. Let be the number of edges added until the graph is connected. What is in terms of (you can give a big-O bound)? Answer: From class, using epochs, the expected number of edges is . 2. Let be a random permutation of . Suppose the elements are inserted in that order into an initially-empty binary search tree....
View Full Document
This test prep was uploaded on 04/20/2008 for the course CS 174 taught by Professor Canny during the Spring '98 term at University of California, Berkeley.
- Spring '98
- Computer Science