Hits

set.seed(2022)

simu_times = 10000 ## repeat the program 10000 times
res = rep(NA,simu_times) ### record the results

for ( i in 1:simu_times){
samples <- sample(1:100) #### shuffer the cards
res[i] <- sum(samples==seq(1,100,1)) ###count the number of hits
}

print(paste0(“The expectation of the total number of hits is “, mean(res)))
print(paste0(“The variance of the total number of hits is “, var(res)))

 

 

For any question, please feel free to contact me.

Reminder
OK
作业代写,代写作业,作业辅导,辅导作业,作业问答,美国作业代写,留学生作业,留学生作业代写,数学作业,数学作业代写,统计作业代写,物理作业代写,金融作业代写,大学作业辅导 Keywords: 作业代写 代写作业 作业辅导 辅导作业 作业问答 美国作业代写 留学生作业 留学生作业代写 数学作业 数学作业代写 统计作业代写 物理作业代写 金融作业代写 大学作业辅导