$24
For this lab, we will run some simulations using the statistical software program R. Your solutions should contain clearly identified numerical answers and well labeled tables/figures, where appropriate. Make sure to include clear and concise interpretations (that is, clear full sentences) of any values, figures, and responses to queries posed. Place all code in an appendix, at the end of your solutions document.
1. Refer to the gambler’s dispute of 1654 problems on page 109 of Dobrow (problem 3.5) in which we are trying to find the probability of obtaining at least one “double six” in throwing a pair of dice 24 times. We found that probability to be
(a) Simulate the gambler’s dispute of 1654 and calculate the estimated probability of obtaining at least one “double six” in throwing a pair of dice 24 times. Run this experiment for a simulation size of 1,000 and compute the empirical probability
(b) Compare your estimated probability with the true probability
2. Simulating the Birthday Problem. Recall the birthday problem deals with finding the probability that two people in a group of size k will have the same birth date (assuming no leap years). We wanted to find how many people are needed in order for the probability at least two individuals share a birthday is at least 50%. We found the answer to be 23 by first finding the probability that nobody shares the same birthday and subtracting that from 1.
(a) Simulate the birthday problem and calculate the estimated probability that two people in a group size of 23 will have the same birthday. Run this simulation for 1,000, 10,000, and 50,000 times and compute the proportion of these simulations in which at least one pair of individuals shared the same birthday
(b) Compare each of your empirical proportions against the true proportion of
3. Refer to the dice game on page 168 of Dobrow (problem 4.3) in which you pay $10 to play $10 to play. If you roll a 1, 2, or 3, you lose your money. If you roll a 4 or 5, you get your money back. If you roll a 6, you win $24. Let , the winnings vector for each of the six possible die outcomes.
(a) Simulate the game 1,000 times and present the distribution of your winnings x as a table
x
-10
0
14
f(x) (probability distribution function)
0.479
0.350
0.171
F(x) (cumulative distribution function)
0.479
0.829
1.000
(b) Calculate the sample mean, sample standard deviation, and the sample variance of the winnings from (a)
(c) Compare the mean and the standard deviation from your simulation with the true mean and standard deviation of this dice game.