The sample size required to obtain a confidence interval with an expected margin of error no larger than m for a population mean satisfies the constraint
m≥t*s*/√n
where t* is the critical value for the desired level of confidence with n−1 degrees of freedom, and s* is the guessed value for the population standard deviation.
The sample sizes necessary for a two-sample confidence interval can be obtained using a similar constraint, but we would now need to guess both standard deviations and decide on an estimate for the degrees of freedom. We suggest using the smaller of n1−1 and n2−1.