CommencerCommencer gratuitement

Comparing the cumulative density of the binomial

If you flip 1000 coins that each have a 20% chance of being heads, what is the probability you would get 190 heads or fewer?

You'll get similar answers if you solve this with the binomial or its normal approximation. In this exercise, you'll solve it both ways, using both simulation and exact calculation.

Cet exercice fait partie du cours

Foundations of Probability in R

Afficher le cours

Instructions

  • Use the simulated binom_sample (provided) from the last exercise to estimate the probability of getting 190 or fewer heads.
  • Use the simulated normal_sample to estimate the probability of getting 190 or fewer heads.
  • Calculate the exact probability of the binomial being <= 190 with pbinom().
  • Calculate the exact probability of the normal being <= 190 with pnorm().

Exercice interactif pratique

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

# Simulations from the normal and binomial distributions
binom_sample <- rbinom(100000, 1000, .2)
normal_sample <- rnorm(100000, 200, sqrt(160))

# Use binom_sample to estimate the probability of <= 190 heads


# Use normal_sample to estimate the probability of <= 190 heads


# Calculate the probability of <= 190 heads with pbinom


# Calculate the probability of <= 190 heads with pnorm

Modifier et exécuter le code