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
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.