Question: 2. [Almost Birthday Problem The almost birthday problem concerns the probability that, in a class of N randomly chosen university students, some pair of them

 2. [Almost Birthday Problem The "almost birthday problem" concerns the probability

2. [Almost Birthday Problem The "almost birthday problem" concerns the probability that, in a class of N randomly chosen university students, some pair of them will have a birth date within one day of each other When this occurs we call it a "birthday fest". For the purposes of this question we assume that there are 365 possible birthdays each of which are equally likely. (That is, we ignore the existence of leap years.) Our aim here will be to estimate the probability of a "birthday fest" for classes of varying size N. We will do this by randomly generating a large number of classes for each N value, and then counting the number such classes that have birthday pairs. Your tasks are as follows: (a) For N10, generate 1000 classes and count the fraction of these classes which a "birthday fest". Print the fraction of classes which have a "birthday fest". (Note: Each class is a list of N integers, sampled, with replacement, from the integers 1 to 365. You will find the R functions sample.int, length and unique useful for this purpose.) (b) Extend your answer to part (a) so that it calculates and stores the fraction of classes (c) Plot the "birthday-fest fraction against class size N. (Note: plot with the option (d) Determine the smallest number of people necessary to have a "birthday-fest fraction" which contain a "birthday fest for each class size from 1 to 50. type-"1" ("ell", not "one") may be useful here.) that is greater than 0.5. That is, determine the smallest class size such that it is more likely than not that two students have a birth date within one day of each other 2. [Almost Birthday Problem The "almost birthday problem" concerns the probability that, in a class of N randomly chosen university students, some pair of them will have a birth date within one day of each other When this occurs we call it a "birthday fest". For the purposes of this question we assume that there are 365 possible birthdays each of which are equally likely. (That is, we ignore the existence of leap years.) Our aim here will be to estimate the probability of a "birthday fest" for classes of varying size N. We will do this by randomly generating a large number of classes for each N value, and then counting the number such classes that have birthday pairs. Your tasks are as follows: (a) For N10, generate 1000 classes and count the fraction of these classes which a "birthday fest". Print the fraction of classes which have a "birthday fest". (Note: Each class is a list of N integers, sampled, with replacement, from the integers 1 to 365. You will find the R functions sample.int, length and unique useful for this purpose.) (b) Extend your answer to part (a) so that it calculates and stores the fraction of classes (c) Plot the "birthday-fest fraction against class size N. (Note: plot with the option (d) Determine the smallest number of people necessary to have a "birthday-fest fraction" which contain a "birthday fest for each class size from 1 to 50. type-"1" ("ell", not "one") may be useful here.) that is greater than 0.5. That is, determine the smallest class size such that it is more likely than not that two students have a birth date within one day of each other

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!