Varying the number of trials
In the last exercise you tried flipping ten coins with a 30% probability of heads to find the probability at least five are heads. You found that the exact answer was 1 - pbinom(4, 10, .3) = 0.1502683, then confirmed with 10,000 simulated trials.
Did you need all 10,000 trials to get an accurate answer? Would your answer have been more accurate with more trials?
Latihan ini adalah bagian dari kursus
Foundations of Probability in R
Petunjuk latihan
- Try answering this question with simulations of 100, 1,000, 10,000, 100,000 trials.
- Which is the closest to the exact answer?
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
# Here is how you computed the answer in the last problem
mean(rbinom(10000, 10, .3) >= 5)
# Try now with 100, 1000, 10,000, and 100,000 trials