Maximum Likelihood Estimator - What did I do wrong?

#1
For a X_1,…,X_n random sample from a uniform distribution from [0, 2*theta+1], I was asked to find the MLE. The pdf: f(x|theta) = 1/(2*theta+1) for x in [0, 2*theta+1] and 0 otherwise.

I determined the likelihood(theta)=L(theta)=(2*theta+1)^-n
Then the log-likelihood to be -n*(2*theta+1), finding the first derivative and setting to 0 to maximize is ineffective. Examining the likelihood function, X_(n), the MAX(X_1,…,X_n) should maximize the likelihood function.

Professor says I am wrong in developing my likelihood function. Can anybody help?

Thanks in advance.
 

Dason

Ambassador to the humans
#2
Your likelihood is (almost) correct but it's missing the key piece for this problem. Is it possible for (2*theta+1) to be smaller than any of the observed data values?
 

Dason

Ambassador to the humans
#4
Then your likelihood needs to be 0 if 2*theta+1 is less than than any of the values (this can be simplified to a single comparison). You might consider using an indicator function.