Because randomization is used in this assignment, I set the seed here, in additi
ID: 3054906 • Letter: B
Question
Because randomization is used in this assignment, I set the seed here, in addition to beginning each code block. "Do not change the seed! set.seed(6222016) ## Problem 1 *The data set ?DDT, (**MASS**) contains measurements of the pesticide DOT in kale, in parts per million. Use bootstrapping to estimate a 95% confidence interval for the mean ppm of DDT in kale. Do the same with the standard deviation. Use 2000 replications each. r, echo-FALSE # Seed reset; DO NOT CHANGE THE SEED! set.seed 6222016) r, tidy-TRUE] # Your code hereExplanation / Answer
R-code
par(mar=c(2,3,1,1))
cat("") # clear console
set.seed(6222016)
#Simulate 1000 rolls of a pair of dice, and compute the sum of each pair
iterations <- 1000
dice_sum=sample(1:6,iterations,T)+sample(1:6,iterations,T)
no_7 = length(dice_sum[dice_sum==7])
no_8 = length(dice_sum[dice_sum==8])
cat(" Number of times a roll of 7 occurs = ",no_7, " ")
cat(" Number of times a roll of 8 occurs = ",no_8, " ")
Output
Number of times a roll of 7 occurs = 164
Number of times a roll of 8 occurs = 130
Conclusion
A roll of 7 occurs more number of times(164) than roll of 8 (130)
Roll of 7 is more common
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.