The following problem is called the coupon collector problem and has many applications in computer science. Consider a bag that contains N different types of coupons (say coupons numbered 1 . . .N. There are infinite number of each typ of coupon. Each time a coupon is drawn from the bag, it is independent of the previous selection and equally likely to be any of the N types. Since there are infinite numbers of each type, one can view this as sampling with replacement. Let T denote the random variable that denotes the number of coupons that needs to be collected until one obtains a complete set of atleast one of each type of coupon. Write a R simulation code to compute the E(T). Plot E(T) as for N = 10, 20, 30, 40, 50, 60. In the same plot show the theoretical value and summarize your observation regarding the accuracy of the approximation.
The following problem is called the coupon collector problem and has many applications in computer science.
Consider a bag that contains N different types of coupons (say coupons numbered 1 . . .N. There are
infinite number of each typ of coupon. Each time a coupon is drawn from the bag, it is independent of the
previous selection and equally likely to be any of the N types. Since there are infinite numbers of each type,
one can view this as sampling with replacement. Let T denote the random variable that denotes the number
of coupons that needs to be collected until one obtains a complete set of atleast one of each type of coupon.
Write a R simulation code to compute the E(T). Plot E(T) as for N = 10, 20, 30, 40, 50, 60.
In the same plot show the theoretical value and summarize your observation regarding the accuracy of the
approximation.
Here is an R simulation code to compute the expected value of T, the number of coupons needed to collect a complete set of each type of coupon:
Step by step
Solved in 3 steps