The Birthday problem.

In a random room of people, there is some probability that two of them share a birthday. As it turns out, it doesn’t take very many people for the probability to rise to a significant level. With 23 people, there’s a 50% chance that two of them have the same birthday.

Use R to verify this!

I want a script that will generate a table giving the probability that a group of \(n\) random people includes at least two people sharing the same birthday. For simplicity, assume birthdays are uniformly distributed and there are no leap years. Extra credit if you can also generate the probabilities to account for leap years.

hint: Don’t spend too much time thinking about months. It’s much simpler if you think of February 1st as the 32nd day of the year.