CommencerCommencer gratuitement

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?

Cet exercice fait partie du cours

Foundations of Probability in R

Afficher le cours

Instructions

  • Try answering this question with simulations of 100, 1,000, 10,000, 100,000 trials.
  • Which is the closest to the exact answer?

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# 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
Modifier et exécuter le code