Solutions to Problem Set 4

Similar documents
Problem 1: (Chernoff Bounds via Negative Dependence - from MU Ex 5.15)

Randomized algorithm

Homework 4 Solutions

Randomized Load Balancing:The Power of 2 Choices

Kousha Etessami. U. of Edinburgh, UK. Kousha Etessami (U. of Edinburgh, UK) Discrete Mathematics (Chapter 7) 1 / 13

Lecture 4. P r[x > ce[x]] 1/c. = ap r[x = a] + a>ce[x] P r[x = a]

Lecture 04: Balls and Bins: Birthday Paradox. Birthday Paradox

Balls & Bins. Balls into Bins. Revisit Birthday Paradox. Load. SCONE Lab. Put m balls into n bins uniformly at random

In a five-minute period, you get a certain number m of requests. Each needs to be served from one of your n servers.

Tail Inequalities. The Chernoff bound works for random variables that are a sum of indicator variables with the same distribution (Bernoulli trials).

n! (k 1)!(n k)! = F (X) U(0, 1). (x, y) = n(n 1) ( F (y) F (x) ) n 2

CS5314 Randomized Algorithms. Lecture 15: Balls, Bins, Random Graphs (Hashing)

UC Berkeley, CS 174: Combinatorics and Discrete Probability (Fall 2008) Midterm 1. October 7, 2008

The first bound is the strongest, the other two bounds are often easier to state and compute. Proof: Applying Markov's inequality, for any >0 we have

Assignment 4: Solutions

Randomized Algorithms Week 2: Tail Inequalities

Solutions to Problem Set 5

EECS 126 Probability and Random Processes University of California, Berkeley: Spring 2018 Kannan Ramchandran February 14, 2018.

Outline. Martingales. Piotr Wojciechowski 1. 1 Lane Department of Computer Science and Electrical Engineering West Virginia University.

Lecture 4: Two-point Sampling, Coupon Collector s problem

n! (k 1)!(n k)! = F (X) U(0, 1). (x, y) = n(n 1) ( F (y) F (x) ) n 2

Lecture 4: Sampling, Tail Inequalities

Math Spring Practice for the final Exam.

Twelfth Problem Assignment

Limiting Distributions

Application: Bucket Sort

Midterm Exam 1 Solution

Lecture 08: Poisson and More. Lisa Yan July 13, 2018

Chernoff Bounds. Theme: try to show that it is unlikely a random variable X is far away from its expectation.

8 Laws of large numbers

More than one variable

CS 2336 Discrete Mathematics

CSE 525 Randomized Algorithms & Probabilistic Analysis Spring Lecture 3: April 9

Expectation, inequalities and laws of large numbers

6.854 Advanced Algorithms

CS5314 Randomized Algorithms. Lecture 18: Probabilistic Method (De-randomization, Sample-and-Modify)

Exam 3, Math Fall 2016 October 19, 2016

Lecture 5: Moment generating functions

4 Moment generating functions

With high probability

Spring 2012 Math 541B Exam 1

SDS 321: Introduction to Probability and Statistics

A = A U. U [n] P(A U ). n 1. 2 k(n k). k. k=1

PROBABILITY THEORY LECTURE 3

Lecture 5: The Principle of Deferred Decisions. Chernoff Bounds

Discrete Mathematics, Spring 2004 Homework 4 Sample Solutions

Homework for 1/13 Due 1/22

STAT 516 Midterm Exam 2 Friday, March 7, 2008

n px p x (1 p) n x. p x n(n 1)... (n x + 1) x!

Tail and Concentration Inequalities

Random Graphs. EECS 126 (UC Berkeley) Spring 2019

1. Let X be a random variable with probability density function. 1 x < f(x) = 0 otherwise

Discrete Distributions Chapter 6

Lecture 16. Lectures 1-15 Review

If the objects are replaced there are n choices each time yielding n r ways. n C r and in the textbook by g(n, r).

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis

