# Finding sample mean of a probability distribution

I am pretty lost on how to even look at this

Let $$X$$ be identical and independently distributed exponential random variables with parameter $$\lambda = 1$$ for $$i = 1,2,\dots,n$$. Then$$\sum X_i \ \sim Gamma (n,1)$$. Find the probability that the sample mean is within $$2$$ standard deviations of the true mean, for

• n=4
• n=12
• n=20
• n=20 using an appropriate approximate distribution

I've thought of this so far, which may be wrong: $$E(\bar{x}) = 1 \ (which\ I\ figured\ out\ because\ beta=1\ in\ Exp(1)\ )\\ Var(\bar{x}) = \frac{\beta^2}{n} ---> s.d. = \frac{1}{2}$$ And then I would approximate the probabilities with a normal distribution with a $$z$$-test. I am basically unsure if I am even going through this correctly though, any help would be appreciated.

As you were told, $$\sum_{i=1}^n X_i \sim \operatorname{Gamma}(n, 1)$$, where each $$X_i \sim \operatorname{Exponential}(\lambda = 1)$$ is iid. What this statement indicates is that the sample total of $$n$$ iid observations $$(x_1, \ldots, x_n)$$ from an exponential distribution with rate $$1$$ is gamma distributed with shape $$n$$ and rate $$1$$. Therefore, consider the sample mean $$\bar X = \frac{1}{n} \sum_{i=1}^n X_i$$ which by virtue of a scale transformation, must also be gamma distributed. Explicitly, and for ease of notation, let $$T_n = \sum_{i=1}^n X_i$$, so that $$\bar X = T_n/n$$. Then $$f_{\bar X}(x) = f_{T_n}(nx) \left|\frac{d}{dx}[nx]\right| = nf_{T_n}(nx) = n \frac{(nx)^{n-1} e^{-nx}}{\Gamma(n)};$$ in other words, $$\bar X \sim \operatorname{Gamma}(n, n),$$ where the parametrization is by rate. For a general gamma distribution with shape $$n$$ and rate $$\lambda$$, the mean is $$n/\lambda$$ and the variance is $$n/\lambda^2$$; so $$\operatorname{E}[\bar X] = 1, \quad \operatorname{Var}[\bar X] = 1/n.$$ You would therefore need to numerically calculate for the first case $$n = 4$$ $$\Pr[1 - 2\sqrt{1/4} < \bar X < 1 + 2\sqrt{1/4}] = \Pr[0 < \bar X < 2]$$ where $$\bar X$$ is distributed as above. This can be done, for example, by computing via integration by parts $$\Pr[0 < \bar X < 2] = \int_{x=0}^2 \frac{128}{3} x^3 e^{-4x} \, dx.$$ For $$n = 12$$, this becomes $$\Pr\left[1 - \tfrac{1}{\sqrt{3}} < X < 1 + \tfrac{1}{\sqrt{3}}\right] = \frac{2^{16} 3^8}{1925} \int_{x=1-1/\sqrt{3}}^{1+1/\sqrt{3}} x^{11} e^{-12x} \, dx.$$ For $$n = 20$$, a normal approximation is appropriate; we would say that $$Z = \frac{\bar X - \operatorname{E}[\bar X]}{\sqrt{\operatorname{Var}[\bar X]}} = \frac{\bar X - 1}{\sqrt{1/20}} \sim \operatorname{Normal}(0,1)$$ approximately, hence the probability that $$\bar X$$ is two standard deviations within the mean is simply $$\Pr[|Z| < 2],$$ which we can calculate without any information about $$\bar X$$--it comes from a standard normal table.
• @ajdawg For positive integers $n$, $\Gamma(n) = (n-1)!$, so for example, $\Gamma(4) = 3! = 6$. The integral representation is not necessary because $n$ is a sample size, and the other parts of the calculation do not apply since you are integrating over a finite interval. Commented Nov 9, 2018 at 9:30