Question: (I am stuck on this problem) (I got part a) but part b,c,d,e I am lost. How do I code from part b,c,d,e in R
(I am stuck on this problem) (I got part a) but part b,c,d,e I am lost. How do I code from part b,c,d,e in R Studio? Part b ask to use the function Replicate 11.3 (Birthday problem). Suppose you have a class of n students and yo u're interested in the probability that at least two students in the class share the same birthday. If one assumes that each birthday is equally likely from the set sample of size n chosen with replacement from the set 1, 2, , 365)], then collecting birthdays can be viewed as a a. Write a fiunction with argument n that samples n birthdays and computes b. Using the replicate function, repeat this simulation 1000 times for the c. From the output, approximate the probability that there is at least one d. It can be shown that the exact probability of a birthday match is given by the number of unique birthdays observed special case of n 30 students. matching birthday among the 30 birthdays 365 P30 36530 P(match)1- where N Pk is the number of ways of arranging a sample of k of N distinct items. Compare the approximate probability in part (d) with the exact probability. e. The R function pbirthday, with argument n,computes the (approximate probability of at least one match among n birthdays. Use this function to check your answer in part (d)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
