Determine $n$ for two independent random variables $X,Y$

50 Views Asked by At

For a random variable $X$ and a random variable $Y$ (e.g., in experiment and control), independent samples of size $n$ each are to be taken. The standard deviation is assumed to be $σ = 10$ in both cases. How large must $n$ be for the $95\%$ confidence interval for $µ_X -µ_Y$ to have width $2$? You may use the normal approximation since $n$ will turn out to be quite large.

I tried

($\overline{x} - \overline{y}) \pm z * \sqrt{\frac{(n_x-1)σ_x^2 + (n_y-1)σ_y^2}{n_x+n_y-2}} * \sqrt{\frac{1}{n_x} + \frac{1}{n_y})}$

which is identical to (because of $n_x = n_y$)

($\overline{x} - \overline{y}) \pm z * \sqrt{\frac{(n-1)σ^2 + (n-1)σ^2}{n+n-2}} * \sqrt{\frac{2}{n})}$

Then I put in my known values ($z_{0.95} = 1.96$ and $ σ=10 $)

($\overline{x} - \overline{y}) \pm 1.96 * \sqrt{\frac{(n-1)10^2 + (n-1)10^2}{2n-2}} * \sqrt{\frac{2}{n})}$

I don't know what $\overline{x} - \overline{y}$ is, so I left this to $0$ and tried different numbers for $n$.

For $n = 768$, I got the interval $[-1,1]$.

Is this correct or do I need a different approach?

1

There are 1 best solutions below

0
On BEST ANSWER

$$Z=\frac{\bar X-\bar Y-(\mu_X-\mu_Y)}{\sqrt{\frac 1m+\frac 1n}\sigma}\sim\mathcal N(0,1)$$

so $P(-1.96<Z<1.96)=.95$ (with $Z$ being "standard normal") and $$P\left(-1.96<\frac{\bar X-\bar Y-(\mu_X-\mu_Y)}{\sqrt{\frac 1m+\frac 1n}\sigma}<1.96\right)=.95\\ P(\bar X-\bar Y-1.96\sigma\sqrt {\frac 2 {n}}<\mu_x-\mu_Y<\bar X-\bar Y+1.96\sigma\sqrt{\frac 2n})=.95$$

So the width of the confidence interval is $2(1.96)(10)\sqrt{\frac 2 n}=2$. Solving for $n$ gives $769$.