Question: I'm currently working on this problem using R studio: Refer to the gambler's dispute of 1654 problem on page 109 of Dobrow (problem 3.5) in
I'm currently working on this problem using R studio: Refer to the gambler's dispute of 1654 problem on page 109 of Dobrow (problem 3.5) in which
we are trying to nd the probability of obtaining at least one "double six" in throwing a pair
of dice 24 times. We found that probability to be
P(at least 1 double six) = 1 (35/36)^24= .4914
(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
And I put the following code into my R terminal:
n <- 0
success <- 0
for (i in 1:n){
x <- replicate(24, sample(2:12, 1, replace = TRUE))
if(12%in%x==TRUE){
success <- success + 1
}
}
But it's giving me a very weird probability, would you show me the correct code I need and how to do it?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