The expansion of random regular graphs

Lecture 1 September 3, 2013

MARKING A BINARY TREE PROBABILISTIC ANALYSIS OF A RANDOMIZED ALGORITHM

Lecture 1: Introduction to Sublinear Algorithms

2 Random Variable Generation

Lecture 1 Measure concentration

SDS 321: Introduction to Probability and Statistics

Math Introduction to Probability. Davar Khoshnevisan University of Utah

1 Probability Review. CS 124 Section #8 Hashing, Skip Lists 3/20/17. Expectation (weighted average): the expectation of a random quantity X is:

HW on Ch Let X be a discrete random variable with V (X) = 8.6, then V (3X+5.6) is. V (3X + 5.6) = 3 2 V (X) = 9(8.6) = 77.4.

Introduction to discrete probability. The rules Sample space (finite except for one example)

Mathematical Statistics 1 Math A 6330

Problem Points S C O R E Total: 120

Lecture 4: Hashing and Streaming Algorithms

Lecture 5 : The Poisson Distribution

Limiting Distributions

CSE 312 Final Review: Section AA

6.1 Occupancy Problem

Chapter 5. Chapter 5 sections

The genome encodes biology as patterns or motifs. We search the genome for biologically important patterns.

MTH 202 : Probability and Statistics

Statistics for Economists. Lectures 3 & 4

Mathematical Methods for Computer Science

Write your Registration Number, Test Centre, Test Code and the Number of this booklet in the appropriate places on the answersheet.

a zoo of (discrete) random variables

i=1 k i=1 g i (Y )] = k f(t)dt and f(y) = F (y) except at possibly countably many points, E[g(Y )] = f(y)dy = 1, F(y) = y

Problems for 2.6 and 2.7

