population $X$ has a mean value $\mu,$ a variation $\sigma^2$, samples $X_1, …, X_n(n \text{ sufficiently big})$, then from CLT,
$$ \frac{ \sum^n_{i=1} X_i - n\mu}{\sqrt{n} \sigma} \overset{\cdot}\sim N(0,1), $$
therefore, the confidence interval of $\mu$ at confidence level $1-\alpha$ is
$$ (\bar X\pm\frac{\sigma}{\sqrt{n}}z_\frac{\alpha}{2}). $$
if $\sigma^2$ unknown, then use estimator $S^2$ to replace $\sigma^2$, get the interval
$$ (\bar X\pm\frac{S}{\sqrt{n}}z_\frac{\alpha}{2}). $$
if $n ≤ 50,$ experience shows that $t-$distribution has fine robustness, which is
$$ \frac{\bar X -\mu}{\frac{S}{\sqrt{n}}}\overset{\cdot}\sim t(n-1), $$
therefore we have the confidence interval
$$ (\bar X\pm\frac{S}{\sqrt{n}}t_\frac{\alpha}{2}(n-1)). $$
<aside> <img src="/icons/light-bulb_lightgray.svg" alt="/icons/light-bulb_lightgray.svg" width="40px" /> $X\sim B(1,p), p$ unknown, $X_1, X_2, …, X_n$ are samples, $n>50.$ Solve the $1-\alpha$ confidence interval of $p$. From CLE,
$$ G=\frac{\sum^n_{i=1}X_i -np}{\sqrt{np(1-p)}} = \frac{n\bar X - np}{\sqrt{np(1-p)}}\overset{\cdot}\sim N(0,1) $$
then $P\{-z_\frac{\alpha}{2}<G<z_\frac{\alpha}{2}\}\approx 1-\alpha$. $-z_\frac{\alpha}{2}<G<z_\frac{\alpha}{2}\Rarr (n+z_{\frac{\alpha}{2}}^2)p^2 -(2n\bar X + z_\frac{\alpha}{2}^2)p+n\bar X^2<0\Rarr p_1, p_2(p_1<p_2)$. therefore, the confidence interval is $(p_1, p_2)$.
</aside>
<aside> <img src="/icons/light-bulb_lightgray.svg" alt="/icons/light-bulb_lightgray.svg" width="40px" /> e.g.2 $X \sim f(x) = \left \{ \begin{array} {lc} \lambda e^{-\lambda x} &,x>0 \\ 0 &, x≤0 \end{array} \right.$, $\lambda > 0$ unknown, $X_1, …, X_n$ are samples. (1) prove $2\lambda n \bar X \sim \chi^2(2n).$ (2) solve for upper $(1 -\alpha)$ confidence limit of $\lambda$. (1) $2\lambda n \bar X = 2\lambda X_1 +…+ 2\lambda X_n$, let $Y = 2\lambda X, y' =2\lambda >0$, reverse function: $x =\frac{y}{2\lambda}$. then $f_Y (y) = \left \{ \begin{array} {lc} f(\frac{y}{2\lambda})|(\frac{y}{2\lambda})|' = \frac{1}{2}e^{-\frac{y}{2}} & , y>0 \\ 0 & , y \le 0 \end{array} \right.$. From $\chi^2$’s property: $E(\frac{1}{2}) = \chi^2(2)$, $Y\sim \chi^2(2)$. therefore, $2\lambda n \bar X = n Y\sim \chi^2(2n).$ (2) let $G=2\lambda n \bar X\sim\chi^2(2n),$ then $P(G<\chi^2_\alpha(2n)) = 1-\alpha.$ $\Rarr P(\lambda < \frac{\chi^2(2n)}{2n \bar X} ) = 1-\alpha$, the upper $1-\alpha$ limit is $\frac{\chi^2(2n)}{2n \bar X}.$
</aside>