# Randomness Test in Coupon Collecting

This is the coupon collector problem: suppose each package contains a coupon and that there are a certain number of different kinds of coupons. How many packages do you expect to have to open in order to form a complete collection?
The coupon collector randomness test is similar. For example, the packages are the digits of , and the coupons are the digits 0 to 9. How many digits do you expect to have to check before collecting all 10 digits?
This is the first coupon waiting time.
Repeat this process to obtain a sequence of coupon waiting times and compare the mean and distribution of these observed coupon waiting times to their theoretical mean and distribution.
This Demonstration illustrates the coupon collector problem randomness test for initial sequences of digits of famous irrational numbers and rational approximations of . The observed waiting time frequencies are given by the bar chart, and the theoretical frequencies are shown by the solid curve.

### DETAILS

The expected waiting time in the coupon collector problem is given by , where is the number of coupons. For , this is . The theoretical distribution of these waiting times, the probabilities , where is the waiting time, is known and can be explicitly calculated as a finite sum.
To compare the distribution of the theoretical and observed waiting times, apply the chi-squared test with five degrees of freedom after combining the observed waiting time counts into bins [10–19], [20–23], [24–27], [28–32], [33–39], [40–60]. The bins have been chosen to ensure approximately equal distribution of the waiting times.
References
 B. Dawkins, "Siobhan's Problem: The Coupon Collector Revisited," The American Statistician, 45(1), 1991 pp. 76–82. doi:10.1080/00031305.1991.10475772.
 R. E. Greenwood, "Coupon Collector’s Test for Random Digits," Mathematical Tables and Other Aids to Computation, 9(49), 1955 pp. 1–5. doi:10.2307/2002211.

### PERMANENT CITATION

 Share: Embed Interactive Demonstration New! Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details » Download Demonstration as CDF » Download Author Code »(preview ») Files require Wolfram CDF Player or Mathematica.

• Illustrating the Law of Large NumbersMarc Brodie
• Granger-Orr Running Variance TestRoger J. Brown
• Predictive Scores and Ultimate Test PassageSeth J. Chandler
• Generic Random Walk and Maximal Entropy Random WalkBartlomiej Waclaw
• Dice Rolls as an Example of the Coupon Collector's ProblemMichail Bozoudis
• Power Curve of a Mean TestSijia Liang and Bruce Atwood
• One-Sample t-Test and Confidence Interval with Dot Chart in Small SamplesDouglas Woolford and Ian McLeod
• The Number of Fixed Points in a Random PermutationElcio Lebensztayn
• Mean-Reverting Random WalksJason Cawley
• Self-Similarity in Random WalkHiroki Sayama