How many days with birthdays are in a classroom?

70 Views Asked by At

Assumption:

I am a teacher of a classroom with n students. And every time there is one or more birthdays in a day, I will buy only a cake.

Question:

How many cakes do I have to buy on average every year?

Extra info:

In a different question in this forum (The birthday-cake problem: a variation on the birthday problem), the solution is given as Solution=365−365(364/365)^n but because the question was different, the solution is not explained. I need an explanation or a reference to learn more about it.

Thanks in advance

2

There are 2 best solutions below

0
On BEST ANSWER

Choose a particular day. The chance a given student does not have a birthday on that day is $\frac{364}{365}$. The chance all the students do not have birthdays on that day is $\left(\frac{364}{365}\right)^n$ so the chance that at least one student has a birthday on that day is $1-\left(\frac{364}{365}\right)^n$. The chance is the same for every day, so the expected number of days that you buy cakes is $365\left(1-\left(\frac{364}{365}\right)^n\right)$. If you only buy cakes on school days, change the leading $365$ to the number of school days per year.

3
On

The probability that a fixed day is not a birthday is (assuming independence) $$ \left(1-\frac{1}{365}\right)^n=\left(\frac{364}{365}\right)^n $$ since we multiply the probabilities for each of the $n$ students. So the expected number of days that are not birthdays is $$ 365\times \left(\frac{364}{365}\right)^n $$ which gives the expected number of days that are birthdays as $$ 365-365\left(\frac{364}{365}\right)^n $$ matching the answer you quoted.