# Confidence Interval, uniform distribution

Let $X_1,...X_n$ random sample from $f(x;\theta)=I_{[\theta-\frac{1}{2};\theta+\frac{1}{2}]}(x)$. i) Show that $(X_{(1)},X_{(n)})$ is a confidence interval for $\theta$.ii) find your confidence level.

The first item I do not know how to show that a range is confidence interval.

In the second item I tried $$P(X_{(1)}\leq \theta \leq X_{(n)})=P(X_{(n)}\geq\theta)-P(X_{(1)}\leq \theta)$$.

But the solutions say that $P(X_{(1)}\leq \theta \leq X_{(n)})=P(X_{(n)}\geq\theta)-P(X_{(1)}\geq \theta)$

But I don't understand this inequality,where $X_{(n)}$ is the max and $X_{(1)}$ is the minimum

2. The second can be easily seen by drawing a picture. Loosely speaking, the region between (green) is the region to the left of $X_{(n)}$ (blue) minus the region to the left of $X_{(1)}$ (red). So the set of cases where the region between the two encompasses the parameter is the set of cases where the parameter is left of $X_{(n)}$ minus those cases where it's also left of $X_{(1)}$.
• But the cases where $X_{(1)}$ is left don't means $P(X_{(1)}<\theta)$? – user72621 May 17 '15 at 2:32
• I think now I understand it, is $P(X_{(1)}>\theta)$ because if $X_{(1)}>\theta$ this means that $\theta$ is out of the confidence interval, right? – user72621 May 17 '15 at 2:49
• Clearly, yes, in that case the CI would not include $\theta$. – Glen_b -Reinstate Monica May 17 '15 at 3:02