SEARCH THIS BLOG :-)

Friday, 18 December 2015

The Birthday Problem :-)


The Birthday Problem :-) 

Question: What are the chances or what is the probability that two people in a room of say $30$ people have their birthday on the same day of the year?

Firstly let's assume 365 days in a year (ignoring leap years) and that birthdays are equally likely on all days (which isn't actually entirely true)

Let's start by adding people to the room. 

Suppose there are two people in the room, how many possible combinations are there for their two birthdays. 
There are $365 \times 365$ possible combinations. Specifically, $$1\, 1, 1\, 2, 1 \,3, \ldots1 \,365, 2 \,1, 2 \,2, \ldots, 2\, 365, \ldots,365\,1, 365\,2 \ldots 365\, 365$$
How many of these combinations have different birthdays? There are $365\times 364$ possible combinations where the two birthdays are different.

Therefore the probability that two birthdays are different is $$\displaystyle{365\times 364 \over  365^2}$$
Hence the probability that the two birthdays are the same is thus $$P=\displaystyle 1-{365\times 364 \over 365^2} = 0.002739... \approx 0.3\%$$ 
There is an easier way to look at it for 2 people, but I am setting up the general case! So now let's assume there are $n$ people in the room!, where $n$ is a whole number. 

The number of possible combinations where everyone in the room have different birthdays is
$$365\times 364\times 363\times \ldots $$ 
where there are $n$ terms in the product.
In mathematics this is the number of combinations where order counts of $n$ objects from $365$, which has symbol 
$$\displaystyle ^{365}P_n$$

The probability of no two people in the room having the same birthday is then
$$\displaystyle{^{365}P_n\over 365^n}$$Therefore the probability of at least two people in the room having the same birthday is
$$P(n)=\displaystyle 1 - {^{365}P_n \over 365^n}$$

The graph of the plot of probability $P$ against $n$ follows. 
From the graph I can approximately read that the probability of two people having the same birthday in a room of $15$ people is about $25\%$.

Using the equation directly,
$$P(15)=\displaystyle 1 - {^{365}P_{15} \over 365^{15}}=0.2529=0.25\,\mbox{(2 d.p.)}$$
A popular result occurs when the number of the people in the room is $23$ as then the probability of two people with the same birthday is over $50\%$! So if you're a betting man, let the betting begin! Its a good party trick as this sort of probability is counter intuitive, the probability of two people having the same birthdays is much higher than we think.
From the graph you can see if $n=23$ the probability is about $50\%$ and verifying the formula we have,
$$P=\displaystyle 1 - {^{365}P_{23} \over 365^{23}}=0.50729...=0.51\,\mbox{(2 d.p.)}$$
My favorite is that when $n=60$ or so, the probability of two people having the same birthday is about $99.4\%$ or as a decimal $0.994$ which incidentally rounds to $0.99$ correct to $2$ decimal places,$$P=\displaystyle 1 - {^{365}P_{60} \over 365^{60}}=0.994122...=0.99\,\mbox{(2 d.p.)}$$
What does that mean? Well it means in a room with $60$ guests its pretty much a dead certainty that at least two people will have the same birthday! It's time to rope your friends into a bet you can't really lose, but they don't know it!

And finally I almost forgot to answer my initial question. Just put $n=30$,
$$P=\displaystyle 1 - {^{365}P_{30} \over 365^{30}}=0.7063...=0.71\,\mbox{(2 d.p.)}$$

The chance of two people having the same birthday in a room with $30$ people is about $71\%$.

Have a great day!
Jan Hansen 2015 :-)

2 comments:

  1. By the way, finding the probability of three people in a room with the same birthday out of 30 people is a more difficult problem, and doesnt have a nice solution.

    ReplyDelete
  2. This seems to link to an answer.
    http://math.stackexchange.com/questions/25876/probability-of-3-people-in-a-room-of-30-having-the-same-birthday

    ReplyDelete