On finding a confidence interval. (exercise) I am having some problems with the second point of this exercise
Let $(X_1, \dots, X_n)$ be a random sample extracted from a population $X$ that is distributed as a uniform $(0, \theta)$ and let $Y_n = \max (X_1, \dots, X_n)$.
1) If one puts $Q( \theta, X_1 \dots X_n) = Y_n / \theta$ prove that the distribution of $Q$ does not depend on $\theta$.
2) Show how it is then possible to construct a confidence interval for $\theta$.
For point 1 I proceeded as follows (aside from the obvious cases $y < 0, y > 1$)  $$P(Y_n / \theta < y) = P(Y_n  < y\theta)  = (F_X(y \theta))^n = (y\theta / \theta )^n = y^n$$
For point 2 I am a bit lost, anyone mind lending a hand?
 A: For a $100(1-\alpha)\%$ two-sided confidence interval, you want to find $a$ and $b$ such that $P(a < \theta < b) = 1-\alpha$. It is equivalent to $P\left(\frac{Y_n}{b} < \frac{Y_n}{\theta} < \frac{Y_n}{a}\right)=1-\alpha$. So $\frac{Y_n}{b}$ will be the $\frac{\alpha}{2}$ percentile of the distribution of $\frac{Y_n}{\theta}$ and $\frac{Y_n}{a}$ is the $1-\frac{\alpha}{2}$ percentile so the area in between is $1-\alpha$.
In (1), you have that the CDF of $\frac{Y_n}{\theta}$ is $y^n$. Then you can have $\left(\frac{Y_n}{b}\right)^n=\frac{\alpha}{2}$ and $\left(\frac{Y_n}{a}\right)^n=1-\frac{\alpha}{2}$. You can solve for $a$ and $b$ as
\begin{align*}
a &= \dfrac{Y_n}{\left(1-\frac{\alpha}{2}\right)^{1/n}}\\
b &= \dfrac{Y_n}{\left(\frac{\alpha}{2}\right)^{1/n}}
\end{align*}
A $100(1-\alpha)\%$ confidence interval for $\theta$ is $\left[\dfrac{Y_n}{\left(1-\frac{\alpha}{2}\right)^{1/n}}, \dfrac{Y_n}{\left(\frac{\alpha}{2}\right)^{1/n}}\right]$.
A simple simulation in R:
> x <- runif(100, 0, 10)
> max(x)
[1] 9.924173
> max(x)/(1-0.025)^(1/100) # lower bound
[1] 9.926686
> max(x)/(0.025)^(1/100) # upper bound
[1] 10.2971

