Question: I. Simulate a binomial random variable. Consider a class with 60 students, and the probability that a student does not turn in a homework is

I. Simulate a binomial random variable. Consider a class with 60 students, and the probability that a student does not turn in a homework is 0.10 (a "success" ). Assume all students are independent of all other students, and the probability does not change. (a) Use sample to simulate drawing 60 students who either do, or do not, turn in their homework, and then find the total (out of 60) who did not turn in their homework. You should return one number, X = total # of students out of 60 who did not turn in their homework. (b) Repeat (a) 1000000 times (you should have 1000000 values for "number of successes", or X"), plot a histogram of your result (do not print out the 1000000 values!!). For this particular binomial distribution, is the distribution symmetric? Explain. (c) Find the average of the number of successes in 60 trials and the standard deviation based on your simulation from part (b). (d) Estimate the probability that all students turned in their homework based on your simulation from (b). (e) Estimate the probability that at least four students did not turn in their homework based on your simulation from part (b). (f) What is the median number of students who will forget their homework based on your simulation from (b)? II. Simulate a Negative Binomial random variable. Consider that 40% of people wear glasses for near-sightedness. (a) Use R to simulate selecting random people until 5 are selected wear glasses. Return one the number of people it took until 5 wore glasses. (b) Repeat (a) 20000 times, so that you should have 20000 values of how many people were were selected until 5 wore glasses. Do not print out these values!!! Plot a histogram of these values. (c) Find the median of the vector from (b). (d) Find the mean and standard deviation of your vector from (b). (e) Find the probability we had to sample more than 10 people before we found 5 that needed glasses. (f) Find the probability that if it takes more than 10 people, it will an additional 5 to find 5 that wore glasses
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
