ComeçarComece de graça

Comparing the distributions of the normal and binomial for low n

When we flip a lot of coins, it looks like the normal distribution is a pretty close approximation. What about when we flip only 10 coins, each still having a 20% chance of coming up heads? Is the normal still a good approximation?

Este exercício faz parte do curso

Foundations of Probability in R

Ver curso

Instruções do exercício

  • Generate 100,000 draws from the Binomial(10, .2) distribution. Save this as binom_sample.
  • Generate 100,000 draws from the normal distribution that approximates this binomial distribution, using the rnorm() function. Save this as normal_sample.
  • Compare the two distributions with the compare_histograms() function. (Remember that this takes two arguments: the two samples that are to be compared).

Exercício interativo prático

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

# Draw a random sample of 100,000 from the Binomial(10, .2) distribution
binom_sample <-

# Draw a random sample of 100,000 from the normal approximation
normal_sample <- 

# Compare the two distributions with the compare_histograms function
Editar e executar o código