
Marina P.
asked 11/22/16Find the probability that among 25 randomly selected people, at least 2 have the same birthday
For the above classic birthday problem, a simulation begins by representing birthdays by integers from 1- 365, where 1 represents January 1st and so on. Randomly generate 20 different groups of 25 birthdays. Use the result to estimate the probability that among 25 randomly selected people, at least 2 have the same birthday.
More
1 Expert Answer

David W. answered 11/23/16
Tutor
4.7
(90)
Experienced Prof
The Classic Birthday Problem:
The givens and the perspective:
(1) In the room, there are 25 people (no twins) who have independent birthdays.
(2) Assume the 365 days in each year have an equal (uniform) probability that each day could be the birthdate for a person (p=1/365 for each day).
(3) Now, restate the problem from the perspective of the calendar dates. As you select people from the room, how likely is it that the remaining people in the room have unique birthdates (note: the probability that at least two of them share a birthdate is 100% minus this value).
Solution:
For each person selected (and date eliminated), the number of open dates is one less. So, for only two people in a room, the probability that they share a birthdate is (1 – probability of unique birthdays)
P1 = 1 - (365/365)*(364/365).
For just three people in a room, the probability that at least two share a birthdate is
P2 = 1 - (365/365)*(364/365)*(363/365).
. . .
For 25 people in a room, the probability that at least two of them share a birthdate is
P25 = 1 - (365/365)*(364/365)*(363/365)*(362/365)* … *(341/365) [note: 25 ratios]
P25 = 0.5687
The 50% probability is first exceeded with only 23 people in the room (P=0.5073). Perhaps surprisingly, 99% probability is achieved with only 57 people in the room. When the room holds 366 people, there must be a duplicate birthday!
(1) In the room, there are 25 people (no twins) who have independent birthdays.
(2) Assume the 365 days in each year have an equal (uniform) probability that each day could be the birthdate for a person (p=1/365 for each day).
(3) Now, restate the problem from the perspective of the calendar dates. As you select people from the room, how likely is it that the remaining people in the room have unique birthdates (note: the probability that at least two of them share a birthdate is 100% minus this value).
Solution:
For each person selected (and date eliminated), the number of open dates is one less. So, for only two people in a room, the probability that they share a birthdate is (1 – probability of unique birthdays)
P1 = 1 - (365/365)*(364/365).
For just three people in a room, the probability that at least two share a birthdate is
P2 = 1 - (365/365)*(364/365)*(363/365).
. . .
For 25 people in a room, the probability that at least two of them share a birthdate is
P25 = 1 - (365/365)*(364/365)*(363/365)*(362/365)* … *(341/365) [note: 25 ratios]
P25 = 0.5687
The 50% probability is first exceeded with only 23 people in the room (P=0.5073). Perhaps surprisingly, 99% probability is achieved with only 57 people in the room. When the room holds 366 people, there must be a duplicate birthday!
Simulation:
Note that a PSEUDO-RANDOM NUMBER generator is used.
"Randomly generate 20 different groups of 25 birthdays. Use the result ..." means
Do this 20 times and store resulting counter
Generate a group of 25 birthdays (that is, 25 random integers)
Determine whether any two or more of them is the same
Set a counter to 0
For each birthday
For each remaining birthday [note: previous are already considered]
If this birthday = remaining birthday THEN increment counter
Next remaining birthday
Next birthday
Store resulting counter in an array
End Do
"Use the result to estimate the probability" means
Count the non-zero counters
[in the array of counters; these groups had multiple birthdays]
Set counter to 0
For 20 array elements
If array element <> 0 Then increment counter
End For
Output this counter
Now, note the difference between (1) Theoretical Probability (the mathematical value obtained in the "Solution" above), the Simulated Probability (from running this computer program), and (3) the Experimental Probability (from actually asking "people in a room"). The Simulated Probability and the Experimental Probability change each time. But -- with many, many of these simulations or experiments, we expect then to approach the Theoretical Probability.
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
Kenneth S.
11/22/16