STAT 604: Intro. to Statistical Computing
Prof. David B. Dahl

Homework 5

Collect All Four

Some brands of cold cereal run promotions in which one of four free toys is included in the cereal box. The company encourage consumers to "collect all four." The typical approach is to buy one box at a time and stop as soon as the set is complete. Consider two scenerios: 1. That each toy is equally likely, and 2. That toys have selection probabilities 0.10, 0.25, 0.25, and 0.40. Write an R script named "all-four.R" which conducts a Monte Carlo simulation study to answer the following questions under the two scenerios:

  1. What is the mean number of boxes that a consumer must purchase to get a complete set?
  2. What proportion of consumers will need to purchase 14 boxes or more to complete a set?
In answering the questions, be sure to assess the Monte Carlo error.

Submission

Ensure that your "all-four.R" script runs in less than about 30 seconds and commit to the appropriate place in the repository.