Simulation Assignment 1: Sequential CI

Goal: Use simulation to show the asymptotic normality and coverage validity of the purely sequential confidence interval at \(\alpha = 0.95\) and margin of error \(d=0.5\).

\[ n \geq \frac{z_{\alpha/2}^2 S_n^2}{d^2} \]

where \(z_{\alpha/2}=\) qnorm(0.025), \(S_n^2\) is the variance of the pilot sample, \(d=0.5\) is the predefined maximum margin of error.

Equivalently, you can compute the width of the confidence interval using the pilot sample, and compare it with the margin of error \(d\). Please note interval width is \(2d\) when margin of error is \(d\).