CS 574: Randomized Algorithms Lecture 5. Coupon Collector Problems - - PowerPoint PPT Presentation

cs 574 randomized algorithms
SMART_READER_LITE
LIVE PREVIEW

CS 574: Randomized Algorithms Lecture 5. Coupon Collector Problems - - PowerPoint PPT Presentation

CS 574: Randomized Algorithms Lecture 5. Coupon Collector Problems September 8, 2015 Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms Coupon Collector n types of coupons in cereal boxes,each time you purchase a cereal box,


slide-1
SLIDE 1

CS 574: Randomized Algorithms

Lecture 5. Coupon Collector Problems September 8, 2015

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-2
SLIDE 2

Coupon Collector

n types of coupons in cereal boxes,each time you purchase a cereal box, one coupon is picked at random. How many boxes

  • ne has to buy before picking all coupons?

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-3
SLIDE 3

Coupon Collector

n types of coupons in cereal boxes,each time you purchase a cereal box, one coupon is picked at random. How many boxes

  • ne has to buy before picking all coupons?

m is the number of cereal boxes. We want to bound the probability that m exceeds a certain number and we still did not pick all coupons.

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-4
SLIDE 4

Coupon Collector

n types of coupons in cereal boxes,each time you purchase a cereal box, one coupon is picked at random. How many boxes

  • ne has to buy before picking all coupons?

m is the number of cereal boxes. We want to bound the probability that m exceeds a certain number and we still did not pick all coupons. We now show a weak bound using Chebyshev, stronger bounds later.

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-5
SLIDE 5

Coupon Collector

n types of coupons in cereal boxes,each time you purchase a cereal box, one coupon is picked at random. How many boxes

  • ne has to buy before picking all coupons?

m is the number of cereal boxes. We want to bound the probability that m exceeds a certain number and we still did not pick all coupons. We now show a weak bound using Chebyshev, stronger bounds later. Show that for an r.v. Y with geom(p) distribution, E(Y ) = 1

p

and Var(Y ) = (1−p)

p2 .

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-6
SLIDE 6

Coupon Collector

n types of coupons in cereal boxes,each time you purchase a cereal box, one coupon is picked at random. How many boxes

  • ne has to buy before picking all coupons?

m is the number of cereal boxes. We want to bound the probability that m exceeds a certain number and we still did not pick all coupons. We now show a weak bound using Chebyshev, stronger bounds later. Show that for an r.v. Y with geom(p) distribution, E(Y ) = 1

p

and Var(Y ) = (1−p)

p2 .

