Ignoring leap year and assuming that each of the days in the year is equally likely to be the birthday for a randomly chosen person, the birthday problem in probability is to find the minimum number of persons such that there is a better than % chance of having at least two people with the same birthday. This version of the birthday problem can be viewed as a waiting time problem, i.e. as a problem of randomly selecting people (one at a time) until there is a common birthday in the sample. This problem can also be viewed as an occupancy problem. Consider the days in the year as cells and the selection of a person at random as placing a ball at random into one of the cells. Then the random placement of balls (one at a time) continues until one of the cells has two balls.

This post is to explore the connection between the birthday problem as stated and the wating time occupancy problem. As the sake of completeness, we first state the two problems.

**The Birthday Problem**

Ignoring leap year and assuming that each of the days in the year is equally likely to be the birthday for a randomly chosen person, how many people do we need to choose in order to have a better than % chance of having a common birthday among the selected individuals?

**The Waiting Time Occupancy Problem**

Suppose that balls are placed randomly (one at a time) into cells. The random placing of balls continues until a ball is placed into a cell that already has one ball (i.e. until a “repeat” occurs). Let be the number of balls required to obtain a repeat. Our goal is to discuss the probability function , and the survival function . Of course, we will discuss the connection with the birthday problem.

**Remark**

As we will see, the birthday problem can be restated as finding the median of the random variable in the waiting time occupancy problem with cells. We will show that and .

A more basic version of the occupancy problem works with a fixed number of balls (say balls) and is about randomly placing the balls into cells. In the following two posts in this blog, we discuss this fixed length occupancy problem and present ways to compute the probability that cells are empty where .

The occupancy problem

A formula for the occupancy problem

In the waiting time occupancy problem discussed in this post, we do not fix the number of balls. Instead, we keep placing balls into cells until a certain prescribed condition takes place. So the focus is on the waiting time until the occurence of a certain event. With respect to the occupancy problem, examples of waiting times include the time until a repeat occurs (discussed here), the time until a specified cell is filled and the time until all cells are filled. Some of these waiting time problems will be discussed in subsequent posts.

**Solving the Birthday Problem**

In a random group of people, the following is the probability that all birthdays are different:

Note that for , the probability of having different birthdays is . Thus there is more than % chance of having at least a common birthday among people (). On the other hand, and . Thus among people, the probability of having a common birthday is less than .

**The Discussion of the Waiting Time Occupancy Problem**

In the random assignment of a series of balls (one at a time) into cells, consider the event that the random pacement of balls terminates at the step. This means that the first balls go into different cells and the ball goes into one of the previously occupied cell. The probability of this event is:

Note that the number of ways of assigning balls into distinct cells among cells is . Then there are ways of assigning the ball to the one of the previously assigned cells. Thus the total number of assigning balls in this fashion is:

We now discuss . This is the probability that it takes more than balls to have two balls in the same cell. Consequently, the first balls all go into different cells. When , should agree with the probability stated in above. Thus we have:

The above survival function can also be proven by induction. To find the median of the distribution , we need to find such that:

and

For the birthday problem, . It has been shown in the above solution of the birthday problem that the median is .

**Example**

This is one more example to illustrate the computation. Suppose we roll a fair die repeatedly until a repeat of a previously shown face. Each roll of the die is essentially placing a ball into one of the six cells. Let be the number of rolls to obtain a repeat. The following shows the probability function .

The median number of rolls to achieve a repeat is . Note the following probabilities:

The following shows that the mean number of rolls to achieve a repeat is .

**Reference**

- Feller, W.,
*An Introduction to Probability Theory and its Applications*, Vol. I, 3rd ed., John Wiley & Sons, Inc., New York, 1968