In the provious post (The birthday problem as a waiting time occupancy problem), we presented a waiting time occupancy problem. We like to present another example of a waiting time occupancy problem. This time we also use a birthday problem as illustration. Suppose the proprietor of a restaurant decides that free dessert is offered to any customer dining at the restaurant on his or her birthday. On any given day, how long does it have to wait for the first birthday customer to show up? On average how many customers are expected to visit the restaurant until the first free dessert to be awarded? As we will see in this post, the average number of customers until the arrival of the first birthday customer is . For a small restaurant with a daily customer count under three to four hundred, free dessert may not have to be offered at all. We will also show that the median number of customers until the arrival of the first birthday customer is . So if the daily customer count is less than , there is a greater than % chance that a free dessert will not have to be offered. To obtain these results, we ignore leap year and assume that any day of the year is equally likely to be the birthday of a random customer. The results in this post will not hold if the free dessert offer is widely known and many customers come to the restaurant for the purpose of taking advantage of the free dessert offer.
Obviously, this birthday problem is a waiting time problem. We observe the number of customers until the arrival of the first birthday customer. We can also view this as an occupancy problem. The days in the year can be considered as cells. The customer stream can be viewed as a series of balls being randomly placed into the cells. We fix one cell in advance and we keep placing balls into the cells until the a ball is placed into the specified cell. Once a ball reaches the specified cell, we continue to randomly assign balls into the cells. In the restaurant example, after the arrival of the first birthday customer, we continue to observe customers until the arrival of the next birthday customer.
We now discuss the problem in the context of the occupancy problem. There are cells and we keep assigning balls (one at a time) into the cells until a ball is placed into a cell specfied in advance. The random placing of each ball into a cell can be viewed as a Bernoulli trial with probability of success . Success here means a ball reaches the cell specified in advance. Let be the number of trials (placements of balls) until the first success. Then has a geometric distribution with probability of success . We make use of some basic facts about the geometric distribution in discussing the stated birthday problem. Let be any integer greater than and let be the number of trials until the balls are placed into the cell specified in advance. Then has a negative binomial distribution. We will also discuss this fact with respect to the birthday problem at hand.
The Geometric Distribution
A random experiment resulting in two distinct outcomes (success or failure) is called a Bernoulli trial (e.g. coin tosses, whether or not the birthday of a customer is the first of January). Suppose that the probability of success in each trial is and we observe a sequence of Bernoulli trials. Let be the number of Bernoulli trials we observe until a trial resulting in a success. Then has a geometric distribution. The following are some basic facts:
If the first success occurs after trials, then the first trials are all failures. Thus is the same as the probability that there are no successes in the first trials. Thus is as indicated above.
With respect to the occupancy problem, the probability of success (a ball is placed in a cell apecified in advance) is . The above basic facts for the geometric distribution can be restated as follows:
The Negative Binomial Distribution
Suppose that we observe the Bernoulli trials until we have successes where . Let be the number of trials to obtain successes. The random variable follows the negative binomial distribution with parameters and . The following lists some basic facts:
If the success takes place after trials, then there can be at most successes in the first trials. This derives . Note that is the independent sum of many random variables, each of which has a geometric distribution. This fact derives the mean and variance indicated above.
With respect to the occupancy problem at hand, the following restates the basic facts:
Some Observations about the Birthday Problem
The number of arrivals until the first birthday customer has a geometric distribution. For each customer, the probability of success is (the probability that today is his or her birthday). Thus the mean number of customers until we see a birthday customer is . On the other hand, the median number of customers until the first birthday customer is .
Thus, if the number of customers on a given day is less than , there is a greater than % chance that no free dessert will be given out.
If we consider the number of customers until the second birthday customer, the mean is . The median is .
If the birthdays are equally probable across the days in the year and if the arrivals of customers are truly random, then on any given day it may not be easy to find a birthday customer.
One interesting fact about the waiting time until the first birthday customer is that the geometric distribution has the “no memory” property. On a given day, suppose that customers have arrived and there is no birthday customer. Would this mean that it is more likely that there will be a birthday customer in the next customers than at the beginning of the business day? It turns out that the probability of receiving a birthday customer among the next ten customers is the same as the unconditional probability of having a birthday customer in the next ten customers. It is just as likely to have a birthday customer in the next ten customers when customers have arrived as in the case that no customers have arrived. So the fact that customers have arrived makes no difference.
Reference
- Feller, W., An Introduction to Probability Theory and its Applications, Vol. I, 3rd ed., John Wiley & Sons, Inc., New York, 1968
Pingback: Five probability problems to help us think better | Math in the Spotlight