Example 4.27. The Birthday Problem. Suppose that there are n people together in a room. Each person announces the date of his/her birthday in turn. The question is: what is the probability of at least one match? If we let the event A represent {there is at least one match},then would like to know P(A), but as we will see ,it is more convenient to calculate P(A^C ).
For starters we will ignore leap years and assume that there are only 365 days in a year. Second, we will assume that births are equally distributed over the course of a year (which is not true due to all sorts of complications such as hospital delivery schedules). See http://en.wikipedia.org/wiki/Birthday_problem for more.
Let us next think about the sample space. There are 365 possibilities for the first person’s birthday.365 possibilities for the second .and so forth. The total number of possible birthday sequences is therefore#(S)=365n.
Now we will use the complementation trick we saw in Example 4.11.We realize that the only situation in which A does not occur is if there are no matches among all people in the room. That is , only when everybody’s birthday is different.so
P(A)=1-P(Ac)=1-(〖#(A〗^c))/(#(S))
Since the outcomes are equally likely. Let us then suppose that there are no matches. The first person has one of 365 possible birthdays. The second person must not match the first , thus , the second person has only 364 available birthdays from which to choose. Similarly , the third person has only 363 possible birthdays, and so forth , until we reach the nth person. Who has only 365-n+1 remaining possible days for a birthday. By the Multiplication Principle, we have # (Ac)=365 ∙364∙∙∙(365-n+1), and
P(A)= 1-(365 ∙364∙∙∙(365-n+1))/〖365〗^n =1-364/365∙363/365∙∙∙((365-n+1))/365
As a surprising consequence ,consider this : how many people does it take to be in the room so that the probability of at least one match is at least 0.50? Clearly , if there is only n=1 person in the room then the probability of a match is zero, and when there are n=366 people in the room
*******************************กราฟ*************************************
There is a 100% chance of a match (recall that we are ignoring leap yeas). So how many people does it take so that there is an equal chance of a match and no match?
When I have asked this question to students, the usual response is “somewhere around n=180 people” in the room. The reasoning seems to be that in order to get a 50% chance of a match, there should be 50% of the available days to be occupied. The number of students in a typical classroom is 25, so as a companion question I ask students to estimate the probability of a match when there are n=25 students in the room. Common estimates are a 1%, or 0.5%, or even 0.1% chance of a match. After they have given their estimates, we go around the room and each student announces their birthday. More often than not, we observe a match in the class ,to the students’ disbelief.
Student are usually surprised to hear that, using the formula above, one needs only n=23 student to have a greater than 50% chance of at least one match. Figure 4.5.1 shows a graph of the birthday probabilities: