Probability of Same Birthday An interesting question when you have many people in the same area is whether two of them have the same birthday. It turns out, as this animation will show, that you need only about 23 people to have a 50% chance that two will have the same birthday. To begin, it is clear that when you have just two people, the probability is 1/365. For 3 or more people, the math gets more involved. The equation for the probability is P(p)=1-365!/[(365-p)!365^p] where p is the number of peopled sampled and ! denotes the factorial operation. It is easy to show that P(2) =1/365 as expected. Since computers don't generally provide factorials of numbers as high as 365, one must use Stirling's approximation for these factorials. n!~S(n)=sqrt(2*pi*n)(n/e)^n. Using S(n) to estimate P(p) we obtain the equation P(p)~Ps(p)=[(365/(365-p)^(365-p)]/exp(p)*sqrt[365/(365-p)]. The learner may use the slider to adjust the number of people, p. Also I have provided a numerical calculation of P(p) which uses the computer's random number generator. After pressing the Start button, you can see that this numerical result, Pn(p), slowly converges to the more accurate result Ps(p).
nPeople
Single Step