# How many samples should be taken to capture the mean and variance of the original set with given error?

I have a set $S$ of $N$ real numbers. I wanna calculate the mean $m$ variance $v$ of $S$. But since $N$ is too large, I do not want to use all of the numbers. Instead, I would like to sample $n$ numbers uniformly randomly from the $N$-number set $S$, such that mean and variance of the sampled set does not deviate too much from the original set. Say, the error I can tolerate is $e_m$, and $e_v$ respectively (which means that the mean of the sample set should fall in $(1 \pm e_m)m$, and the sample variance should fall in $(1\pm e_v)v$). How large should $n$ be?

• Can you say anything about the distribution of the numbers in $S$? One worry is that $S$ could contain, say, $N-1$ values in the interval $[0,1]$ and another value near $N^2$. Unless the sample is large enough to contain that last value with high probability, neither the sample mean nor the sample variance will be anywhere near the mean and variance of $S$ itself. – whuber Mar 24 '12 at 19:05
• Hi @whuber, thank you very much for your reply. I am trying to consider the generalized case without assumptions on the distribution. With your explanation, I understand that it is kind of impossible. – Geni Mar 24 '12 at 19:18