ComeçarComece de graça

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.

Este exercício faz parte do curso

Foundations of Probability in R

Ver curso

Instruções do exercício

  • 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().

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# 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

Editar e executar o código