Question: Develop a version of getCoupon() that better models the situation when one of the coupons is rare: choose one of the n values at random,
Develop a version of getCoupon() that better models the situation when one of the coupons is rare: choose one of the n values at random, return that value with probability 1 /(1,000n), and return all other values with equal probability. Extra credit : How does this change affect the expected number of coupons that need to be collected in the coupon collector problem?
Step by Step Solution
3.38 Rating (157 Votes )
There are 3 Steps involved in it
To address this question we first need to revise the getCoupon function to meet the new requirements ... View full answer
Get step-by-step solutions from verified subject matter experts
