The R command > sample(1:365,23,replace=T) simulates birthdays from a group of 23 people. The expression > 2

Question:

The R command
> sample(1:365,23,replace=T)

simulates birthdays from a group of 23 people. The expression
> 2 %in% table(sample(1:365,23,replace=T))
can be used to simulate the birthday problem. It creates a frequency table showing how many people have each birthday, and then determines if two is in that table; that is, whether two or more people have the same birthday. Use and suitably modify the expression for the following problems.
(a) Simulate the probability that two people have the same birthday in a room of 23 people.
(b) Estimate the number of people needed so that the probability of a match is 95%.
(c) Find the approximate probability that three people have the same birthday in a room of 50 people.
(d) Estimate the number of people needed so that the probability that three people have the same birthday is 50%.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: