Using R how do you code this? ## Problem 4 *Consider flipping a fair coin $n$ ti
ID: 3179953 • Letter: U
Question
Using R how do you code this?
## Problem 4 *Consider flipping a fair coin $n$ times and counting the number of time the coin lands heads-up. This is a binomial random variable, but it turns out that as $n$ gets large, this distribution can be approximated with a Normal distribution, where the mean is $0.5 imes n$ and the standard deviation is $0.5 imes sqrt{n}$. We know this thanks to the central limit theorem. When flipping 3, 5, and 20 times, plot the pmf of the binomial random variable with the appropriate parameters (you may use my function `plot_pmf()` from the lecture notes). Superimpose on each of these plots the density curve of the Normal distribution with the appropriate parameters (use the `lines()` function to do so; an example for doing this is in the lecture notes). What do you notice? When does the approximation appear best?*
Explanation / Answer
coinFlip(n)
The approximation is best when the sample size increases and here is observed best when n = 20.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.