In: Statistics and Probability
This is a question answered by R.
**In this problem, we'll use simulation to think about survey sampling. Suppose I want to plan a survey to learn what percentage of students prefer coffee to tea.**
a. **Let *X* be the number of students in my sample that prefer coffee. If I survey *n* students, and the true proportion of students that prefer coffee is *p*, then we can model *X* as a Binomial(*n*, *p*) random variable. If I survey ten students, what is the theoretical probability that more than 60% of my sample prefer coffee? Your answer should be a formula or an R command you could use to answer this question for any p**
c. **We can also use simulation to explore this situation. Generate 1000 samples from a Binomial(10, 0.5) random variable X. What proportion of generated samples have sample proportions greater than 60%? Using your formula from a. with p = 0.5, calculate the theoretical probability of observing a sample proportion greater than 60% and compare. **
We see that, the simulated proportion is pretty close to the theoritical probability.