Repeating the Experiment Thousands of Times


"In a basket we have m x k fortune cookies there are m each of k different fortunes, how many cookies we have to eat to have a 50/50 chance of reading all the fortunes?"

Let P[f; k, m, x] denote the probability that a sample of x cookies (from your specified basket) contains f different fortunes. To estimate P[f; k, m, x] we simply need to repeat the experiment we carried out before, say T times, then count the number of times that exactly f fortunes were read. That number divided by T is your estimate E[f;k,m,x] for the probability P[f; k, m, x] .

Below is an applet which will allow you to get an accurate estimate for this probability by allowing you to repeat the experiment thousands of times. The time it takes for the computer to eat the x cookies is so small that it carries out a thousand repetitions in seconds. You may even enter T=10000 if you wish. To help visualize your findings the applet will plot for you the estimate E[f;k,m,x] as a function of f, as f varies from 1 to k.