Читать книгу Probability - Robert P. Dobrow - Страница 46

Simulation and R

Оглавление

1 1.53 Modify the code in the R script CoinFlip.R to simulate the probability of getting exactly one head in four coin tosses.

2 1.54 Modify the code in the R script Divisible356.R to simulate the probability that a random integer between 1 and 5000 is divisible by 4, 7, or 10. Compare with your answer in Exercise 49.

3 1.55 Use R to simulate the probability of two rolled dice having values that sum to 8.

4 1.56 Explain what reproducibility means to you in a few sentences.

5 1.57 Use R to simulate the probability in Exercise 1.41 part c.

6 1.58 Use R to simulate the probability in Exercise 1.42.

7 1.59 Make up your own random experiment and write an R script to simulate it. Be sure your results are reproducible.

8 1.60 See the help file for the sample command (type ?sample ). Write a function dice() for generating throws of a fair die. Use your function and R's sum function to generate the sum of two dice throws.

Probability

Подняться наверх