Question 19.27

19.27 The birthday problem. A famous example in probability theory shows that the probability that at least two people in a room have the same birthday is already greater than 1-in-2 when 23 people are in the room. The probability model is

  • The birth date of a randomly chosen person is equally likely to be any of the 365 dates of the year.

  • The birth dates of different people in the room are independent.

To simulate birthdays, let each three-digit group in Table A stand for one person’s birth date. That is, 001 is January 1 and 365 is December 31. Ignore leap years and skip groups that don’t represent birth dates. Use line 139 of Table A to simulate birthdays of randomly chosen people until you hit the same date a second time. How many people did you look at to find two with the same birthday?

With a computer, you could easily repeat this simulation many times. You could find the probability that at least two out of 23 people have the same birthday, or you could find the expected number of people you must question to find two with the same birthday. These problems are a bit tricky to do by math, so they show the power of simulation.