# 两个正态总体均值差的区间估计

1，$$\sigma_1^2,\sigma_2^2$$ 已知，这时因为 $$X_1\sim N(\mu_1,\sigma_1^2), X_2\sim N(\mu_2,\sigma_2^2)$$，

\begin{array}{ll}\Rightarrow& \bar{x_1}\sim N(\mu_1,\frac{\sigma_1^2}{n_1}), \bar{x_2}\sim N(\mu_2,\frac{\sigma_2^2}{n_2})\\ \Rightarrow& \bar{x_1}-\bar{x_2}\sim N(\mu_1-\mu_2, \frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2})\\ \Rightarrow&\frac{(\bar{x_1}-\bar{x_2})-(\mu_1-\mu_2)}{\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}}}\sim N(0,1)\end{array}

$\left[\bar{x_1}-\bar{x_2}-z_{\frac{\alpha}{2}}\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}},\bar{x_1}-\bar{x_2}+z_{\frac{\alpha}{2}}\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}} \ \right]$

2，$$\sigma_1^2=\sigma_2^2=\sigma^2$$ 未知，则（直接推导可得，式子较复杂）

$\frac{(\bar{x_1}-\bar{x_2})-(\mu_1-\mu_2)}{\sqrt{(n_1-1)s_1^2+(n_2-1)s_2^2}}\cdot\sqrt{\frac{n_1n_2(n_1+n_2-2)}{n_1+n_2}}\sim t(n_1+n_2-2)$

$$\mu_1-\mu_2$$ 的置信区间为

\begin{array}{l}\left[\bar{x_1}-\bar{x_2}-z_{\frac{\alpha}{2}}\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}},\bar{x_1}-\bar{x_2}+z_{\frac{\alpha}{2}}\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}} \ \right]\\ =\left[1.4-1.65\sqrt{\frac{16}{15}+\frac{9}{20}},1.4+1.65\sqrt{\frac{16}{15}+\frac{9}{20}}\right]\\ =[-0.632, 3.432]\end{array}

$\frac{(\bar{x_1}-\bar{x_2})-(\mu_1-\mu_2)}{\sqrt{(n_1-1)s_1^2+(n_2-1)s_2^2}}\cdot\sqrt{\frac{n_1n_2(n_1+n_2-2)}{n_1+n_2}}\sim t(n_1+n_2-2)$

$$99\%$$ 的置信水平，$$\alpha=0.01$$，

$t_{\frac{\alpha}{2}}(n_1+n_2-2)=t_{0.005}(10)=3.1693$

$$\mu_1-\mu_2$$ 的置信区间为

\begin{array}{l}\left[(\bar{x_1}-\bar{x_2})-t_{\frac{\alpha}{2}}(n_1+n_2-2)\cdot\sqrt{\frac{(n_1+n_2)\cdot((n_1-1)s_1^2+(n_2-1)s_2^2)}{n_1n_2(n_1+n_2-2)}},\right. \\ \quad\left. (\bar{x_1}-\bar{x_2})+t_{\frac{\alpha}{2}}(n_1+n_2-2)\cdot\sqrt{\frac{(n_1+n_2)\cdot((n_1-1)s_1^2+(n_2-1)s_2^2)}{n_1n_2(n_1+n_2-2)}}\right]\\ =\left[20-3.1693\cdot\sqrt{\frac{12(4\cdot 28^2+6\cdot 32^2)}{35\cdot 10}},20+3.1693\cdot\sqrt{\frac{12(4\cdot 28^2+6\cdot 32^2)}{35\cdot 10}}\right]\\ =[-36.53,76.53]\end{array}