{ 0! = 1 n! = n(n 1)!, n 1. n! =

18.175: Lecture 8 Weak laws and moment-generating/characteristic functions

UC Berkeley Department of Electrical Engineering and Computer Science. EE 126: Probablity and Random Processes. Problem Set 4: Solutions Fall 2007

Test Problems for Probability Theory ,

BMIR Lecture Series on Probability and Statistics Fall 2015 Discrete RVs

1 Approximate Counting by Random Sampling

3. Review of Probability and Statistics

Chapter 2. Discrete Distributions

FINAL EXAM: Monday 8-10am

UC Berkeley Department of Electrical Engineering and Computer Sciences. EECS 126: Probability and Random Processes

X = X X n, + X 2

CSE 103 Homework 8: Solutions November 30, var(x) = np(1 p) = P r( X ) 0.95 P r( X ) 0.

List coloring hypergraphs

Lecture 10: Bayes' Theorem, Expected Value and Variance Lecturer: Lale Özkahya

variance of independent variables: sum of variances So chebyshev predicts won t stray beyond stdev.

EECS 126 Probability and Random Processes University of California, Berkeley: Spring 2018 Kannan Ramchandran February 14, 2018.

SUMMARY OF PROBABILITY CONCEPTS SO FAR (SUPPLEMENT FOR MA416)

Transcription:

UC Berkeley, CS 174: Combinatorics and Discrete Probability (Fall 010 Solutions to Problem Set 4 1. (MU 5.4 In a lecture hall containing 100 people, you consider whether or not there are three people in the room who share the same birthday. Explain how to calculate this probability exactly, using the same assumptions as in our previous analysis. There are a number of ways to count this value, so several solutions were accepted. One such solution is given here. Let A 0 be the event that everyone in the room has a distinct birthday. Let A i be the event that i pairs of people share a birthday. Then the probability we are interested in is P[at least 3 people share a birthday = 1 P[A 0 P[A i (1 where there are n people in the room. First, we note that P[A 0 is in the book and is P[A 0 = (365 n n! 365. Second, we wish to compute P[A n i. For i = 1, we have ( n 365 1 P[A 1 = 365 ( n (n! For i = we have ( 365 ( n n ( 365 P[A = ( n 4 (n 4! This generalizes for i pairs of people sharing i distinct birthdays P[A i = ( 365 n ( i ( n j+ n/ ( 365 i n i (n i! Plugging everything into Equation 1 and putting in n = 100, we can compute a value for this probability. We get P[at least 3 people share a birthday 0.6459.. (MU 5.8 Our analysis of Bucket sort in Section 5.. assumed that n elements were chosen independently and uniformly at random from the range [0, k. Suppose instead that n elements are chosen independently from the range [0, k according to a distribution with the property that any number x [0, k is chosen with probability at most a/ k for some fixed constant a > 0. Show that, under these conditions, Bucket sort still requires linear expected time. Recall from the proof in section 5.. that the expected sorting time for all the buckets is at most n n E c(x j = c E[Xj. We will now use the probability that any bin is chosen with probability at most a/ k. The number of elements any bin are upper bounded by a random variable Y Bin(n, a/n. To upper bound 1

the expected time for sorting, we see that c n E[Xj cne[y [ ( a ( a = cn n(n 1 + n (by p48 of book n n [( = cn 1 1 a + a n cn(a + a. This is linear-time sorting, since c and a + a are both constants. 3. (MU 5.9, a and b Consider the probability that every bin receives exactly one ball when n balls are thrown uniformly at random into n bins. Let X i be the event that the i th bin has one ball, and let X be the event that all the bins have a single ball: X = n X i. (a Using a Poisson approximation, we find an upper bound. variable for bin i, and recall that m = n Let Y i be a Poisson random P[Y i = j = e n/n ( n n j j! P[Y i = 1 = 1 e Applying the constant factor for the Poisson approximation (Cor. 5.9, we can bound the probability of X using Y = n {Y i = 1}. P[X e np[y = e ( 1 n n. e (b Now, we determine the exact probability of this event. There are n n ways to throw n balls into n bins. There is only one way, given a specific ordering of the balls, to put a single ball into each bin. And there are n! possible orderings of the balls. Thus the exact probability of n balls in n bins is: P[X = n! n n. 4. (MU 5.11 The following problem models a simple distributed system wherein agents contend for resources but back off in the face of contention. Balls represent agents, bins represent resources. The system evolves over rounds. Every round, balls are thrown independently and uniformly at random into n bins. Any ball that lands in a bin by itself is served and removed from consideration. The remaining balls are thrown again in the next round. We begin with n balls in the first round, and we finish when every ball is served.

(a If there are b balls in a stage, the probability that a particular ball lands in a bin by itself is (1 1/n b 1. By linearity of expectation, the expected number of balls that get served is b(1 1/n b 1, and the expected number of those that remain is b b(1 1/n b 1. (b Suppose that every round the number of balls served was exactly the expected number of balls to be served. Show that all the balls would be served in O(loglogn rounds. We use the previous part together with the assumption that in each round the expected number of balls are served. To obtain the second line below, notice also that (1 x k 1 kx for k 0. x j+1 = x j (1 (1 1/n x j 1 x j (1 (1 (x j 1/n = x j (x j 1/n x j/n. Notice from the exact formula in part (a that a constant number of rounds i suffices to reduce n balls to n/ balls. By recursively expanding the above relation, we see that x i+t x t i /n t 1 (n/ t /n t 1 n/ t. This value is 1 when t = O(log log n. Since i is constant, the total number of rounds is i + t = O(log log n. 5. (MU 5.13, a and b Let Z be a Poisson random variable with mean µ where µ 1 is an integer. (a Show that P[Z = µ + h P[Z = µ h 1 for 0 h µ 1. P[Z = µ + h P[Z = µ h 1 e µ µ µ+h (µ + h! µ µ+h (µ + h! e µ µ µ h 1 (µ h 1! µ µ h 1 (µ h 1! µ h+1 (µ + h! (µ h 1! µ h+1 (µ h(µ h + 1...(µ 1µ(µ + 1...(µ + h 1(µ + h Now multiply pairs of the coefficients in the product on the right hand side: (µ h(µ + h,..., (µ 1(µ+1. We see that there are h of these new coefficients (µ (h i(µ+(h i = (µ (h i, and certainly we have the inequality (µ (h i µ. So we see that the inequality does hold for h 0 since µ h+1 (µ h (µ (h 1...(µ 1µ µ h (µ h (µ (h 1...(µ 1. 3

(b Using part (a, we can see that P[Z µ 1/. P[Z µ = = P[Z = h h=µ P[Z = µ + h µ 1 P[Z = µ + h µ 1 P[Z = µ h 1 = P[Z < µ by part (a 6. (MU 5.15 Since P[Z < µ + P[Z µ = 1 and P[Z µ P[Z < µ from above, we have P[Z µ 1/. We consider another way to obtain Chernoff-like bounds in the setting of balls and bins without using Theorem 5.7. Consider n balls thrown randomly into n bins. Let X i = 1 if the ith bin is empty and 0 otherwise. Let X = n X i. Let Y i, i = 1,..., n, be independent Bernoulli random variables that are 1 with probability p = (1 1/n n. Let Y = n Y i. (a Show that E[X 1 X X k E[Y 1 Y Y k for any k 1. For the X i s, the product is 1 only if the first k bins are empty. So there are (n k n ways to throw n balls into n k bins. And there are n n ways to throw n balls into n bins. So, we have (n kn E[X 1 X X k = n n = (1 k/n n. For the Y i s, since they are independent, we simply have the product of k binomial random variables with p = (1 1/n n. This is E[Y 1 Y Y k = (1 1/n kn. From the book, we know that 1 k/n (1 1/n k for all positive integers n, k. So we have E[X 1 X X k E[Y 1 Y Y k. (b Show that E[e tx E[e ty for all t 0. (Hint: use the expansion for e x and compare E[X k to E[Y k. Using the Taylor series for e x and linearity of expectation, we can write the MGF of X and Y as: E [ e tx = E [ e ty = 4 i=0 i=0 t i i! E[Xi t i i! E[Y i

Now, we want to compare term-wise, the MGF of X and the MGF of Y. This means that we want to show E[X i E[Y i. Let Z = n Z i be an indicator random variable which is the sum of independent and identically distributed indicators Z i. For example, both X and Y satisfy the properties of Z. Then ( n j E[Z j = E Z i. After expanding out the jth power, we get a sum of terms where each term is a product of various Z i s to powers C i, i.e. Z c i 1 Zc Zcn n. Since the Z i are indicators, each term simplifies to n k Z c i 1 Zc Zcn n = Z I{c i 0} i = Z i, where I{c i 0} indicates the event that c i is positive, and k = n I{c i ne0}. Notice that the last equality follows from the Z i being independent and identically distributed. Notice from this and by application of part (a to each term, we can write ( n j [ n E[X j = E X i = E = [ k E X i [ k E Y i = E[Y j. c=(c 1,...,c n X c i i This proves that for a particular term, i, in the MGF of X and the MGF of Y, the inequality holds. Which means we have shown that E[e tx E[e ty. (c Derive a Chernoff bound for P [X (1 + δe[x. Using Markov s inequality and part (b, we get P[X x = P[e tx e tx E[etX e tx E[et Y e tx. The problem ask for us to set x = (1 + δe[x, and we know that the MGF of Y is upperbounded by e E[Y (et 1 (page 64. Now, we have P[X (1 + δe[x ee[y (et 1 e t(1+δe[x By the problem set-up, we know that E[X = E[Y, since E[X = E[X i = (1 1/n n = E[Y. Because of this, we write Setting t = ln(1 + δ we get ( e (et 1 P[X (1 + δe[x e t(1+δ E[Y ( e δ E[Y P [X (1 + δe[x (1 + δ (1+δ. 5