In my homework I have $X_1,...,X_n$ which are all uniformly distributed on $(0,\theta)$
I have concluded that the $MLE=\hat{\theta}=max(X_1,...,X_n)$ because:
$L_x(\theta)= \frac{1}{\theta^n}$ so the likelihood is a decreasing function. However we also know that $\theta > \max\left(X_1,...,X_n\right)$, hence $\hat{\theta}=\max\left(X_1,...,X_n\right)$
But I need to find an exact $95$% confidence interval for $\theta$. I think the book wants me to find a pivot
I have tried to set $P\left(X \in \left(0,X_n\right)\right)=\left(\frac{X_n}{\theta}\right)^n$ for some $\theta>X_n$
Therefore $P(X \in (X_n,\theta))=1-\left(\frac{X_n}{\theta}\right)^n=0.95$ which gives me
$\theta=\frac{X_n}{0.05^{1/n}}$
However I am pretty sure this is not the way to go and it is not a standard method. There should be some more standard method but using $L,\ell_X, \ell_X'=0$ just gives me MLE=0 which is of no use
Any help/hint would be appreciated
Your estimator is definitely wrong. Please check your work. As for the confidence interval it will probably be a one sided confidence interval. If you will use the basic definition of confidence interval you will be good to go. Hint: $P(max(X_1, X_2, X_3,.....,X_n)< c) = \prod_{i=1}^{n}{P(X_i<c)}$