We want to use coin flips to estimate the population proportion of Heads using a parameter and point estimator.
- Parameter: Probability of Heads “\(p\)”
- Point Estimator: Sample Proportion “\(\hat{p} = \frac{X}{n}\)”
2026-02-08
We want to use coin flips to estimate the population proportion of Heads using a parameter and point estimator.
If a coin is flipped \(n\) times and we observe the amount of times \(X\) it lands on Heads:
\[\hat{p} = \frac{X}{n}\]
When flipping a coin a repeated number of times, there’s a difference in answers. To calculate this difference, we calculate the Standard Error: including the
Theoretical Standard Error: \(SE(\hat{p})\) and Estimated Standard Error: \(\widehat{SE}(\hat{p})\)
\[ SE(\hat{p}) = \sqrt{\frac{p(1-p)}{n}} \qquad \widehat{SE}(\hat{p})=\sqrt{\frac{\hat{p}(1-\hat{p})}{n}} \]
Creation of repeated coin flip experiments and the distribution of \(\hat{p}\) plotted
Using this graph, we can test the estimate variability among different sample sizes. The results of the graph show that when using larger samples, it produces more consistent and precise estimates.
Using this graph, we can take a closer look on the effect different sample sizes have on distribution. We can see that tests with a larger sample size give a more consistent and accurate data set, closest to 50/50 Heads vs Tails as possible.
p_true <- 0.6 # real probability the coin lands on heads n <- 50 # number of times coin is flipped B <- 2000 # number of times experiment is repeated phat <- replicate(B, rbinom(1, size = n, prob = p_true) / n) #main simulation for coin flip m <- mean(phat) # average of all estimates s <- sd(phat) #standard deviation of estimates m
## [1] 0.60165
s
## [1] 0.06911343
-Using the generated simulated coin flips we collected data and compared it to a known true probability
-From each sample, we estimated the probability using \(\hat{p}\)
-By repeating the samples and test, it showed how the estimate changes across experiments
-The graphs showed a tighter distribution of reesults when the sample size was increased
-Overall, these tests and data show how sample size improves estimate reliability and shows how point estimation works.