probability question ("birthday paradox")

Paul Halmos asked this question in his "automathography", I Want to Be a Mathematician, and solved it as follows:

In other words, the problem amounts to this: find the smallest $n$ for which $$\prod_{k=0}^{n-1} \left(1-\frac{k}{365}\right) \lt \frac{1}{2}.$$

The indicated product is dominated by

$$\frac{1}{n} \sum_{k=0}^{n-1} \left(1-\frac{k}{365}\right)^n \lt \left(\frac{1}{n} \int_0^n \left(1-\frac{x}{365}\right)\mathrm dx\right)^n = \left(1- \frac{n}{730}\right)^n \lt e^{-n^2/730}.$$

The last term is less than $1/2$ if and only if $n \gt \sqrt{730 \log 2} \approx 22.6.$

Hence $n=23$.


$\displaystyle{p(n) = 1 - \left(\frac{364}{365}\right)^{C(n,2)} = 1 - \left(\frac{364}{365}\right)^{n(n-1)/2} }$

Sorry if my latex is not right.

The big trick with most prob questions is to ask what is the prob if it doesn't happen.

So you take 1 (total sample space) - P(not your birthday) = P(share your birthday)

Because P(A) = 1- not(P(A)).

so there are 364 days that are not your birthday, and the total number of days is 365. Thus 364/365 is the prob of not(P(A)).

Now the C(n,2) comes from the pairs (two people having the same birthday)

so your answer is $\left(\frac{364}{365}\right)^{n(n-1)/2} = .5$

solve for n, and from Maple 22.98452752.