Confidence interval for Uniform($\theta$, $\theta + a$) I am encountering a difficulty with the following task.  Have I made a mistake, or is this an inherent flaw in the notion of confidence intervals?  (Other such flaws exist.)
Consider a random sample $X_1,\ldots , X_n$ from a Uniform($\theta$, $\theta + a$) distribution, where $\theta$ is unknown and $a$ is known.  We wish to determine a confidence interval for $\theta$.
The reader may verify the following details: The statistics $Y=\text{min}_i X_i$ and $Z=\text{max}_i X_i$ are jointly sufficient for $\theta$.  For  $\theta \le c_1 \le c_2 \le \theta + a$,
$P\{c_1 \le Y \le Z \le c_2\} = [(c_2 - c_1)/a]^n$.  For $0 < \gamma < 1$, set $d_1 =(1-\sqrt[n]\gamma)/2$ and $d_2 =(1+\sqrt[n]\gamma)/2$.  Then
$\gamma = P\{\theta + ad_1 \le Y \le Z \le \theta + ad_2\} = 
P\{Z -ad_2 \le \theta \le Y-ad_1\}$.  Thus, $[Z -ad_2, Y -ad_1]$ is a $\gamma$ confidence interval for $\theta$.
Now here's the difficulty:  If we observe $Z - Y > a\sqrt[n]\gamma$, then $Z -ad_2 > Y -ad_1$, so our formula yields a nonsensical answer.  Have I made an error in my calculations?  Or is this one of those problems with confidence intervals?
(Homework?  I guess so - but a homework problem that I wrote for my students.  Inspired by another problem in DeGroot & Schervish.)
 A: The key point here is that confidence intervals are not uniquely determined by the distribution, but can be chosen in a number of different ways, although there are standard ways in which it may be done. These choices gear the test to look for, or emphasise, particular kinds of deviation from the hypotheses being tested.
The test you have formulated is valid, but chosen very badly in that it rejects all cases where $Z-Y$ gets sufficiently close to $a$.
While it is true that the pair $Y,Z$ are sufficient statistics, you may note that the distribution of $U=Z-Y$ is independent of $\theta$. A common approach for constructing good confidence intervals is to condition on $U$: i.e., to find $c_U$ so that
$$\Pr[Z-a+c_U\le\theta\le Y-c_U\mid U=u]=1-\alpha$$
for all $u$. Unless I'm very mistaken, the distribution of $Y$ conditional on $U$ is uniform in $[\theta,\theta+a-U]$. If we let $c_U=(a-U)\cdot\alpha/2$, we get
$$\Pr[Z-a+c_U\le\theta\le Y-c_U]=1-\alpha$$
which is true conditional on $U=u$ for any $u$, and hence is true in general.
A: There's nothing wrong with your calculations; this is indeed a flaw in the notion of confidence intervals.
Your logic is all correct up until the "Thus" at the start of the last sentence of your third paragraph.  Given $\theta$ and $a$, I think the following conclusions are correct:


*

*Given $c_1$ and $c_2$ such that $\theta \leq c_1 \leq c_2 \leq \theta + a$, the probability that $Y$ and $Z$ will satisfy $c_1 \leq Y \leq Z \leq c_2$ is $\left(\frac{c_2-c_1}{a}\right)^n$.

*Given $\gamma$ such that $0 < \gamma < 1$, and letting $d_1 \triangleq \frac{1 - \sqrt[n]\gamma}{2}$ and $d_2 \triangleq \frac{1 + \sqrt[n]\gamma}{2}$, the probability that $Y$ and $Z$ will satisfy $Z - ad_2 \leq \theta \leq Y - ad_1$ is $\gamma$.
Note the direction of the reasoning, however: you've made an assumption about $\theta$, and drawn inferences about the probability that $Y$ and $Z$ will satisfy certain predicates.  But by trying to set a confidence interval on $\theta$, you're trying to go in the other direction: measuring $Y$ and $Z$ and trying to use them to draw inferences about $\theta$. If you want to reason in that direction, you need a Bayesian prior!
It's entirely possible that you'll end up with $Y$ and $Z$ such that $Z - ad_2 >  Y - ad_1$, thus making nonsense of the inequality $Z - ad_2 \leq \theta \leq Y - ad_1$. But the probability of that outcome won't exceed $(1 - \gamma)$!
A: Just as further verification that you didn't just make a silly algebra mistake somewhere, here's what Mathematica has to say:

