# Expectation of length of a confidence interval

Let $X_1,X_2,X_3,\cdots,X_9$ be a random sample of size $9$ from a normal distribution, $\mathcal{N}(\mu,\sigma^2)$. If $\sigma$ is unknown, find the expected value of the length of a $95\%$ confidence interval for $\mu$ provided the interval is based on the random variable $3(\overline{X}-\mu)/S$.

Can you please help me with this question? I am struggling with how to do this. I know that you use the Student t distribution when $\sigma$ is unknown but I am unsure how to integrate it into the expectation. Thanks for the help.

## migrated from math.stackexchange.comNov 14 '11 at 22:45

This question came from our site for people studying math at any level and professionals in related fields.

• Does en.wikipedia.org/wiki/… help? – Henry Nov 14 '11 at 7:53
• The solutions say that I need to write E(S) as (sigma / (n-1))* E[[(n-1)S^2/sigma^2)]^1/2] but I am unsure why I need to do that and I am uncertain how to continue after that. – icobes Nov 14 '11 at 7:56
• Hint: The length of the confidence interval is random only through the estimate of the standard deviation. What is the distribution of this quantity (or its square)? – cardinal Nov 14 '11 at 10:10
• Wherever I am more likely to get a response please. Thanks! – icobes Nov 14 '11 at 19:42
• More hints: (1) How are $\overline{X}$ and $S$ related to the width of the CI? (Write a formula.) (2) How is this width distributed? (3) Can you find the expectation of this distribution? (Be careful: remember that the expectation of a square root is not usually the same as the square root of an expectation.) If you're still stuck, let us know which of (1), (2), (3) you have figured out. – whuber Nov 14 '11 at 22:54

I'm aware that this is a 'homework' question but it has gone unanswered for over six months so I figure the homework has been turned in by now. Also, the hints in the comments (which I use directly here) are useful until you get to the point where you have to calculate the expected value of the sample standard deviation (a non-trivial exercise), which I give a link to in this answer.

For a sample $X_1, X_2, ..., X_n$ from a $N(\mu,\sigma^2)$ population, the $95 \%$ confidence interval for $\mu$ when the variance $\sigma^2$ is unknown is

$$\overline{X} \pm t_{n-1} \cdot \frac{s}{\sqrt{n}}$$

where $\overline{X} = \frac{1}{n} \sum_{i=1}^{n} X_i$ and $s = \sqrt{ \frac{1}{n-1} \sum_{i=1}^{n} (X_i - \overline{X})^2}$ and $t_{n-1}$ is the $97.5$th quantile of the $t$-distribution with $n-1$ degrees of freedom. From the expression for the confidence interval, we can see its width is the random variable $$W = 2t_{n-1} \cdot \frac{s}{\sqrt{n}}$$ The only random part of $W$ is $s$, therefore the expected width is $E(W) = \frac{2t_{n-1}}{\sqrt{n}} \cdot E(s)$, which reduces the problem to that of calculating $E(s)$ (which is calculated in this thread) and doing some algebra:

$$E(W) = \sigma \cdot t_{n-1} \cdot \sqrt{ \frac{8}{n(n-1)} } \cdot \frac{ \Gamma(n/2) }{\Gamma( \frac{n-1}{2} ) }$$

From that formula, we can plug in $n=9$ and find that $E(W) \approx 1.49 \sigma$. We can also plot $E(W)$ as a function of $n$:

$\ \ \ \ \ \ \ \ \$

• (+1) For the question and the answer. This is such a nice exercise for a statistics course. Sad the course I was T.A.'ing ended before doing it! – Néstor Jun 12 '12 at 8:37
• (+1) I always kind of liked this problem though it would have been nice at the time to see more development of it from the OP. My opinion is that it's appropriate and helpful to give an answer at this point, and you've given a nice one. (Unfortunately, the nature of the site is such that nice questions like these become somewhat less usable in assignments over time.) – cardinal Jun 12 '12 at 11:50
• @Néstor (and cardinal), I like this exercise too, although I'm not sure a student in an introductory class could be expected to know how to calculate $E(s)$. I'm curious what the level of the OP's course was. – Macro Jun 12 '12 at 12:25
• @Macro the course I was TA'ing was an introductory graduate course in statistics for astronomers, so the students in it would certainly be able to do this exercise. – Néstor Jun 13 '12 at 6:09