First match A related question is, as people enter a room one at a time, which one is most likely to be the first to have the same birthday as someone already in the room? That is, for what is maximum? The answer is 20—if there is a prize for first match, the best position in line is 20th.
Same birthday as you In the birthday problem, neither of the two people is chosen in advance. By contrast, the probability that
at least one other person in a room of other people has the same birthday as a
particular person (for example, you) is given by : q(n) = 1 - \left( \frac{365-1}{365} \right)^n and for general by : q(n;d) = 1 - \left( \frac{d-1}{d} \right)^n. In the standard case of , substituting gives about 6.1%, which is less than 1 chance in 16. For a greater than 50% chance that
at least one other person in a roomful of people has the same birthday as
you, would need to be at least 253. This number is significantly higher than : the reason is that it is likely that there are some birthday matches among the other people in the room.
Number of people with a shared birthday For any one person in a group of
n people the probability that he or she shares his birthday with someone else is q(n-1;d) , as explained above. The expected number of people with a shared (non-unique) birthday can now be calculated easily by multiplying that probability by the number of people (
n), so it is: : n\left(1 - \left( \frac{d-1}{d} \right)^{n-1}\right) (This multiplication can be done this way because of the linearity of the
expected value of indicator variables). This implies that the expected number of people with a non-shared (unique) birthday is: : n \left( \frac{d-1}{d} \right)^{n-1} Similar formulas can be derived for the expected number of people who share with three, four, etc. other people.
Number of people until every birthday is achieved The expected number of people needed until every birthday is achieved is called the
Coupon collector's problem. It can be calculated by , where is the th
harmonic number. For 365 possible dates (the birthday problem), the answer is 2365.
Near matches Another generalization is to ask for the probability of finding at least one pair in a group of people with birthdays within calendar days of each other, if there are equally likely birthdays. : \begin{align} p(n,k,d) &= 1 - \frac{ (d - nk -1)! }{ d^{n-1} \bigl(d - n(k+1)\bigr)!}\end{align} The number of people required so that the probability that some pair will have a birthday separated by days or fewer will be higher than 50% is given in the following table: : Thus in a group of just seven random people, it is more likely than not that two of them will have a birthday within a week of each other. :\sum_{k=1}^n q(k-1;d) = n - d + d \left (\frac {d-1} {d} \right )^n This can be seen to equal the number of people minus the expected number of different birthdays. The distribution of the random variable reporting the number of integers to be chosen in order to get exactly repeats (for a constant ) converges to a
chi-distributed random variable as d \to \infty.
Average number of people to get at least one shared birthday In an alternative formulation of the birthday problem, one asks the
average number of people required to find a pair with the same birthday. If we consider the probability function Pr[ people have at least one shared birthday], this
average is determining the
mean of the distribution, as opposed to the customary formulation, which asks for the
median. The problem is relevant to several
hashing algorithms analyzed by
Donald Knuth in his book
The Art of Computer Programming. It may be shown that if one samples uniformly, with replacement, from a population of size , the number of trials required for the first repeated sampling of
some individual has
expected value , where : Q(M)=\sum_{k=1}^M \frac{M!}{(M-k)! M^k}. The function : Q(M)= 1 + \frac{M-1}{M} + \frac{(M-1)(M-2)}{M^2} + \cdots + \frac{(M-1)(M-2) \cdots 1}{M^{M-1}} has been studied by
Srinivasa Ramanujan and has
asymptotic expansion: : Q(M)\sim\sqrt{\frac{\pi M}{2}}-\frac{1}{3}+\frac{1}{12}\sqrt{\frac{\pi}{2M}}-\frac{4}{135M}+\cdots. With days in a year, the average number of people required to find a pair with the same birthday is , somewhat more than 23, the number required for a 50% chance. In the best case, two people will suffice; at worst, the maximum possible number of people is needed; but on average, only 25 people are required An analysis using indicator random variables can provide a simpler but approximate analysis of this problem. For each pair (
i,
j) for k people in a room, we define the indicator random variable
Xij, for 1\leq i \leq j\leq k, by \begin{alignat}{2} X_{ij} & = I \{ \text{person }i\text{ and person }j\text{ have the same birthday} \} \\[10pt] & = \begin{cases} 1, & \text{if person }i\text{ and person }j\text{ have the same birthday;} \\ 0, & \text{otherwise.} \end{cases} \end{alignat} \begin{alignat}{2} E[X_{ij}] & = \Pr \{ \text{person }i\text{ and person }j\text{ have the same birthday} \} = \frac{1}{n}. \end{alignat} Let
X be a random variable counting the pairs of individuals with the same birthday. X =\sum_{i=1}^k \sum_{j=i+1}^k X_{ij} \begin{alignat}{3} E[X] & = \sum_{i=1}^k \sum_{j=i+1}^k E[X_{ij}]\\[8pt] & = \binom{k}{2} \frac{1}{n}\\[8pt] & = \frac{k(k-1)}{2n} \end{alignat} For , if , the expected number of pairs of individuals with the same birthday is ≈ 1.0356. Therefore, we can expect at least one matching pair with at least 28 people. In the
2014 FIFA World Cup, each of the 32 squads had 23 players. An analysis of the official squad lists suggested that 16 squads had pairs of players sharing birthdays, and of these 5 squads had two pairs: Argentina, France, Iran, South Korea and Switzerland each had two pairs, and Australia, Bosnia and Herzegovina, Brazil, Cameroon, Colombia, Honduras, Netherlands, Nigeria, Russia, Spain and USA each with one pair. Voracek, Tran and
Formann showed that the majority of people markedly overestimate the number of people that is necessary to achieve a given probability of people having the same birthday, and markedly underestimate the probability of people having the same birthday when a specific sample size is given. Further results showed that psychology students and women did better on the task than casino visitors/personnel or men, but were less confident about their estimates. ==Partition problem==