Confidence interval in U(0, $\theta$) Let $X_n = X_1, X_2,..., X_n$ be a random sample of $X \sim U(0, \theta)$,
where $\theta$ is an unknown parameter. Assuming confidence level $1 — 
\alpha$, find confidence interval for $\theta$ where:
a) n = 2
b) n $\geqslant$ 100
I've got answers for this question yet I still cannot solve it. I need an explanation.
Answers:
a) $\langle\frac{2\overline{X}_2}{2-\sqrt{\alpha}},\frac{2\overline{X}_2}{\sqrt{\alpha}}\rangle$
b) $\langle\frac{2\overline{X}_{100}}{2-\sqrt{\alpha}},\frac{2\overline{X}_{100}}{\sqrt{\alpha}}\rangle$
 A: I am wondering how you get this confidence interval. My method could be using the pivot, but result in different interval.
Let $Q = \frac{X_{(n)}}{\theta}$, where $X_{(n)}$ is the largest order statistics of $X_1, ......, X_n$. Then, 
$$P(Q \le t) = \prod_{i=1}^nP(X_i \le t\theta) = t^n$$ 
, so Q is a pivot (independent of the parameter $\theta$). Take $c_n = \alpha^{\frac{1}{n}}$ we obtain $P(Q \le c_n) = \alpha$ and given that $P(Q \le 1) = 1$, we have
$$1 - \alpha = P(c_n \le Q \le 1) = P(c_n \le \frac{X_{(n)}}{\theta} \le 1) =P(X_{(n)} \le \theta \le \frac{X_{(n)}}{c_n})$$ 
So the $1-\alpha$ confidence interval for $\theta$ is $\Big(X_{(n)}, \frac{X_{(n)}}{\alpha^{\frac{1}{n}}}\Big)$
Finally you can plug in n = 2 and n = 100 to get different answers. (But sorry it is not the same you give here.)
A: For $n=2$, note that $X_1/\theta$ and $X_2/\theta$ are independent $U(0,1)$ variables.  
This means $T=(X_1+X_2)/\theta$ has the density
$$f_T(t)=t\mathbf1_{0<t<1}+(2-t)\mathbf1_{1<t<2}$$
So here $T=\frac{2}{\theta}\overline X$ is your desired pivot for constructing a confidence interval for $\theta$.
Now there exist $t_1,t_2$ such that for all $\theta>0$, $$P_{\theta}\left(t_1<\frac{2\overline X}{\theta}<t_2\right)=1-\alpha\tag{1}$$
That is, $$P_{\theta}\left(\frac{2\overline X}{t_2}<\theta<\frac{2\overline X}{t_1}\right)=1-\alpha$$
And $t_1,t_2$ is found in terms of $\alpha$ from condition $(1)$, namely $$\int_{t_1}^{t_2} f_T(t)\,dt=1-\alpha$$
Similar reasoning should be valid for a general $n$ variables, where a pivot for $\theta$ is given by $\frac{1}{\theta}\sum\limits_{k=1}^n X_k=\frac{n}{\theta}\overline X$, having the Irwin-Hall distribution.