For any t that Pr[#boxes ≥ n log n + n + t · n π √ 6 ] ≤ 1 t2

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-7
SLIDE 7

Coupon Collector

n types of coupons in cereal boxes,each time you purchase a cereal box, one coupon is picked at random. How many boxes

  • ne has to buy before picking all coupons?

m is the number of cereal boxes. We want to bound the probability that m exceeds a certain number and we still did not pick all coupons. We now show a weak bound using Chebyshev, stronger bounds later. Show that for an r.v. Y with geom(p) distribution, E(Y ) = 1

p

and Var(Y ) = (1−p)

p2 .

For any t that Pr[#boxes ≥ n log n + n + t · n π √ 6 ] ≤ 1 t2 Can you cast it in Balls-in-Bins framework?

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-8
SLIDE 8

Coupon Collector

n types of coupons in cereal boxes,each time you purchase a cereal box, one coupon is picked at random. How many boxes

  • ne has to buy before picking all coupons?

m is the number of cereal boxes. We want to bound the probability that m exceeds a certain number and we still did not pick all coupons. We now show a weak bound using Chebyshev, stronger bounds later. Show that for an r.v. Y with geom(p) distribution, E(Y ) = 1

p

and Var(Y ) = (1−p)

p2 .

For any t that Pr[#boxes ≥ n log n + n + t · n π √ 6 ] ≤ 1 t2 Can you cast it in Balls-in-Bins framework?

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-9
SLIDE 9

Coupon Collector, Revisited

What is the probability that the i-th coupon was not picked the first r trials? (event Ei r)

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-10
SLIDE 10

Coupon Collector, Revisited

What is the probability that the i-th coupon was not picked the first r trials? (event Ei r) Stronger bound than before: Pr[X > βn log n] ≤ n−β+1.

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-11
SLIDE 11

Coupon Collector, Revisited

What is the probability that the i-th coupon was not picked the first r trials? (event Ei r) Stronger bound than before: Pr[X > βn log n] ≤ n−β+1.We can do even better concentration for the probability that X deviates from its expectation nHn by cn.

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-12
SLIDE 12

Coupon Collector, Revisited

What is the probability that the i-th coupon was not picked the first r trials? (event Ei r) Stronger bound than before: Pr[X > βn log n] ≤ n−β+1.We can do even better concentration for the probability that X deviates from its expectation nHn by cn. Theorem Let the random variable X denote the number of trials for collecting each of the n types of coupons. Then, for any constant c ∈ R, and m = n ln n + cn, we have lim

n→∞ Pr[X > m] = 1 − exp(−e−c)

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-13
SLIDE 13

Coupon Collector, Revisited

What is the probability that the i-th coupon was not picked the first r trials? (event Ei r) Stronger bound than before: Pr[X > βn log n] ≤ n−β+1.We can do even better concentration for the probability that X deviates from its expectation nHn by cn. Theorem Let the random variable X denote the number of trials for collecting each of the n types of coupons. Then, for any constant c ∈ R, and m = n ln n + cn, we have lim

n→∞ Pr[X > m] = 1 − exp(−e−c)

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-14
SLIDE 14

How many cereal boxes and the Poisson Heuristic

Observe that as c goes from large positive to large negative value, the probability goes from almost 1 to almost 0. So if you have collected almost n log n cereal boxes, don’t give up!

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-15
SLIDE 15

How many cereal boxes and the Poisson Heuristic

Observe that as c goes from large positive to large negative value, the probability goes from almost 1 to almost 0. So if you have collected almost n log n cereal boxes, don’t give up! We will prove an approximate version of that, using Poisson approximation.

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-16
SLIDE 16

How many cereal boxes and the Poisson Heuristic

Observe that as c goes from large positive to large negative value, the probability goes from almost 1 to almost 0. So if you have collected almost n log n cereal boxes, don’t give up! We will prove an approximate version of that, using Poisson approximation.

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-17
SLIDE 17

Poisson Heuristic

Ni r is number of times coupon i i selected the first r trials. Follows Binomial(r, p = 1/n).

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-18
SLIDE 18

Poisson Heuristic

Ni r is number of times coupon i i selected the first r trials. Follows Binomial(r, p = 1/n). Pr[Ni r = x] = r

x

  • px(1 − p)r−x.

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-19
SLIDE 19

Poisson Heuristic

Ni r is number of times coupon i i selected the first r trials. Follows Binomial(r, p = 1/n). Pr[Ni r = x] = r

x

  • px(1 − p)r−x.

An rv. Y follows Poison with parameter λ if Pr[Y = x] = λye−λ

y!

.

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-20
SLIDE 20

Poisson Heuristic

Ni r is number of times coupon i i selected the first r trials. Follows Binomial(r, p = 1/n). Pr[Ni r = x] = r

x

  • px(1 − p)r−x.

An rv. Y follows Poison with parameter λ if Pr[Y = x] = λye−λ

y!

. Poisson(λ = rp) ≈ Binomial(r, p).

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-21
SLIDE 21

Poisson Heuristic

Ni r is number of times coupon i i selected the first r trials. Follows Binomial(r, p = 1/n). Pr[Ni r = x] = r

x

  • px(1 − p)r−x.

An rv. Y follows Poison with parameter λ if Pr[Y = x] = λye−λ

y!

. Poisson(λ = rp) ≈ Binomial(r, p). Now the events Ei r almost independent.

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-22
SLIDE 22

Class Assignment: Overview of Techniques

Unbalancing lights: Consider a square n × n array of lights (see Figure on board). There is one switch corresponding to each row and each column (i.e., 2n switches). Throwing a switch changes the state of all the lights in the corresponding row or column. We now consider the problem of setting the switches so as to maximize the number of lights that are ON, starting from an arbitrary configuration of switches. You need to show the following claim: Claim For any initial configuration of the lights, there exists a setting of the switches for which the number of lights that are on is asymptotically n2 2 +

  • 1

2πn3/2

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms

slide-23
SLIDE 23

Class Assignment: Overview of Techniques

Unbalancing lights: Consider a square n × n array of lights (see Figure on board). There is one switch corresponding to each row and each column (i.e., 2n switches). Throwing a switch changes the state of all the lights in the corresponding row or column. We now consider the problem of setting the switches so as to maximize the number of lights that are ON, starting from an arbitrary configuration of switches. You need to show the following claim: Claim For any initial configuration of the lights, there exists a setting of the switches for which the number of lights that are on is asymptotically n2 2 +

  • 1

2πn3/2 As an intermediate step, show that in expectation we achieve about n2

2 + O(n) lights on.

Lecture 5. Coupon Collector Problems CS 574: Randomized Algorithms