You ask an audience one by one for their birthdays. How many people do you need to ask on average until you get your first overlap?
This sounded to me quite similar to a geometric distribution in terms of number of trials until first success, with the exception that we are sampling without replacement. I googled what the analogue of geometric distribution is for not replacing and came across the negative hyoergeometric distribution. We would presumably want its expectation but I'm not sure how to fit it to my problem or if this is even the right lines to be pursuing.
Answer should be 23.62 with standard deviation 12.91
Edit: on reflection I'm doubting the negative hypergeometric idea even more since whilst I could consider drawing $n$ balls (people) of which $N=1$ are of the right colour (same birthday) and $M=n-1$ are of the wrong colour (different birthday), I can't see how to fit 365 into the problem?
Code attempt (Python):
import numpy as np
u = np.zeros(366)
u[365] = 1
print(u)
for i in range(364,-1,-1):
u[i] = 1 + (1 - i/365)*u[i+1]
print(i, u)
print("Expected number of questions: {}".format(u[0]))
print("Array length: {}".format(len(u)))
print("Standard deviation: {}".format(np.std(u)))
Ouput: Expected number of questions: 24.61658589
Array length: 366
Standard deviation: 4.17342901622
Comments:
1, I notice that I am exactly 1 of the required answer for the expectation. Also, I notice that the u[1] entry in my array is the desired answer. However, I think I am right in having an array of length 366 since we should be going from u[0] to u[366]. Any ideas?
2, I have no idea what is going wrong with the standard deviation???
u
array is not going to give you the standard deviation of the random variable in question. $\endgroup$