Let $x_1, x_2, x_3,...........,x_n$ denote the observations taken from a $Uniform \\ Distribution$ with pdf:
`f(x, \theta) = 1 ; \theta - \frac{1}{2} \leq x \leq \theta + \frac{1}{2}, -\infty < \theta < \infty`
we need to compute the maximum likelihood estimator of $\theta$.
Considering the $\log$ function for the pdf,
`L(\theta ; x) = \prod_{i=1}^{n} f(x_{i}, \theta) = \prod_{i=1}^{n} I_{(0,\theta)}(x_{i})`
`L =L(\theta ; x_1, x_2,.....,x_n)=\begin{cases} 1 & \text{,}\theta - \frac{1}{2}\leq x_i \leq \theta + \frac{1}{2} \\0 & \text{, } otherwise \end{cases}`
id $x_{(1)},x_{(2)},x_{(3)},................x_{(n)}$ is the order sample, then
`\theta - \frac{1}{2} \leq x_{(1)},x_{(2)},x_{(3)},................x_{(n)} \leq \theta + \frac{1}{2}`
Thus, $L$ will attain the maximum if
`\theta - \frac{1}{2} \leq x_{(1)} ,and, x_{(n)} \leq \theta + \frac{1}{2}`
`\theta \leq x_{(n)} + \frac{1}{2} ,and, x_{(n)} - \frac{1}{2} \leq \theta`
Hence every statistic $t = t \left( x_1, x_2, x_3,...........,x_n \right)$ such that
`x_{(n)} - \frac{1}{2} \leq t \left( x_1, x_2, x_3,...........,x_n \right) \leq x_{(1)} + \frac{1}{2}`, provides an MLE for $\theta$
The likelihood function for $\theta$ is
`L(\theta) = \prod_{i=1}^{n} f_{X}(x_{i}) \Rightarrow \prod_{i=1}^{n} \frac{1}{\theta^{n}}I_{(0, \theta)}(x_{n})`
Here the likelihood function is maximum when the value of $\theta$ is maximum where $x_{(n)}$ order statistic is maximum. So $L(0, \theta)$ is maximum for the value of $x_{(n)}$. There for the MLE of $\theta$ is
`\hat{\theta}_{MLE} = X_{(n)}`