1. 学习
  2. /
  3. 课程
  4. /
  5. Foundations of Probability in R

Connected

练习

Using replicate() for simulation

Use the replicate() function to simulate 100,000 trials of waiting for the first heads after flipping coins with 20% chance of heads. Plot a histogram of this simulation by calling qplot().

说明

100 XP
  • Use replicate() to simulate 100,000 geometric trials. Copy and paste the expression given to you as your second argument to replicate().
  • Plot a histogram by calling qplot() on the replications.