What is the confidence interval if I compute the total number of bits based on the average number of bits in sampled bins?

Let's say I want to estimate the total number N marbles among M sacks of marbles. The marbles are assumed to be normally distributed. I can't count them all, so I decide to sample S sacks. I get the mean # of marbles from the S sacks, then assume it to be the mean for the M sacks, and multiply. How far off am I from N, as a function of the size of S? How confident can I be?

• What does "The marbles are assumed to be normally distributed." mean here? Does this mean the number of marbles per sack are assumed to be normally distributed? Are negative numbers of marbles per sack permitted (normal distribution goes $\infty to \infty$)? May 1, 2014 at 18:57
• good point. by, "normally distributed", I suppose I just mean that most sacks have a middling amount of marbles, tapering towards zero (some will have zero), and then tapering towards some unknown bigger number. May 1, 2014 at 20:53

For sample size of $n$ normally distributed values $X_1,...,X_n$,
You calculate the sample mean $\bar X$ and sample variance $S_x^2$.
You have $\frac{\bar X-E(X)}{S_x/\sqrt n}\sim t(df=n-1)$ a t-distribution.
You can construct a $95\%$ CI of $E(X)$ as $\bar X\pm S_x/\sqrt n \times t(0.975,n-1)$.
Based on the $95\%$ CI of $E(X)$ you can calculate the total number of $N$ marbles among $M$ sacks.