Question: Write a script in R that computes the probability that two or more students have a same birthday for either of the following cases. (a)

 Write a script in R that computes the probability that two

Write a script in R that computes the probability that two or more students have a same birthday for either of the following cases. (a) For a class of 26 students (b) For a class of N students, where N is specified once in the beginning of the code, or inputted by the user. Next, you will write a code to simulate multiple classrooms. Assume that each classroom has 26 students. Additionally, each student has an equally likely chance of having one of the 365 birthdays. (a) Let N = 100 be the number of classrooms (ie. You are sampling 100 random classrooms of 26 students.) Record the number of classrooms, out of 100, in which there are two or more students who share a birthday. Find the proportion of the classrooms in which there are two or more students who share a birthday. (b) Repeat (a) for 500, 1000 and 2000 classrooms. (c) Summarize the results from Problem 3 in a table and with complete sentences (typed). Include your codes in your write-up

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!