# A probability question: Birthday Holiday

- New labor laws just passed from the parliement of Wakanda and now all the factories in the country are required to give every worker a holiday whenever
**any one**of them has a birthday and to hire without discrimination on grounds of birthdays - Except for these holidays, they work a 365-day year
*You are a statistician hired by the biggest factory in the country. They ask you to find the best number of workers they should hire to maximize their yearly man-hours. What do you tell them?*

**Solution:**

Let's say that the factory only has 1 worker. This means that it would have $364 \times 1$ man days. But if there are 2 workers there are 2 possible cases. If their birthdays coincides, there would be $364 \times 2$ man days. If not $363 \times 2=726$ man days. But if increase number of workers too much almost certainly everyday of the year will be holiday. So there should be sweet spot.

$n$: number of workers

$N$: number of days in year (of course 365 for a year but let's generalize the solution

Let's think about the first day. The expected number of man days for the first day is :

$E(first day) = n \times (\frac{N-1}{N})^n \times 1 + n \times (1- (\frac{N-1}{N})^n ) \times 0 = n \times (\frac{N-1}{N})^n $

This is true for every day in the year thus expected man days in year:

$E(year) = N \times n \times (\frac{N-1}{N})^n$

So now let's find the best value for n which I will call $n^*$ :

By taking the derivative:

$ N \times ((\frac{N-1}{N})^n + n \times ln(\frac{N-1}{N}) \times (\frac{N-1}{N})^ n) = 0 $

Thus:

$ 1 + n \times ln(\frac{N-1}{N}) = 0$

Thus:

$n^* = \frac{-1}{ln(\frac{N-1}{N})}$

Since N=365 for our problem:

$n ^ * = 364.50 $

So the optimum n is either 364 or 365.

*I found about this problem while reading the book "*Fifty Challenging Problems in Probability with Solutions" by Frederick Mosteller