# What is the error on averaging?

• I
Let say I have a random number generator with numbers in and include between +200 to -200. We know the average has to be zero if you sample infinite number of times. How about you are only allow to sample 30 times, what is the maximum error from ideal zero in 30 random sampling?

Is there a formula for this? I am not a math student and this is not homework. This is a real life engineering problem I am facing. I have 140mVrms of white noise( total random) riding on a DC level. I want to find the DC level. I want to know if I spot sample 30 times and take the average, how accurate I can get to the true DC level.

Thanks

Related Set Theory, Logic, Probability, Statistics News on Phys.org
Dale
Mentor
This is called the standard error of the mean.

Can you help telling me how to calculate this?

Thanks

Mark44
Mentor
Can you help telling me how to calculate this?
Do a web search for "standard error of the mean". There should be tons of references to this very well known statistic.

I did, question is what is the standard of deviation of a total random number described in my original post? I know the deviation of 30 sample is σx=σ/√(30). But I need to know what is the σ for this. Is the σ = 200 in my case since it is total random? So σx = 200/5.48=36.5?

As I said before, this is not homework. I am an EE with a problem. I really not interested in learning statistics and spend hours in reading what is standard deviation as I will not use this ever again. Please tell me what is the σ in my original post and I assume σx is the deviation after 30 sampling. I would really appreciate your help so I can get on with my design.

Thanks

Last edited:
chiro
Hey yungman.

You are going to have to get a joint distribution of your sample and use statistics and intervals to estimate what the error is.

I say estimate because you will only get so many percent within the interval.

As an example - a 95% interval for some parameter means that 95% of the time, the real value will be in that interval that you get and the other 5% it will be outside it.

This is assuming that your probability model is correct - if it isn't then you have to update it to something that is more in line with what actually is correct.

At some point you need to make assumptions and once you do this you get your interval and/or point estimates and go from there.

I did, question is what is the standard of deviation of a total random number described in my original post? I know the deviation of 30 sample is σx=σ/√(30). But I need to know what is the σ for this. Is the σ = 200 in my case since it is total random? So σx = 200/5.48=36.5?
Thanks
No, σ will not be 200. To find σ, you will need to know what the distribution looks like. If the random numbers are uniformly distributed between -200 and 200, then σ = 115.47.

The formula for σ for a uniform random variable between a and b is σ = (b - a)/√12.

Last edited:
yungman
Dale
Mentor
But I need to know what is the σ for this. Is the σ = 200 in my case since it is total random?
I can't help more than that. I don't know what you mean by "total random". I know what a uniformly distributed random is, and I know what a Gaussian distributed random is, but I don't know what a total random is.

I can't help more than that. I don't know what you mean by "total random". I know what a uniformly distributed random is, and I know what a Gaussian distributed random is, but I don't know what a total random is.
There goes to show you how little I know about this subject. I already spent almost an hour reading this topic after you told me what to look for. My knowledge of statistics was from high school......50 years ago!!!

What I meant total random is like there is no pattern, possibility of any number comes up between +200 and -200 is the same. I don't know exactly what is Gaussian distribution. It's like the probability of any number comes up within the range is the same. I don't know how to say it better anymore.

Thanks

Dale
Mentor
possibility of any number comes up between +200 and -200 is the same.
That sounds like a uniform distribution.

there is no pattern
That sounds like an independent, identically distributed (IID) sample

For an IID sample of a uniform distribution @Heinera has given the calculation for the standard error.

https://en.m.wikipedia.org/wiki/Uniform_distribution_(continuous)

yungman
No, σ will not be 200. To find σ, you will need to know what the distribution looks like. If the random numbers are uniformly distributed between -200 and 200, then σ = 115.47.

The formula for σ for a uniform random variable between a and b is σ = (b - a)/√12.
Thanks, I just remember σ = (b - a)/√12.

In my circuit, the +/-200 is actually noise voltage I see on the oscilloscope. It was +/-200mV or noise. I want to reduce the noise by sampling 30 times and use it to reduce the noise output. 30 times is all the time I can afford to sample within that period.

I was thinking, the formula said σx=σ/√(30)= σ/5.48, this means I would expect to see improvement of 5.48 times. That is after sampling, I would expect the noise will reduce by +/-200mV/5.48=+./-36.5mV.

I really don't even have to know the σ, all I have to know is σx= σ/5.48. The noise is proportional to this.

You think this is correct?

Thanks

Hey yungman.

You are going to have to get a joint distribution of your sample and use statistics and intervals to estimate what the error is.

I say estimate because you will only get so many percent within the interval.

As an example - a 95% interval for some parameter means that 95% of the time, the real value will be in that interval that you get and the other 5% it will be outside it.

This is assuming that your probability model is correct - if it isn't then you have to update it to something that is more in line with what actually is correct.

At some point you need to make assumptions and once you do this you get your interval and/or point estimates and go from there.
Sorry, I really don't understand this, it's so over my head, but thanks.

That sounds like a uniform distribution.

That sounds like an independent, identically distributed (IID) sample

For an IID sample of a uniform distribution @Heinera has given the calculation for the standard error.

https://en.m.wikipedia.org/wiki/Uniform_distribution_(continuous)
I think this is it.

Please help me by looking at post #9. If my assumption is correct that I reduce the noise by 5.48 time by sampling 30 times, that's my answer already. Hopefully I don't have to go any deeper on this.

Thanks

I really don't even have to know the σ, all I have to know is σx= σ/5.48. The noise is proportional to this.

You think this is correct?

Thanks
Yes, but only if every data point in your sample of 30 are independent, and they all have the same distribution. It sounds like you have an analog signal that you are digitally sampling. If these samples are made with a high frequency (that is, with a short time interval between them), then there are several possible (and pausible) reasons that they might not be independent, and other formulas will apply. Best way of figuring this out is to do a lot of samples and running them through some statistical tests, before you start implementing your design.

Last edited:
FactChecker
Gold Member
You must be careful to distinguish between the maximum error and the expected error. It is highly unlikely, but possible to get all 30 values of 200. In that case, the error would be 200 and that is the maximum (you can also get -200). You may want to consider the expected error of the average, or the probability distribution of the sample error.

chiro